|
@@ -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();*/
|
|
|
}
|
|
|
}
|
|
|
|