|
@@ -55,6 +55,13 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
@Autowired
|
|
@Autowired
|
|
private LawenforcementUserMapper userMapper;
|
|
private LawenforcementUserMapper userMapper;
|
|
|
|
|
|
|
|
+ private final static String DAI_ZHI_FA = "lawenforcement_type_1";
|
|
|
|
+ private final static String ZHI_FA_WAN_CHENG = "lawenforcement_type_2";
|
|
|
|
+ private final static String ZHI_FA_ZHONG = "lawenforcement_type_6";
|
|
|
|
+ private final static String ZHI_FA_YI_CHANG = "lawenforcement_type_3";
|
|
|
|
+ private final static String ER_CI_ZHI_FA = "lawenforcement_type_4";
|
|
|
|
+ private final static String ER_CI_ZHI_FA_WAN_CHENG = "lawenforcement_type_5";
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 对接省平台数据
|
|
* 对接省平台数据
|
|
@@ -115,7 +122,7 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
record.setCreatorName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
record.setCreatorName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
|
record.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
|
|
record.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
|
|
record.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
|
|
record.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
|
|
- record.setRecordStatus("lawenforcement_type_1");
|
|
|
|
|
|
+ record.setRecordStatus(DAI_ZHI_FA);
|
|
record.setCreateTime(String.valueOf(System.currentTimeMillis()));
|
|
record.setCreateTime(String.valueOf(System.currentTimeMillis()));
|
|
record.setIsLast(0);
|
|
record.setIsLast(0);
|
|
return recordMapper.insertLawenforcementRecord(record);
|
|
return recordMapper.insertLawenforcementRecord(record);
|
|
@@ -160,14 +167,16 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public int addRecordLog(LawenforcementBindDeviceBO record) {
|
|
public int addRecordLog(LawenforcementBindDeviceBO record) {
|
|
|
|
+ //查询人员id
|
|
if (null == record.getUserId() || record.getUserId().isEmpty()) {
|
|
if (null == record.getUserId() || record.getUserId().isEmpty()) {
|
|
record.setUserId(SecurityUtils.getLoginUser().getSysUser().getUserId().toString());
|
|
record.setUserId(SecurityUtils.getLoginUser().getSysUser().getUserId().toString());
|
|
}
|
|
}
|
|
|
|
+ //查询执法编号
|
|
Map<String, Object> userCodeByUserId = userMapper.getUserCodeByUserId(record.getUserId());
|
|
Map<String, Object> userCodeByUserId = userMapper.getUserCodeByUserId(record.getUserId());
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
|
|
|
|
//检查当前绑定设备的执法人是否为主办人
|
|
//检查当前绑定设备的执法人是否为主办人
|
|
- Map<String, Object> isMainPerson = recordMapper.getIsMainPerson(record);
|
|
|
|
|
|
+// Map<String, Object> isMainPerson = recordMapper.getIsMainPerson(record);
|
|
//将设备与人员绑定
|
|
//将设备与人员绑定
|
|
int i = recordMapper.bindDeviceToPerson(record);
|
|
int i = recordMapper.bindDeviceToPerson(record);
|
|
|
|
|
|
@@ -254,10 +263,10 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
|
|
|
|
//检查当前绑定设备的执法人是否为主办人
|
|
//检查当前绑定设备的执法人是否为主办人
|
|
- Map<String, Object> isMainPerson = recordMapper.getIsMainPerson(record);
|
|
|
|
|
|
+// Map<String, Object> isMainPerson = recordMapper.getIsMainPerson(record);
|
|
// if ("1".equals(MapUtils.getString(isMainPerson, "mainPerson"))) {
|
|
// if ("1".equals(MapUtils.getString(isMainPerson, "mainPerson"))) {
|
|
- //设置任务完成状态
|
|
|
|
- recordMapper.updateRecordStatus(record);
|
|
|
|
|
|
+ //设置任务完成状态
|
|
|
|
+ recordMapper.updateRecordStatus(record);
|
|
// }
|
|
// }
|
|
|
|
|
|
//设置任务结束时间
|
|
//设置任务结束时间
|
|
@@ -278,7 +287,31 @@ public class LawenforcementRecordServiceImpl extends BaseServiceImpl implements
|
|
}
|
|
}
|
|
Map<String, Object> userCodeByUserId = userMapper.getUserCodeByUserId(record.getCreatorId());
|
|
Map<String, Object> userCodeByUserId = userMapper.getUserCodeByUserId(record.getCreatorId());
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
record.setPersonCode(MapUtils.getString(userCodeByUserId, "personCode"));
|
|
|
|
+ //查询任务集合
|
|
List<LawenforcementRecord> recordList = recordMapper.getRecordList(record);
|
|
List<LawenforcementRecord> recordList = recordMapper.getRecordList(record);
|
|
|
|
+ //处理工单状态
|
|
|
|
+ recordList.forEach(data->{
|
|
|
|
+ if(StringUtils.isNotEmpty(record.getRecordStatus())){
|
|
|
|
+ //查询带执法
|
|
|
|
+ if(DAI_ZHI_FA.equals(record.getRecordStatus())){
|
|
|
|
+ //查询结果中可能存在已经进行中的任务;需要修改为带执法状态
|
|
|
|
+ if(ZHI_FA_ZHONG.equals(data.getRecordStatus())){
|
|
|
|
+ data.setRecordStatus(DAI_ZHI_FA);
|
|
|
|
+ }else if(ER_CI_ZHI_FA.equals(data.getRecordStatus())){
|
|
|
|
+ data.setRecordStatus(ZHI_FA_YI_CHANG);
|
|
|
|
+ }
|
|
|
|
+ //查询执法进行中
|
|
|
|
+ }else if(ZHI_FA_ZHONG.equals(record.getRecordStatus())){
|
|
|
|
+ if(ZHI_FA_WAN_CHENG.equals(data.getRecordStatus())){
|
|
|
|
+ data.setRecordStatus(ZHI_FA_ZHONG);
|
|
|
|
+ }else if(ER_CI_ZHI_FA_WAN_CHENG.equals(data.getRecordStatus())){
|
|
|
|
+ data.setRecordStatus(ER_CI_ZHI_FA);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //查询执法完成 不需要处理
|
|
|
|
+ }
|
|
|
|
+ });
|
|
return recordList;
|
|
return recordList;
|
|
}
|
|
}
|
|
|
|
|