Sfoglia il codice sorgente

修改设备验证

wangchao 4 anni fa
parent
commit
97dca84162

+ 0 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/DeviceManageController.java

@ -32,7 +32,6 @@ public class DeviceManageController {
32 32
	@RequestMapping("/queryDeviceInfo")
33 33
	public JMap queryDeviceInfo(JMap params) throws Exception {
34 34
		Map<String,String> params1 = (Map<String, String>) params.get("params"); // 参数
35
36 35
		PageInfo deviceList = deviceManageService.queryDeviceInfo(params);
37 36
		JMap result = new JsonMap();
38 37
		result.put("result", deviceList);

+ 1 - 2
ebc-sea-platform/src/main/java/com/ai/ipu/server/controller/EquipmentManageController.java

@ -50,12 +50,11 @@ public class EquipmentManageController {
50 50
    public JMap verifyEquipmentInfoRepetition(JMap params) throws Exception {
51 51
        Map<String, Object> equipmentMap= equipmentManageService.verifyEquipmentInfoRepetition(params);
52 52
        JMap result = new JsonMap();
53
        if(equipmentMap.isEmpty()){
53
        if(equipmentMap==null||equipmentMap.isEmpty()){
54 54
            result.put("result", false);
55 55
        }else{
56 56
            result.put("result", true);
57 57
        }
58
59 58
        return result;
60 59
    }
61 60

+ 22 - 1
ebc-sea-platform/src/main/java/com/ai/ipu/server/dao/impl/EquipmentManageDaoImpl.java

@ -72,6 +72,27 @@ public class EquipmentManageDaoImpl implements EquipmentManageDao {
72 72
    @Override
73 73
    public Map<String, Object> verifyEquipmentInfoRepetition(JMap params) throws Exception {
74 74
        CommonTableDao dao = IpuDaoManager.takeDao(CommonTableDao.class, connName);
75
        return dao.select(equipmentTableName, params);
75
        List<Map<String, Object>> verifyList=new ArrayList<>();
76
        //验证修改重复
77
        if(params.get("FACILITY_ID")!=null&&params.get("FACILITY_ID")!=""){
78
            int facilityId = (int)params.get("FACILITY_ID");
79
            params.remove("FACILITY_ID");
80
            verifyList= dao.selectByCond(equipmentTableName, params);
81
            if(!verifyList.isEmpty()){
82
                long facility_id = (long)verifyList.get(0).get("FACILITY_ID");
83
                if((int)facility_id==facilityId){
84
                    return null;
85
                }else {
86
                    return verifyList.get(0);
87
                }
88
            }
89
        }else {
90
            verifyList= dao.selectByCond(equipmentTableName, params);
91
        }
92
        if(verifyList.isEmpty()){
93
            return null;
94
        }else {
95
            return verifyList.get(0);
96
        }
76 97
    }
77 98
}