wjj пре 13 часа
родитељ
комит
038bebb77b

+ 8 - 0
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -367,4 +367,12 @@ public class FsCompanyCustomerController extends BaseController {
         }
         return AjaxResult.success(addressInfoDTO);
     }
+
+    /**
+     * 完善客户信息
+     * */
+    @PostMapping("/improve")
+    public AjaxResult improve(@RequestBody FsCompanyCustomer fsCompanyCustomer){
+        return toAjax(fsCompanyCustomerService.improve(fsCompanyCustomer));
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/qw/service/IFsCompanyCustomerService.java

@@ -42,4 +42,6 @@ public interface IFsCompanyCustomerService {
 
     //增加客户购买次数
     int addBuyTimes(Long id);
+
+    int improve(FsCompanyCustomer fsCompanyCustomer);
 }

+ 21 - 0
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

@@ -257,4 +257,25 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
         }
         return 0;
     }
+
+    @Override
+    public int improve(FsCompanyCustomer fsCompanyCustomer) {
+        if (fsCompanyCustomer.getTemplateId() == null) {
+            throw new CustomException("请选择模板");
+        }
+        if (fsCompanyCustomer.getJsonInfo() == null) {
+            throw new CustomException("请填写信息");
+        }
+        FsCompanyCustomer customer = fsCompanyCustomerMapper.selectFsCompanyCustomerById(fsCompanyCustomer.getId());
+        if (customer == null) {
+            throw new CustomException("客户信息不存在");
+        }
+        if (customer.getProcessStatus()  != 0) {
+            throw new CustomException("客户正在处理中,请勿重复操作");
+        }
+        customer.setProcessStatus(1);
+        customer.setTemplateId(fsCompanyCustomer.getTemplateId());
+        customer.setJsonInfo(fsCompanyCustomer.getJsonInfo());
+        return fsCompanyCustomerMapper.updateFsCompanyCustomer(customer);
+    }
 }

+ 12 - 1
fs-service/src/main/resources/mapper/qw/FsCompanyCustomerMapper.xml

@@ -37,6 +37,8 @@
         <result property="kdzlCallStatus"      column="kdzl_call_status"      />
         <result property="processStatus"       column="process_status"       />
         <result property="prescribeId"         column="prescribe_id"         />
+        <result property="templateId"         column="template_id"         />
+        <result property="jsonInfo"          column="json_info"          />
     </resultMap>
 
     <sql id="selectFsCompanyCustomerVo">
@@ -47,7 +49,7 @@
                buy_count, claim_status,
                complete_status, dept_id, dept_name,
                kdzl_add_wechat_status, kdzl_make_status, kdzl_call_status,
-               process_status, prescribe_id
+               process_status, prescribe_id, template_id, json_info
         from fs_company_customer
     </sql>
 
@@ -105,6 +107,9 @@
         <if test="kdzlCallStatus != null and kdzlCallStatus != ''">
             and kdzl_call_status like concat('%', #{kdzlCallStatus}, '%')
         </if>
+        <if test="processStatus != null">
+            and process_status = #{processStatus}
+        </if>
         <!-- 动态排序 -->
         <choose>
             <when test="sortField != null and sortField != '' and sortOrder != null and sortOrder != ''">
@@ -227,6 +232,8 @@
             <if test="kdzlCallStatus != null">kdzl_call_status,</if>
             <if test="processStatus != null">process_status,</if>
             <if test="prescribeId != null">prescribe_id,</if>
+            <if test="templateId != null">template_id,</if>
+            <if test="jsonInfo != null">json_info,</if>
             create_time
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -258,6 +265,8 @@
             <if test="kdzlCallStatus != null">#{kdzlCallStatus},</if>
             <if test="processStatus != null">#{processStatus},</if>
             <if test="prescribeId != null">#{prescribeId},</if>
+            <if test="templateId != null">#{templateId},</if>
+            <if test="jsonInfo != null">#{jsonInfo},</if>
             sysdate()
         </trim>
     </insert>
@@ -309,6 +318,8 @@
             <if test="kdzlCallStatus != null">kdzl_call_status = #{kdzlCallStatus},</if>
             <if test="processStatus != null">process_status = #{processStatus},</if>
             <if test="prescribeId != null">prescribe_id = #{prescribeId},</if>
+            <if test="templateId != null">template_id = #{templateId},</if>
+            <if test="jsonInfo != null">json_info = #{jsonInfo},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             update_time = sysdate()
         </set>