| | |
| | | private WorkflowLinkService linkService; |
| | | |
| | | //该设备放电申请 |
| | | public Response searchTemp(int devId) { |
| | | Fbs9100SetParamTemp temp = mapper.searchTemp(devId); |
| | | public Response searchTemp(int battGroupId) { |
| | | Fbs9100SetParamTemp temp = mapper.searchTemp(battGroupId); |
| | | return new Response().setII(1, temp == null ? false : true, temp, "设备放电申请"); |
| | | } |
| | | |
| | |
| | | main.setStatus(mainStatus); |
| | | main.setType(mainType); |
| | | main.setId(id); |
| | | mainService.add(main); |
| | | mainService.addWorkMain(main); |
| | | //link添加 |
| | | WorkflowLink link = new WorkflowLink(); |
| | | link.setMainId(id); |
| | |
| | | //判断是否存在该设备id的记录 |
| | | QueryWrapper wrapper = Wrappers.query(); |
| | | wrapper.eq("dev_id", tmp.getDevId()); |
| | | wrapper.eq("battGroupId", tmp.getBattGroupId()); |
| | | wrapper.last("limit 1"); |
| | | Fbs9100SetParamTemp paramTemp = mapper.selectOne(wrapper); |
| | | if (paramTemp != null) { |
| | | UpdateWrapper uWrapper = Wrappers.update(); |
| | | uWrapper.eq("dev_id", tmp.getDevId()); |
| | | uWrapper.eq("battGroupId", tmp.getBattGroupId()); |
| | | mapper.delete(uWrapper); |
| | | } |
| | | mapper.insert(tmp); |