From 13a34d2197b001799ef8f0f09e5b48af2add0926 Mon Sep 17 00:00:00 2001 From: lsh <lsh@163.com> Date: 星期一, 15 四月 2024 09:25:31 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/cstmr/cstmr2.js | 5 +++-- src/main/java/com/zy/crm/manager/controller/CstmrController.java | 18 ++++++++++-------- src/main/webapp/static/js/cstmr/cstmr.js | 6 +++--- src/main/java/com/zy/crm/manager/mapper/CstmrGradeMapper.java | 2 ++ src/main/resources/mapper/CstmrGradeMapper.xml | 9 +++++++++ src/main/resources/mapper/CstmrMapper.xml | 2 +- src/main/java/com/zy/crm/manager/service/CstmrGradeService.java | 1 + src/main/java/com/zy/crm/manager/service/impl/CstmrGradeServiceImpl.java | 5 ++++- 8 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zy/crm/manager/controller/CstmrController.java b/src/main/java/com/zy/crm/manager/controller/CstmrController.java index 6112615..bbe0dd8 100644 --- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java +++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java @@ -13,14 +13,8 @@ import com.core.exception.CoolException; import com.zy.crm.common.web.BaseController; import com.zy.crm.manager.controller.result.FollowerTableVo; -import com.zy.crm.manager.entity.Cstmr; -import com.zy.crm.manager.entity.CstmrFoll; -import com.zy.crm.manager.entity.CstmrType; -import com.zy.crm.manager.entity.Order; -import com.zy.crm.manager.service.CstmrFollService; -import com.zy.crm.manager.service.CstmrService; -import com.zy.crm.manager.service.CstmrTypeService; -import com.zy.crm.manager.service.OrderService; +import com.zy.crm.manager.entity.*; +import com.zy.crm.manager.service.*; import com.zy.crm.manager.utils.CompanySearchUtils; import com.zy.crm.system.entity.Dept; import com.zy.crm.system.entity.Dic; @@ -55,6 +49,8 @@ private CstmrService cstmrService; @Autowired private CstmrTypeService cstmrTypeService; + @Autowired + private CstmrGradeService cstmrGradeService; @Autowired private DicService dicService; @Autowired @@ -411,6 +407,12 @@ throw new CoolException("绗�" + i + "琛屽鎴风被鍒笉鍚堟硶锛岃閲嶆柊瀵煎叆"); } cstmr.setCstmrType(cstmrType.getId()); + + CstmrGrade cstmrGrade = cstmrGradeService.selectByName(hostId, type); + if (null == cstmrGrade) { + throw new CoolException("绗�" + i + "琛屽鎴风瓑绾т笉鍚堟硶锛岃閲嶆柊瀵煎叆"); + } + cstmr.setCstmrGrade(cstmrGrade.getId()); // 瀹㈡埛鍏崇郴 cstmr.setRela(dataFormatter.formatCellValue(row.getCell(3))); // 鐢佃瘽 diff --git a/src/main/java/com/zy/crm/manager/mapper/CstmrGradeMapper.java b/src/main/java/com/zy/crm/manager/mapper/CstmrGradeMapper.java index 685ab0d..c5c3f3f 100644 --- a/src/main/java/com/zy/crm/manager/mapper/CstmrGradeMapper.java +++ b/src/main/java/com/zy/crm/manager/mapper/CstmrGradeMapper.java @@ -3,10 +3,12 @@ import com.zy.crm.manager.entity.CstmrGrade; import com.baomidou.mybatisplus.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @Mapper @Repository public interface CstmrGradeMapper extends BaseMapper<CstmrGrade> { + CstmrGrade selectByName(@Param("hostId") Long hostId, @Param("name") String name); } diff --git a/src/main/java/com/zy/crm/manager/service/CstmrGradeService.java b/src/main/java/com/zy/crm/manager/service/CstmrGradeService.java index 22cba2c..4d8ea97 100644 --- a/src/main/java/com/zy/crm/manager/service/CstmrGradeService.java +++ b/src/main/java/com/zy/crm/manager/service/CstmrGradeService.java @@ -4,5 +4,6 @@ import com.baomidou.mybatisplus.service.IService; public interface CstmrGradeService extends IService<CstmrGrade> { + CstmrGrade selectByName(Long hostId, String name); } diff --git a/src/main/java/com/zy/crm/manager/service/impl/CstmrGradeServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/CstmrGradeServiceImpl.java index abd08f7..d3d08b5 100644 --- a/src/main/java/com/zy/crm/manager/service/impl/CstmrGradeServiceImpl.java +++ b/src/main/java/com/zy/crm/manager/service/impl/CstmrGradeServiceImpl.java @@ -8,5 +8,8 @@ @Service("cstmrGradeService") public class CstmrGradeServiceImpl extends ServiceImpl<CstmrGradeMapper, CstmrGrade> implements CstmrGradeService { - + @Override + public CstmrGrade selectByName(Long hostId, String name) { + return this.baseMapper.selectByName(hostId, name); + } } diff --git a/src/main/resources/mapper/CstmrGradeMapper.xml b/src/main/resources/mapper/CstmrGradeMapper.xml index e111a71..d81c561 100644 --- a/src/main/resources/mapper/CstmrGradeMapper.xml +++ b/src/main/resources/mapper/CstmrGradeMapper.xml @@ -18,4 +18,13 @@ </resultMap> + <select id="selectByName" resultMap="BaseResultMap"> + select top 1 * + from man_cstmr_grade + where 1=1 + and name = #{name} + <if test="hostId != null"> + and host_id = #{hostId} + </if> + </select> </mapper> diff --git a/src/main/resources/mapper/CstmrMapper.xml b/src/main/resources/mapper/CstmrMapper.xml index 5aad26b..7782023 100644 --- a/src/main/resources/mapper/CstmrMapper.xml +++ b/src/main/resources/mapper/CstmrMapper.xml @@ -9,6 +9,7 @@ <result column="dept_id" property="deptId" /> <result column="user_id" property="userId" /> <result column="cstmr_type" property="cstmrType" /> + <result column="cstmr_grade" property="cstmrGrade" /> <result column="uuid" property="uuid" /> <result column="name" property="name" /> <result column="simple" property="simple" /> @@ -35,7 +36,6 @@ <result column="credit_code" property="creditCode" /> <result column="issue_time" property="issueTime" /> <result column="company_type" property="companyType" /> - <result column="company_grade" property="companyGrade" /> <result column="company_person" property="companyPerson" /> <result column="company_status" property="companyStatus" /> <result column="reg_money" property="regMoney" /> diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js index 0dd9533..9ffea77 100644 --- a/src/main/webapp/static/js/cstmr/cstmr.js +++ b/src/main/webapp/static/js/cstmr/cstmr.js @@ -149,7 +149,7 @@ ,{field: 'weeklyDailyReality', align: 'center',title: '琛岀▼',hide : false, toolbar: '#tbLookReality'} ,{field: 'remarks', align: 'left',title: '澶囨敞', hide: false, templet:function(d){return emptyShow(d.remarks)}} ,{field: 'cstmrType$', align: 'left',title: '瀹㈡埛绫诲埆', hide: false} - ,{field: 'cstmrGrade$', align: 'left',title: '瀹㈡埛绫诲埆', hide: false} + ,{field: 'cstmrGrade$', align: 'left',title: '瀹㈡埛绛夌骇', hide: false} ,{field: 'industry', align: 'left',title: '瀹㈡埛琛屼笟', hide: false} ,{field: 'productCategory', align: 'left',title: '浜у搧绫诲瀷', hide: false} ,{field: 'userId$', align: 'left',title: '娣诲姞浜哄憳', hide: true} @@ -286,8 +286,8 @@ {type: 'numbers'} // ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} ,{field: 'dailyTime$',width : 120, align: 'center',title: '鏃ユ湡'} - ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} - ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} + ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭鍙婄洰鐨�', edit:false} + // ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} ,{field: 'comment', title: '璇勮', edit:false} ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:false} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} diff --git a/src/main/webapp/static/js/cstmr/cstmr2.js b/src/main/webapp/static/js/cstmr/cstmr2.js index 63f2fa3..2cc7b52 100644 --- a/src/main/webapp/static/js/cstmr/cstmr2.js +++ b/src/main/webapp/static/js/cstmr/cstmr2.js @@ -149,6 +149,7 @@ ,{field: 'weeklyDailyReality', align: 'center',title: '琛岀▼',hide : false, toolbar: '#tbLookReality'} ,{field: 'remarks', align: 'left',title: '澶囨敞', hide: false, templet:function(d){return emptyShow(d.remarks)}} ,{field: 'cstmrType$', align: 'left',title: '瀹㈡埛绫诲埆', hide: false} + ,{field: 'cstmrGrade$', align: 'left',title: '瀹㈡埛绛夌骇', hide: false} ,{field: 'industry', align: 'left',title: '瀹㈡埛琛屼笟', hide: false} ,{field: 'productCategory', align: 'left',title: '浜у搧绫诲瀷', hide: false} ,{field: 'userId$', align: 'left',title: '娣诲姞浜哄憳', hide: true} @@ -298,8 +299,8 @@ {type: 'numbers'} // ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} ,{field: 'dailyTime$',width : 120, align: 'center',title: '鏃ユ湡'} - ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} - ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} + ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭鍙婄洰鐨�', edit:false} + // ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} ,{field: 'comment', title: '璇勮', edit:false} ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:false} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} -- Gitblit v1.9.1