张延森 5 jaren geleden
bovenliggende
commit
45b30118e2

+ 19
- 4
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Bestand weergeven

@@ -29,6 +29,7 @@ import io.swagger.annotations.ApiImplicitParam;
29 29
 import io.swagger.annotations.ApiImplicitParams;
30 30
 import io.swagger.annotations.ApiOperation;
31 31
 import org.apache.commons.collections.CollectionUtils;
32
+import org.apache.poi.ss.formula.functions.T;
32 33
 import org.springframework.beans.factory.annotation.Autowired;
33 34
 import org.springframework.context.ApplicationContext;
34 35
 import org.springframework.format.annotation.DateTimeFormat;
@@ -611,7 +612,11 @@ public class TaRecommendCustomerController extends BaseController {
611 612
      * @return
612 613
      */
613 614
     @RequestMapping(value="/admin/customer/recommend/verify/{id}",method= RequestMethod.PUT)
614
-    public ResponseBean taRecommendCustomerVerify(@PathVariable String id,@RequestParam Integer verifyStatus, @RequestParam(required = false) String verifyRemark, HttpServletRequest request){
615
+    public ResponseBean taRecommendCustomerVerify(@PathVariable String id,
616
+                                                  @RequestParam Integer verifyStatus,
617
+                                                  @RequestParam(required = false) String verifyRemark,
618
+                                                  @RequestParam(required = false) String realtyConsultant,
619
+                                                  HttpServletRequest request){
615 620
         if (null == verifyStatus) {
616 621
             return ResponseBean.error("审核结果非法", ResponseBean.ERROR_ILLEGAL_PARAMS);
617 622
         }
@@ -623,14 +628,24 @@ public class TaRecommendCustomerController extends BaseController {
623 628
                 taRecommendCustomer.setVerifyStatus(verifyStatus);
624 629
                 if(!StringUtils.isEmpty(verifyRemark)){
625 630
                     taRecommendCustomer.setVerifyRemark(verifyRemark);
626
-                    if(CommConstant.CUSTOMER_REPORT.equals(taRecommendCustomer.getReportRecommendStatus())){
627
-                        taRecommendCustomer.setRealtyConsultant(taRecommendCustomer.getRecommendPerson());
628
-                    }
631
+//                    if(CommConstant.CUSTOMER_REPORT.equals(taRecommendCustomer.getReportRecommendStatus())){
632
+//                        taRecommendCustomer.setRealtyConsultant(taRecommendCustomer.getRecommendPerson());
633
+//                    }
629 634
                 }
630 635
 
631 636
                 // 审核不通过的时候,移除置业顾问选择
632 637
                 if (CommConstant.VERIFY_DISAGREE == verifyStatus) {
633 638
                     taRecommendCustomer.setRealtyConsultant(null);
639
+                } else {
640
+                    if (null != realtyConsultant) {
641
+                        List<TaBuilding> taBuildings = taPersonBuildingMapper.getBuildingsOf(realtyConsultant);
642
+                        taRecommendCustomer.setRealtyConsultant(realtyConsultant);
643
+                        if (taBuildings != null && taBuildings.size() > 0) {
644
+                            TaBuilding taBuilding = taBuildings.get(0);
645
+                            taRecommendCustomer.setBuildingId(taBuilding.getBuildingId());
646
+                            taRecommendCustomer.setIntention(taBuilding.getBuildingName());
647
+                        }
648
+                    }
634 649
                 }
635 650
 
636 651
                 if (taRecommendCustomerService.updateById(taRecommendCustomer)){

+ 3
- 0
src/main/java/com/huiju/estateagents/mapper/TaPersonBuildingMapper.java Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 package com.huiju.estateagents.mapper;
2 2
 
3 3
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4
+import com.huiju.estateagents.entity.TaBuilding;
4 5
 import com.huiju.estateagents.entity.TaPersonBuilding;
5 6
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6 7
 import com.huiju.estateagents.entity.TaPointsExchange;
@@ -23,4 +24,6 @@ public interface TaPersonBuildingMapper extends BaseMapper<TaPersonBuilding> {
23 24
     List<TaPersonBuilding> selectListByParams(Page page, @Param("orgId")Integer orgId, @Param("buildingId") String buildingId, @Param("startCreateDate") String startCreateDate, @Param("endCreateDate") String endCreateDate, @Param("personBuildingList")List<TaPersonBuilding> taPersonBuildingList);
24 25
 
25 26
     List<SalesExport> selectSalesList(@Param("orgId") Integer orgId,@Param("buildingId") String buildingId, @Param("startCreateDate")  String startCreateDate,@Param("endCreateDate") String endCreateDate, @Param("personBuildingList") List<TaPersonBuilding> taPersonBuildingList);
27
+
28
+    List<TaBuilding> getBuildingsOf(@Param("personOrUser") String personOrUser);
26 29
 }

+ 11
- 0
src/main/resources/mapper/TaPersonBuildingMapper.xml Bestand weergeven

@@ -63,4 +63,15 @@
63 63
         t.user_id
64 64
     </select>
65 65
 
66
+    <select id="getBuildingsOf" resultType="com.huiju.estateagents.entity.TaBuilding">
67
+        SELECT
68
+            t.*
69
+        FROM
70
+        ta_person_building t
71
+        JOIN ta_building s ON s.building_id = t.building_id
72
+        WHERE
73
+            t.person_id = #{personOrUser}
74
+            OR t.user_id = #{personOrUser}
75
+    </select>
76
+
66 77
 </mapper>