diff --git a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementInspectionProgramController.java b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementInspectionProgramController.java index ce689218..64283bc0 100644 --- a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementInspectionProgramController.java +++ b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementInspectionProgramController.java @@ -1,5 +1,7 @@ package com.zdxt.app.controller; +import com.zdxt.auth.dto.UserBean; +import com.zdxt.auth.feign.UserApi; import com.zdxt.code.domain.EnforcementInspectionProgram; import com.zdxt.code.service.IEnforcementInspectionProgramService; import com.zdxt.common.ZDResponse; @@ -28,6 +30,9 @@ public class AppEnforcementInspectionProgramController extends BaseController @Autowired private IEnforcementInspectionProgramService enforcementInspectionProgramService; + @Autowired + private UserApi userApi; + @RequiresPermissions("code:enforcementInspectionProgram:view") @GetMapping() public String enforcementInspectionProgram() @@ -69,8 +74,11 @@ public class AppEnforcementInspectionProgramController extends BaseController @ResponseBody public TableDataInfo queryListNoPermission(EnforcementInspectionProgram enforcementInspectionProgram) { - List list = - enforcementInspectionProgramService.selectEnforcementInspectionProgramListNoPermission(enforcementInspectionProgram); + UserBean userBean = userApi.getUserByUserId(enforcementInspectionProgram.getUserId()); + enforcementInspectionProgram.setDeptId(userBean.getDeptId()); + startPage(); +// List list = enforcementInspectionProgramService.selectEnforcementInspectionProgramListNoPermission(enforcementInspectionProgram); + List list = enforcementInspectionProgramService.selectPlanList(enforcementInspectionProgram); return getDataTable(list); } diff --git a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java index 9ffe6a01..5c550b5d 100644 --- a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java +++ b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java @@ -386,11 +386,11 @@ public class AppEnforcementRegistrationController extends BaseController * @param enterpriseNumber * @return */ - @GetMapping("/queryUnionByHour/{enterpriseNumber}/{checkCss}") + @GetMapping("/queryUnionByHour/{enterpriseNumber}/{checkCss}/{enforcementTime}/{unionNo}") @ResponseBody - public ZDResponse queryUnionByHour(@PathVariable String enterpriseNumber, @PathVariable String checkCss) + public ZDResponse queryUnionByHour(@PathVariable String enterpriseNumber, @PathVariable String checkCss, @PathVariable String enforcementTime, @PathVariable String unionNo) { - return ZDResponse.success("操作成功", enforcementRegistrationService.queryUnionByHour(enterpriseNumber, checkCss)); + return ZDResponse.success("操作成功", enforcementRegistrationService.queryUnionByHour(enterpriseNumber, checkCss, enforcementTime, unionNo)); } /** diff --git a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java index 6d45aa80..8ceeeeee 100644 --- a/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java +++ b/lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java @@ -135,9 +135,7 @@ public class AppThirdLoginController { @ResponseBody public ZDResponse szyptLogin(@PathVariable String code){ - System.out.println("====================== code ======================"); - log.info("深政易用户登录code:{}",code); - System.out.println("====================== code ======================"); + log.info("--> 深政易用户登录code:{}",code); String accessTokenJson = ""; String userJson = ""; @@ -257,7 +255,7 @@ public class AppThirdLoginController { String redisLock = ""; try { Map params = new HashMap<>(); - log.info("获取深i企登录用户code:{}",siqLogin.getCode()); + log.info("---> 深i企登录用户 code:{}",siqLogin.getCode()); String secret = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, siqLogin.getCode()); params.put("accessKeySign",secret); log.info("accessKeySign{}",secret); @@ -267,20 +265,13 @@ public class AppThirdLoginController { data = HttpUtil.httpSendPost(siqUrl + "/pub/auth/getUserInfo", JSONObject.toJSONString(params),new HashMap<>()); } catch (Exception e) { e.printStackTrace(); - log.error("获取深i企用户信息失败,返回结果:{}",data); + log.error("---> 获取深i企用户信息失败,返回结果:{}",data); } - log.info("================= data ================="); - log.info(data); - log.info("================= data ================="); - + log.info("---> data: {}", data); JSONObject jsonObject = JSONObject.parseObject(data); JSONObject userInfo = (JSONObject) jsonObject.get("data"); - - log.info("================= userInfo ================="); - log.info(jsonObject.getString("data")); - log.info(userInfo.toJSONString()); - log.info("================= userInfo ================="); + log.info("---> userInfo: {}", userInfo.toJSONString()); String account = userInfo.getString("account"); if(StringUtils.isNotEmpty(account)){ @@ -294,14 +285,13 @@ public class AppThirdLoginController { //1.加锁限制用户登录并发情况 if(!jedisUtil.exists(redisLock)){ jedisUtil.isLock(redisLock,1000); - log.info("redis用户登录加锁,加锁用户:{}",userInfo.toJSONString()); + log.info("---> 登入锁 key: {}", redisLock); + log.info("---> redis 加锁用户:{}",userInfo.toJSONString()); //添加深i企用户 Long userId = thirdLoginService.addSiqUser(userInfo); userInfo.put("userId", userId); - log.info("================= siqLogin addSiqUser -> userId ================="); - log.info(userId.toString()); - log.info("================= siqLogin addSiqUser -> userId ================="); + log.info("---> 新增深i企用户 id: {}", userId.toString()); //添加深i企用户关联企业信息 thirdLoginService.addSiqUserCompany(userInfo); return thirdLoginService.siqLogin(userInfo); diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml index 6f2db4e2..189f5da8 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml @@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND notice_title like concat('%', #{noticeTitle}, '%') - AND object_type = #{objectType} + AND (object_type = #{objectType} or object_type = '0') AND bureau_dept_names like concat('%', #{bureauDeptNames}, '%') diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html index 41e9808e..cdc3ea42 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html @@ -30,7 +30,7 @@
  • -

    执法部门:

    +

    执法单位/受委托组织:

  • @@ -335,7 +335,7 @@ columns: [ { field : 'enterpriseName', - title : '被检查企业名称1', + title : '被检查企业名称', formatter:function (value) { return "
    "+ value +"
    "; } @@ -350,7 +350,7 @@ }, { field : 'bureauDeptName', - title : '执法部门', + title : '执法单位/受委托组织', formatter:function (value,row,index) { if(row.uniteType==1){ return "
    "+ value +"(牵头单位)
    "; @@ -491,7 +491,7 @@ }, { field : 'bureauDeptName', - title : '执法部门', + title : '执法单位/受委托组织', formatter:function (value,row,index) { if(row.uniteType==1){ return "
    "+ value +"(牵头单位)
    "; diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html index cab224e9..9da2305a 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html @@ -531,14 +531,20 @@ html += '
'; html += '
'; html += ' '; - html += ' '; - html += ' '; + if (parseFloat(indicator.yoy) >= 0) { + html += ' ' + } else { + html += ' ' + } html += ' '+indicator.yoy+'%'; html += '
' html += '
'; html += ' '; - html += ' '; - html += ' '; + if (parseFloat(indicator.ring_ratio) >= 0) { + html += ' ' + } else { + html += ' ' + } html += ' '+indicator.ring_ratio+'%'; html += '
'; html += ''; diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html index d01ce016..880261d9 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html @@ -414,14 +414,20 @@ html += ' '; html += '
'; html += ' '; - html += ' '; - html += ' '; + if (parseFloat(indicator.yoy) >= 0) { + html += ' ' + } else { + html += ' ' + } html += ' '+indicator.yoy+'%'; html += '
' html += '
'; html += ' '; - html += ' '; - html += ' '; + if (parseFloat(indicator.ring_ratio) >= 0) { + html += ' ' + } else { + html += ' ' + } html += ' '+indicator.ring_ratio+'%'; html += '
'; html += ''; diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html index ad3f68ac..c483e909 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html @@ -25,7 +25,7 @@
-
@@ -150,6 +150,7 @@ var data = {}; for (var i=0; i
-
@@ -161,6 +161,7 @@ previewFileIcon: '', preferIconicPreview: true, uploadExtraData: function () { + var sHTML = $('.summernote').summernote('code'); $("#noticeContent").val(sHTML); var formData = $("#form-notice-edit").serialize(); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java index 7a2db8c1..40ae416f 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java @@ -101,4 +101,12 @@ public interface EnforcementInspectionProgramMapper * @return */ List staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto); + + /** + * 查询执法检查计划列表 + * + * @param enforcementInspectionProgram 执法检查计划 + * @return 执法检查计划集合 + */ + List selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java index b9fab5b9..377cb3e3 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java @@ -30,6 +30,7 @@ public interface IEnforcementInspectionProgramService */ List selectEnforcementInspectionProgramList(EnforcementInspectionProgram enforcementInspectionProgram); List selectEnforcementInspectionProgramListNoPermission(EnforcementInspectionProgram enforcementInspectionProgram); + List selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram); List queryNoticeList(EnforcementInspectionProgram enforcementInspectionProgram); /** diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java index 8ef148ff..c7e2b76f 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java @@ -120,5 +120,5 @@ public interface IEnforcementRegistrationService List untieCheck1MakeAndDetail(List enforcementRegistrationList); - List> queryUnionByHour(String enterpriseNumber, String checkCss); + List> queryUnionByHour(String enterpriseNumber, String checkCss, String enforcementTime, String unionNo); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java index 1568ff86..6c289e91 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java @@ -240,4 +240,20 @@ public class EnforcementInspectionProgramServiceImpl implements IEnforcementInsp public List staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto) { return enforcementInspectionProgramMapper.staticProgramWithMonth(enforcementInspectionProgramDto); } + + @Override + public List selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram) { + List enforcementInspectionPrograms = + enforcementInspectionProgramMapper.selectPlanList(enforcementInspectionProgram); + enforcementInspectionPrograms.forEach(res ->{ + List zdxtFileCommons = zdxtFileCommonApi.selectZdxtFileById(res.getId()); + if(zdxtFileCommons != null && zdxtFileCommons.size() > 0){ + EnforcementInspectionProgram.FileObject fileObject = new EnforcementInspectionProgram.FileObject(); + fileObject.setFileName(zdxtFileCommons.get(0).getFileName()); + fileObject.setFileUrl(zdxtFileCommons.get(0).getUploadPath()); + res.setFileObject(fileObject); + } + }); + return enforcementInspectionPrograms; + } } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java index 2cd19dca..cc5a5f31 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java @@ -319,16 +319,34 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat // // 先清空之前的附件, 不然删除会有问题 // zdxtFileCommonApi.deleteZdxtFileByIds(enforcementRegistration.getId()); - // 业务又改了 保存和提交都走新增, 区别是保存后的可以修改, 提交后的不能修改.(这块在controller控制了isSubmit状态) - enforcementRegistration.setId(IdUtil.simpleUUID()); - enforcementRegistration.setCreateBy(user.getUserName()); - enforcementRegistration.setCreateTime(DateUtils.getNowDate()); - enforcementRegistration.setUserId(user.getUserId()); - enforcementRegistration.setDeptId(user.getDeptId()); - //默认评价状态为 0 否 - enforcementRegistration.setIsEvaluate(0); - //默认为登记状态 -// enforcementRegistration.setStatus(0); + // 先获取修改前的数据, 用于判断 (遇到修改提交情况) + if (StringUtils.isNotEmpty(enforcementRegistration.getId())) { + EnforcementRegistration raw_data = selectEnforcementRegistrationById(enforcementRegistration.getId()); + // 如果是联合执法 + if (1 == raw_data.getHasUnion()) { + // 如果联合的部门没改变, 则无需处理! + if (!raw_data.getUnionNo().equals(enforcementRegistration.getUnionNo())) { + // 如果改变, 这通过原联合code查出已联合数量, 数量>2则无需修改他人数据, 2<=则将他人的联合标签hasUnion设为0 + // 获取出原联合执法的数据列 + EnforcementRegistration er = new EnforcementRegistration(); + er.setUnionNo(raw_data.getUnionNo()); + List raw_unions = enforcementRegistrationMapper.selectEnforcementRegistrationByUnion(er); + if (raw_unions.size() <= 2) { + // 将原自身 union_no 清空 将所有关联的 has_union 置 0 + EnforcementRegistration updateUnionParams1 = new EnforcementRegistration(); + updateUnionParams1.setUnionNo("-1"); + updateUnionParams1.setId(raw_data.getId()); + enforcementRegistrationMapper.updateEnforcementRegistration(updateUnionParams1); + + EnforcementRegistration updateUnionParams2 = new EnforcementRegistration(); + updateUnionParams2.setUnionNo(raw_data.getUnionNo()); + updateUnionParams2.setHasUnion(0); + enforcementRegistrationMapper.updateRegToUnionFlag(updateUnionParams2); + } + } + } + } + // 登记可以直接进行联合检查, 选择了联合检查后, 如果未选择到联合检查用的分组id, 则随机生成一个, 否则用选定的unionNo, 并且修改这个unionNo的所有hasUnion为1 // 检查编号为空:说明没有选择关联那条联合检查; hasUnion==1: 说明开启了联合检查, 那么就是新开一条联合检查 if (StringUtils.isEmpty(enforcementRegistration.getUnionNo()) && 1 == enforcementRegistration.getHasUnion()) { @@ -339,6 +357,14 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat enforcementRegistration.setCheckCss(unionNo); // 为了适应来代码中的联合执法编码 } // 新增检查登记 + // 业务又改了 保存和提交都走新增, 区别是保存后的可以修改, 提交后的不能修改.(这块在controller控制了isSubmit状态) + enforcementRegistration.setId(IdUtil.simpleUUID()); + enforcementRegistration.setCreateBy(user.getUserName()); + enforcementRegistration.setCreateTime(DateUtils.getNowDate()); + enforcementRegistration.setUserId(user.getUserId()); + enforcementRegistration.setDeptId(user.getDeptId()); + //默认评价状态为 0 否 + enforcementRegistration.setIsEvaluate(0); resNum = enforcementRegistrationMapper.insertEnforcementRegistration(enforcementRegistration); // unionNo 上来不等于null, 那么说明关联了联合检查, 则直接新增, 并且将之前的所有 uninoNo相同的 hasUnion更新为 1 @@ -385,9 +411,57 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat @Override public int updateEnforcementRegistration(EnforcementRegistration enforcementRegistration) { + // 先获取修改前的数据, 用于判断 + if (StringUtils.isNotEmpty(enforcementRegistration.getId())) { + EnforcementRegistration raw_data = selectEnforcementRegistrationById(enforcementRegistration.getId()); + // 如果是联合执法 + if (1 == raw_data.getHasUnion()) { + // 如果联合的部门没改变, 则无需处理! + if (!raw_data.getUnionNo().equals(enforcementRegistration.getUnionNo())) { + // 如果改变, 这通过原联合code查出已联合数量, 数量>2则无需修改他人数据, 2<=则将他人的联合标签hasUnion设为0 + // 获取出原联合执法的数据列 + EnforcementRegistration er = new EnforcementRegistration(); + er.setUnionNo(raw_data.getUnionNo()); + List raw_unions = enforcementRegistrationMapper.selectEnforcementRegistrationByUnion(er); + if (raw_unions.size() <= 2) { + // 将原自身 union_no 清空 将所有关联的 has_union 置 0 + EnforcementRegistration updateUnionParams1 = new EnforcementRegistration(); + updateUnionParams1.setUnionNo("-1"); + updateUnionParams1.setId(raw_data.getId()); + enforcementRegistrationMapper.updateEnforcementRegistration(updateUnionParams1); + + EnforcementRegistration updateUnionParams2 = new EnforcementRegistration(); + updateUnionParams2.setUnionNo(raw_data.getUnionNo()); + updateUnionParams2.setHasUnion(0); + enforcementRegistrationMapper.updateRegToUnionFlag(updateUnionParams2); + } + } + } + } + // 然后开始走新增联合执法的流程 + // 登记可以直接进行联合检查, 选择了联合检查后, 如果未选择到联合检查用的分组id, 则随机生成一个, 否则用选定的unionNo, 并且修改这个unionNo的所有hasUnion为1 + // 检查编号为空:说明没有选择关联那条联合检查; hasUnion==1: 说明开启了联合检查, 那么就是新开一条联合检查 + if (StringUtils.isEmpty(enforcementRegistration.getUnionNo()) && 1 == enforcementRegistration.getHasUnion()) { + enforcementRegistration.setHasUnion(0); // 新开的联合检查先设置为0, 以为不确定后面来的人会不会与其关联, 如果都不关联, 只有它一条数据, 则不算联合检查 + String unionNo = IdUtil.simpleUUID(); + enforcementRegistration.setUnionNo(unionNo); + enforcementRegistration.setUniteCheck("1"); // 为了适应来代码中的联合执法编码 + enforcementRegistration.setCheckCss(unionNo); // 为了适应来代码中的联合执法编码 + } + UserBean user = userApi.getUserByUserId(enforcementRegistration.getUserId()); enforcementRegistration.setUpdateTime(DateUtils.getNowDate()); int i = enforcementRegistrationMapper.updateEnforcementRegistration(enforcementRegistration); + + // unionNo 上来不等于null, 那么说明关联了联合检查, 则直接新增, 并且将之前的所有 uninoNo相同的 hasUnion更新为 1 + if (i > 0 && 1 == enforcementRegistration.getHasUnion()) { + EnforcementRegistration updateUnionParams = new EnforcementRegistration(); + updateUnionParams.setUnionNo(enforcementRegistration.getUnionNo()); + updateUnionParams.setHasUnion(1); + enforcementRegistration.setUniteCheck("0"); // 为了适应来代码中的联合执法编码 + enforcementRegistrationMapper.updateRegToUnionFlag(updateUnionParams); + } + // 先清空之前的附件, 不然删除会有问题 zdxtFileCommonApi.deleteZdxtFileByIds(enforcementRegistration.getId()); // 重新加入附件 @@ -1051,7 +1125,8 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat } @Override - public List> queryUnionByHour(String enterpriseNumber, String checkCss) { + public List> queryUnionByHour(String enterpriseNumber, String checkCss, String enforcementTime, String unionNo) { + unionNo = "null".equals(unionNo) || StringUtils.isEmpty(unionNo)?null:unionNo; // 定义时间格式 DateTimeFormatter time_formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); // 定义时间格式 @@ -1063,8 +1138,19 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat EnforcementRegistration er = new EnforcementRegistration(); er.setEnterpriseNumber(enterpriseNumber); if ("3".equals(checkCss)) { - String now = now_tmp.format(date_formatter); - er.setCheckCss(now); +// String now = now_tmp.format(date_formatter); + er.setCheckCss(enforcementTime); + } else if ("edit".equals(checkCss)) { + er.setCheckCss(null); + LocalDateTime dateTime = LocalDateTime.parse(enforcementTime, time_formatter); + // 获取登记前一个小时的时间 + LocalDateTime oneHourAgo_tmp = dateTime.minusHours(1); + // 格式化时间 + String now = dateTime.format(time_formatter); + String oneHourAgo = oneHourAgo_tmp.format(time_formatter); + er.setBeginTime(oneHourAgo); + er.setEndTime(now); + er.setUnionNo(unionNo); } else { // 获取当前时间前一个小时的时间 LocalDateTime oneHourAgo_tmp = now_tmp.minusHours(1); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java index ff3553e7..3683a6d9 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java @@ -169,6 +169,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { //2.1 如果account 账号不为空的情况下,优先使用account来作程序判断 if(StringUtils.isNotEmpty(jsonObject.getString("account"))){ + log.info("---> 添加深i企用户 Account: {}",jsonObject.getString("account")); if(UserConstants.USER_NAME_UNIQUE.equals(userApi.checkClientLoginNameUnique(jsonObject.getString("account"),userSource))){ //新增用户信息 UserBean userBean = new UserBean(); @@ -200,6 +201,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { return userApi.insertUserResId(userBean); } }else if (StringUtils.isNotEmpty(jsonObject.getString("phone"))){ + log.info("---> 添加深i企用户 Phone: {}",jsonObject.getString("phone")); String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey, jsonObject.getString("phone")); if (UserConstants.USER_NAME_UNIQUE.equals(userApi.checkClientLoginNameUnique(phone,userSource))) { //新增用户信息 @@ -236,9 +238,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { UserBean tmp = new UserBean(); if(StringUtils.isNotEmpty(jsonObject.getString("account"))){ tmp = userApi.getClientUserByUserLoginName(jsonObject.getString("account"),userSource); + log.info("---> 通过 Account 获取用户: {}",jsonObject.getString("account")); }else{ String phone = IdCardCryptoUtil.symmetricDecryptIdCard(secretKey, jsonObject.getString("phone")); tmp = userApi.getClientUserByUserPhone(phone,userSource); + log.info("---> 通过 phone 获取用户: {}",jsonObject.getString("phone")); } return tmp.getUserId(); } diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java index e2696ed8..10c2d07b 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java @@ -192,9 +192,6 @@ public class HttpUtil { public static String httpSendPost(String url,String params,Map heardMap){ try { URL uri = new URL(url); - log.info("url{}",url); - log.info("params{}",params); - log.info("heardMap{}",heardMap); HttpURLConnection connection = (HttpURLConnection) uri.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type","application/json"); @@ -223,9 +220,13 @@ public class HttpUtil { System.out.println("请求成功"); return response.toString(); }else{ - log.error("深i企接口获取用户信息接口调用失败,失败码:{}",responseCode); + log.error("============================== 深i企接口获取用户信息接口调用失败 =============================="); + log.error("---> 失败码:{}",responseCode); + log.error("---> url: {}",url); + log.error("---> params: {}",params); + log.error("---> heardMap: {}",heardMap); + log.error("============================== =========================== =============================="); // BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); - System.out.println("请求失败"); } } catch (Exception e) { e.printStackTrace(); diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml index cf4f29aa..68df2f98 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml @@ -420,4 +420,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by total desc limit 10 + + \ No newline at end of file diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml index a470e420..58b0e7d7 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml @@ -107,8 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and check_category = #{checkCategory} and check_css = #{checkCss} and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%') @@ -174,8 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and is_delete = #{isDelete} and status = #{status} and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} @@ -259,8 +259,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and is_delete = #{isDelete} and status = #{status} and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} and ( enterprise_name like concat('%',#{searchValue},'%')) @@ -350,8 +350,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and unite_check is not null and unite_check is null and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} and check_css is not null and check_css is null and check_category = #{checkCategory} @@ -416,8 +416,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and r.check_css is null and r.check_css is not null and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} and r.check_category = #{checkCategory} and r.check_css = #{checkCss} and law_enforcement_item_text like concat('%', #{lawEnforcementItemText,jdbcType=VARCHAR}, '%') @@ -481,8 +481,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and is_complaint = #{isComplaint} and status = #{status} and union_no = #{unionNo} - and has_union = #{hasUnion} - and has_auto = #{hasAuto} + and has_union = #{hasUnion} + and has_auto = #{hasAuto} and law_enforcement_code = #{lawEnforcementCode} and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%') @@ -595,8 +595,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" law_id, law_text, union_no, - has_union, - has_auto, + has_union, + has_auto, #{id}, @@ -642,8 +642,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{lawId}, #{lawText}, #{unionNo}, - #{hasUnion}, - #{hasAuto}, + #{hasUnion}, + #{hasAuto}, @@ -690,8 +690,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_evaluate = #{isEvaluate}, law_id = #{lawId}, law_text = #{lawText}, - has_union = #{hasUnion} - has_auto = #{hasAuto} + union_no = #{unionNo}, + union_no = null, + has_union = #{hasUnion}, + has_auto = #{hasAuto}, where id = #{id} @@ -1092,13 +1094,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and enterprise_number = #{enterpriseNumber} - and DATE_FORMAT(enforcement_time, '%Y-%m-%d') = #{checkCss} + and DATE_FORMAT(enforcement_time, '%Y-%m-%d') = DATE_FORMAT(#{checkCss}, '%Y-%m-%d') - and enforcement_time >= #{beginTime} + and enforcement_time > #{beginTime} - and enforcement_time <= #{endTime} + and enforcement_time < #{endTime} + or union_no = #{unionNo} and union_no is not null order by enforcement_time desc @@ -1108,7 +1111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update enforcement_registration - has_union = #{hasUnion} + has_union = #{hasUnion} where union_no = #{unionNo}