소스 검색

fix 修改身份证号码重复问题

Administrator 3 년 전
부모
커밋
1618207745

+ 49 - 11
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -7,6 +7,7 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.domain.SysDept;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.system.api.RemoteDeptService;
+import com.boman.system.api.RemoteDictDataService;
 import com.boman.web.core.domain.VaccineInfoOperation;
 import com.boman.web.core.domain.VaccineInfoUser;
 import com.boman.web.core.mapper.VaccineInfoMapper;
@@ -45,6 +46,8 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     @Resource
     private VaccineInfoUserMapper vaccineInfoUserMapper;
     @Resource
+    private RemoteDictDataService remoteDictDataService;
+    @Resource
     private RemoteDeptService remoteDeptService;
 
     /**
@@ -56,10 +59,25 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     @Override
     public VaccineInfoOperation selectVaccineInfoById(Long id) {
         VaccineInfoOperation vaccineInfoOperation = vaccineInfoMapper.selectVaccineInfoById(id);
-        String vaccineName = vaccineInfoOperation.getVaccineName();
-        if (StringUtils.isNotBlank(vaccineName)) {
-            String dictValue = vaccineInfoMapper.selectSysDictDataByDictLabel(vaccineName);
-            vaccineInfoOperation.setDictValue(dictValue);
+        if (vaccineInfoOperation != null) {
+            String vaccineName = vaccineInfoOperation.getVaccineName();
+            if (StringUtils.isNotBlank(vaccineName)) {
+                String dictValue = vaccineInfoMapper.selectSysDictDataByDictLabel(vaccineName);
+                vaccineInfoOperation.setDictValue(dictValue);
+            }
+/*            //重点行业
+            String keyIndustries = vaccineInfoOperation.getKeyIndustries();
+            //进行字典转换
+            if (StringUtils.isNotBlank(keyIndustries)) {
+                String keyTrades = changeDictData("key_trades", keyIndustries);
+                vaccineInfoOperation.setKeyIndustries(keyTrades);
+            }
+            String other = vaccineInfoOperation.getOther();
+            //进行字典转换
+            if (StringUtils.isNotBlank(other)) {
+                String otherStatus = changeDictData("other_status", other);
+                vaccineInfoOperation.setKeyIndustries(otherStatus);
+            }*/
         }
         return vaccineInfoOperation;
     }
@@ -108,7 +126,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
 
         //如果查询条件查询疫苗表且没数据,就不要查询主表
         List<VaccineInfoOperation> vaccineInfoOperations = new ArrayList<>();
-        if (flag){
+        if (flag) {
             setAddrCondition(vaccineInfoOperation);
             vaccineInfoOperations = vaccineInfoMapper.selectVaccineInfoList(vaccineInfoOperation);
         }
@@ -131,13 +149,13 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 //户籍地
                 String domicile = infoOperation.getDomicile();
                 StringBuilder sbDomicile = new StringBuilder();
-                if (StringUtils.isNotBlank(province)){
+                if (StringUtils.isNotBlank(province)) {
                     sbDomicile.append(province);
                 }
-                if (StringUtils.isNotBlank(city)){
+                if (StringUtils.isNotBlank(city)) {
                     sbDomicile.append(city);
                 }
-                if (StringUtils.isNotBlank(region)){
+                if (StringUtils.isNotBlank(region)) {
                     sbDomicile.append(region);
                 }
                 if (StringUtils.isNotBlank(domicile)) {
@@ -163,12 +181,29 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                         infoOperation.setVaccinationTimeNext(date);
                     }
                 }
+/*                //重点行业
+                String keyIndustries = infoOperation.getKeyIndustries();
+                //进行字典转换
+                if (StringUtils.isNotBlank(keyIndustries)) {
+                    String keyTrades = changeDictData("key_trades", keyIndustries);
+                    infoOperation.setKeyIndustries(keyTrades);
+                }
+                String other = infoOperation.getOther();
+                //进行字典转换
+                if (StringUtils.isNotBlank(other)) {
+                    String otherStatus = changeDictData("other_status", other);
+                    infoOperation.setKeyIndustries(otherStatus);
+                }*/
             }
         }
-
         return vaccineInfoOperations;
     }
 
+    //转换字典值
+    private String changeDictData(String dictType, String dictValue) {
+        return remoteDictDataService.selectDictLabel(dictType, dictValue);
+    }
+
     private void setAddrCondition(VaccineInfoOperation vaccineInfoOperation) {
         // 当前登陆人所在部门,有可能是县,有可能是镇,有可能是村
         Long deptId = AuthUtils.getLoginUser().getSysUser().getDeptId();
@@ -281,7 +316,10 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             vaccineInfoOperationMapper.insertVaccineInfoOperation(vaccineInfoOperationNew);
             return rows > 0 ? AjaxResult.success() : AjaxResult.error();
         } else {
-            //查询出来的用户疫苗信息
+            return AjaxResult.error("该用户信息已存在,请勿重复添加");
+/*
+// 暂时不用,勿删
+                //查询出来的用户疫苗信息
             List<VaccineInfoUser> vaccineInfoUserListOld = vaccineInfoOperationOld.getVaccineInfoUserList();
             String jiCiOld = vaccineInfoOperationOld.getJici();
             String vaccineNameOld = vaccineInfoOperationOld.getVaccineName();
@@ -347,7 +385,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             //判断应续未续
             VaccineInfoOperation vaccineInfoOperationNew = shouldSlow(vaccineInfoOperation1);
             int rows = vaccineInfoMapper.updateVaccineInfo(vaccineInfoOperationNew);
-            return rows > 0 ? AjaxResult.success() : AjaxResult.error();
+            return rows > 0 ? AjaxResult.success() : AjaxResult.error();*/
         }
     }
 

+ 1 - 2
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -82,7 +82,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="villageTowns != null  and villageTowns != ''">
                 and (vi.village_towns = #{villageTowns} or vi.city = #{villageTowns} or vi.region = #{villageTowns})
             </if>
-
             <if test="village != null  and village != ''"> and vi.village = #{village}</if>
             <if test="villagerGroup != null  and villagerGroup != ''"> and vi.villager_group = #{villagerGroup}</if>
             <if test="houseType != null  and houseType != ''"> and vi.house_type = #{houseType}</if>
@@ -120,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </foreach>
             </if>
         </where>
-        order by vi.vaccination_time DESC
+        order by vi.create_time DESC ,vi.vaccination_time DESC
     </select>
 
     <select id="selectVaccineInfoListByPage" parameterType="Integer" resultMap="VaccineInfoResult">