|
@@ -8,6 +8,7 @@ import cn.hnthyy.thmz.entity.jy.InspectionDetail;
|
|
|
import cn.hnthyy.thmz.entity.jy.InspectionHeader;
|
|
|
import cn.hnthyy.thmz.entity.jy.InspectionsIndex;
|
|
|
import cn.hnthyy.thmz.enums.GenderEnum;
|
|
|
+import cn.hnthyy.thmz.enums.YesNoEnum;
|
|
|
import cn.hnthyy.thmz.service.his.jy.InspectionsService;
|
|
|
import cn.hnthyy.thmz.service.his.mz.MzZdCommonService;
|
|
|
import cn.hnthyy.thmz.service.his.zd.*;
|
|
@@ -54,7 +55,7 @@ public class JcJyController {
|
|
|
@Autowired
|
|
|
private MzZdCommonService mzZdCommonService;
|
|
|
@Autowired
|
|
|
- private JyZdTubeChargeService jyZdTubeChargeService;
|
|
|
+ private ZdChargeItemService zdChargeItemService;
|
|
|
|
|
|
/**
|
|
|
* 查询检查检验列表
|
|
@@ -448,11 +449,23 @@ public class JcJyController {
|
|
|
resultMap.put("message", "保存检查项目失败,项目分类码不能为空");
|
|
|
return resultMap;
|
|
|
}
|
|
|
-// if (jcZdItem.getName().length()>8) {
|
|
|
-// resultMap.put("code", -1);
|
|
|
-// resultMap.put("message", "保存检查项目失败,项目名称长度不能超过八位");
|
|
|
-// return resultMap;
|
|
|
-// }
|
|
|
+ if(YesNoEnum.NO.code.toString().equals(jcZdItem.getDelFlag())){
|
|
|
+ //启用项目
|
|
|
+ List<Map<String,Object>> data=jcJyItemChargeService.queryJcItemChargesByItemCode(jcZdItem.getCode());
|
|
|
+ if(data!=null && data.size()>0){
|
|
|
+ for(Map map:data){
|
|
|
+ String chargeCode= (String)map.get("charge_code");
|
|
|
+ if(StringUtils.isNotBlank(chargeCode)){
|
|
|
+ ZdChargeItem zdChargeItem= zdChargeItemService.queryZdChargeItemByCode(chargeCode);
|
|
|
+ if(zdChargeItem!=null && YesNoEnum.YES.code.equals(zdChargeItem.getDelFlag())){
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ resultMap.put("message", "启用检查项目失败,项目明细【"+zdChargeItem.getCode()+","+zdChargeItem.getName()+"】已经被停用");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
try {
|
|
|
int num = jcZdItemService.saveJcZdItem(jcZdItem);
|
|
|
if (num == 0) {
|
|
@@ -812,6 +825,23 @@ public class JcJyController {
|
|
|
resultMap.put("message", "保存检验项目失败,项目分类码不能为空");
|
|
|
return resultMap;
|
|
|
}
|
|
|
+ if(YesNoEnum.NO.code.toString().equals(jyZdItem.getDelFlag())){
|
|
|
+ //启用项目
|
|
|
+ List<Map<String,Object>> data=jcJyItemChargeService.queryJyItemChargesByItemCode(jyZdItem.getCode());
|
|
|
+ if(data!=null && data.size()>0){
|
|
|
+ for(Map map:data){
|
|
|
+ String chargeCode= (String)map.get("charge_code");
|
|
|
+ if(StringUtils.isNotBlank(chargeCode)){
|
|
|
+ ZdChargeItem zdChargeItem= zdChargeItemService.queryZdChargeItemByCode(chargeCode);
|
|
|
+ if(zdChargeItem!=null && YesNoEnum.YES.code.equals(zdChargeItem.getDelFlag())){
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ resultMap.put("message", "启用检验项目失败,项目明细【"+zdChargeItem.getCode()+","+zdChargeItem.getName()+"】已经被停用");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
try {
|
|
|
int num = jyZdItemService.saveJyZdItem(jyZdItem);
|
|
|
if (num == 0) {
|