Browse Source

修改下打日志, 简单点 . 然后联合检查配合的后台

v6
蟑螂恶霸 1 year ago
parent
commit
90ec24ea5d
  1. 12
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementInspectionProgramController.java
  2. 6
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java
  3. 26
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppThirdLoginController.java
  4. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml
  5. 8
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html
  6. 14
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html
  7. 14
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html
  8. 3
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html
  9. 3
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/edit.html
  10. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java
  11. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java
  12. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java
  13. 16
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java
  14. 112
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java
  15. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java
  16. 11
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java
  17. 11
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml
  18. 47
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

12
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<EnforcementInspectionProgram> list =
enforcementInspectionProgramService.selectEnforcementInspectionProgramListNoPermission(enforcementInspectionProgram);
UserBean userBean = userApi.getUserByUserId(enforcementInspectionProgram.getUserId());
enforcementInspectionProgram.setDeptId(userBean.getDeptId());
startPage();
// List<EnforcementInspectionProgram> list = enforcementInspectionProgramService.selectEnforcementInspectionProgramListNoPermission(enforcementInspectionProgram);
List<EnforcementInspectionProgram> list = enforcementInspectionProgramService.selectPlanList(enforcementInspectionProgram);
return getDataTable(list);
}

6
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));
}
/**

26
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<String, String> 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);

2
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}, '%')
</if>
<if test="objectType != null and objectType != ''">
AND object_type = #{objectType}
AND (object_type = #{objectType} or object_type = '0')
</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">
AND bureau_dept_names like concat('%', #{bureauDeptNames}, '%')

8
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/registration/registration.html

@ -30,7 +30,7 @@
<div class="select-list">
<ul>
<li>
<p>执法部门</p>
<p>执法单位/受委托组织</p>
<input type="text" name="bureauDeptName"/>
</li>
<li>
@ -335,7 +335,7 @@
columns: [
{
field : 'enterpriseName',
title : '被检查企业名称1',
title : '被检查企业名称',
formatter:function (value) {
return "<div style='text-align: left'>"+ value +"</div>";
}
@ -350,7 +350,7 @@
},
{
field : 'bureauDeptName',
title : '执法部门',
title : '执法单位/受委托组织',
formatter:function (value,row,index) {
if(row.uniteType==1){
return "<div style='text-align: left'>"+ value +"(牵头单位)</div>";
@ -491,7 +491,7 @@
},
{
field : 'bureauDeptName',
title : '执法部门',
title : '执法单位/受委托组织',
formatter:function (value,row,index) {
if(row.uniteType==1){
return "<div style='text-align: left'>"+ value +"(牵头单位)</div>";

14
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/overall-analysis.html

@ -531,14 +531,20 @@
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">同比</label>';
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id="" style="display: none;"><i class="fa fa fa-long-arrow-down"></i></span>';
if (parseFloat(indicator.yoy) >= 0) {
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>'
} else {
html += ' <span class="data-fall" id="""><i class="fa fa fa-long-arrow-down"></i></span>'
}
html += ' <span class="data-change" id="">'+indicator.yoy+'%</span>';
html += ' </div>'
html += ' <div class="percent-tag">';
html += ' <label id="">环比</label>';
html += ' <span class="data-rise" id="" style="display: none;"><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id=""><i class="fa fa fa-long-arrow-down"></i></span>';
if (parseFloat(indicator.ring_ratio) >= 0) {
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>'
} else {
html += ' <span class="data-fall" id="""><i class="fa fa fa-long-arrow-down"></i></span>'
}
html += ' <span class="data-change" id="">'+indicator.ring_ratio+'%</span>';
html += ' </div>';
html += '</div>';

14
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html

@ -414,14 +414,20 @@
html += ' </div>';
html += ' <div class="percent-tag">';
html += ' <label id="">同比</label>';
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id="" style="display: none;"><i class="fa fa fa-long-arrow-down"></i></span>';
if (parseFloat(indicator.yoy) >= 0) {
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>'
} else {
html += ' <span class="data-fall" id="""><i class="fa fa fa-long-arrow-down"></i></span>'
}
html += ' <span class="data-change" id="">'+indicator.yoy+'%</span>';
html += ' </div>'
html += ' <div class="percent-tag">';
html += ' <label id="">环比</label>';
html += ' <span class="data-rise" id="" style="display: none;"><i class="fa fa fa-long-arrow-up"></i></span>';
html += ' <span class="data-fall" id=""><i class="fa fa fa-long-arrow-down"></i></span>';
if (parseFloat(indicator.ring_ratio) >= 0) {
html += ' <span class="data-rise" id=""><i class="fa fa fa-long-arrow-up"></i></span>'
} else {
html += ' <span class="data-fall" id="""><i class="fa fa fa-long-arrow-down"></i></span>'
}
html += ' <span class="data-change" id="">'+indicator.ring_ratio+'%</span>';
html += ' </div>';
html += '</div>';

3
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html

@ -25,7 +25,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">发布对象:</label>
<div class="col-sm-10">
<select name="objectType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<select id="objectType" name="objectType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
@ -150,6 +150,7 @@
var data = {};
for (var i=0; i<arr.length; i++) {
var item = arr[i].split('=');
console.log("item", item)
var value = item[1].replace("+", " ");
data[item[0]] = value;
}

3
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/edit.html

@ -26,7 +26,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">发布对象:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<select id="objectType" name="objectType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{objectType}"></option>
</select>
</div>
@ -161,6 +161,7 @@
previewFileIcon: '<i class="fas fa-file"></i>',
preferIconicPreview: true,
uploadExtraData: function () {
var sHTML = $('.summernote').summernote('code');
$("#noticeContent").val(sHTML);
var formData = $("#form-notice-edit").serialize();

8
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnforcementInspectionProgramMapper.java

@ -101,4 +101,12 @@ public interface EnforcementInspectionProgramMapper
* @return
*/
List<EnforcementInspectionProgramDto> staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto);
/**
* 查询执法检查计划列表
*
* @param enforcementInspectionProgram 执法检查计划
* @return 执法检查计划集合
*/
List<EnforcementInspectionProgram> selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram);
}

1
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementInspectionProgramService.java

@ -30,6 +30,7 @@ public interface IEnforcementInspectionProgramService
*/
List<EnforcementInspectionProgram> selectEnforcementInspectionProgramList(EnforcementInspectionProgram enforcementInspectionProgram);
List<EnforcementInspectionProgram> selectEnforcementInspectionProgramListNoPermission(EnforcementInspectionProgram enforcementInspectionProgram);
List<EnforcementInspectionProgram> selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram);
List<EnforcementInspectionProgram> queryNoticeList(EnforcementInspectionProgram enforcementInspectionProgram);
/**

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnforcementRegistrationService.java

@ -120,5 +120,5 @@ public interface IEnforcementRegistrationService
List<EnforcementRegistration> untieCheck1MakeAndDetail(List<EnforcementRegistration> enforcementRegistrationList);
List<Map<String, Object>> queryUnionByHour(String enterpriseNumber, String checkCss);
List<Map<String, Object>> queryUnionByHour(String enterpriseNumber, String checkCss, String enforcementTime, String unionNo);
}

16
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementInspectionProgramServiceImpl.java

@ -240,4 +240,20 @@ public class EnforcementInspectionProgramServiceImpl implements IEnforcementInsp
public List<EnforcementInspectionProgramDto> staticProgramWithMonth(EnforcementInspectionProgramDto enforcementInspectionProgramDto) {
return enforcementInspectionProgramMapper.staticProgramWithMonth(enforcementInspectionProgramDto);
}
@Override
public List<EnforcementInspectionProgram> selectPlanList(EnforcementInspectionProgram enforcementInspectionProgram) {
List<EnforcementInspectionProgram> enforcementInspectionPrograms =
enforcementInspectionProgramMapper.selectPlanList(enforcementInspectionProgram);
enforcementInspectionPrograms.forEach(res ->{
List<ZdxtFileCommon> 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;
}
}

112
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<EnforcementRegistration> 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<EnforcementRegistration> 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<Map<String, Object>> queryUnionByHour(String enterpriseNumber, String checkCss) {
public List<Map<String, Object>> 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);

4
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();
}

11
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<String,Object> 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();

11
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
</select>
<select id="selectPlanList" parameterType="EnforcementInspectionProgram" resultMap="EnforcementInspectionProgramResult">
<include refid="selectEnforcementInspectionProgramVo"/>
where (is_publish = 1 or enforcement_department_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set( #{deptId} , ancestors ) != 0 ))
<if test="searchText != null and searchText != ''">
and (plan_name like concat('%', #{searchText}, '%')
or enforcement_department like concat('%', #{searchText}, '%')
or bureau_dept_name like concat('%', #{searchText}, '%'))
</if>
order by create_time desc
</select>
</mapper>

47
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -107,8 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkCategory != null and checkCategory != ''"> and check_category = #{checkCategory}</if>
<if test="checkCss != null and checkCss != ''"> and check_css = #{checkCss}</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<if test="searchValue != null and searchValue != ''">
and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%')
@ -174,8 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="status != null "> and status = #{status}</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<!-- <if test="searchValue != null and searchValue != ''">-->
<!-- and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%')-->
@ -259,8 +259,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="status != null "> and status = #{status}</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<if test="searchValue != null and searchValue != ''">
and ( enterprise_name like concat('%',#{searchValue},'%'))</if>
<if test="dateSearch != null and dateSearch != ''">
@ -350,8 +350,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="uniteCheck == '0'.toString()"> and unite_check is not null</if>
<if test="uniteCheck == '1'.toString()"> and unite_check is null</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<if test="enforce == '0'.toString()"> and check_css is not null</if>
<if test="enforce == '1'.toString()"> and check_css is null</if>
<if test="checkCategory != null and checkCategory != ''"> and check_category = #{checkCategory}</if>
@ -416,8 +416,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enforce == '0'.toString()"> and r.check_css is null</if>
<if test="enforce == '1'.toString()"> and r.check_css is not null</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<if test="checkCategory != null and checkCategory != ''"> and r.check_category = #{checkCategory}</if>
<if test="checkCss != null and checkCss != ''"> and r.check_css = #{checkCss}</if>
<if test="lawEnforcementItemText != null and lawEnforcementItemText != ''"> and law_enforcement_item_text like concat('%', #{lawEnforcementItemText,jdbcType=VARCHAR}, '%')</if>
@ -481,8 +481,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isComplaint != null "> and is_complaint = #{isComplaint}</if>
<if test="status != null "> and status = #{status}</if>
<if test="unionNo != null and unionNo != ''"> and union_no = #{unionNo}</if>
<if test="hasUnion != null and hasUnion != ''"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> and has_auto = #{hasAuto}</if>
<if test="hasUnion != null"> and has_union = #{hasUnion}</if>
<if test="hasAuto != null"> and has_auto = #{hasAuto}</if>
<if test="lawEnforcementCode != null and lawEnforcementCode != ''"> and law_enforcement_code = #{lawEnforcementCode}</if>
<if test="searchValue != null and searchValue != ''">
and (law_enforcement_item_text like concat(concat('%',#{searchValue}),'%')
@ -595,8 +595,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lawId != null and lawId != ''"> law_id,</if>
<if test="lawText != null and lawText != ''"> law_text,</if>
<if test="unionNo != null and unionNo != ''"> union_no,</if>
<if test="hasUnion != null and hasUnion != ''"> has_union,</if>
<if test="hasAuto != null and hasAuto != ''"> has_auto,</if>
<if test="hasUnion != null"> has_union,</if>
<if test="hasAuto != null"> has_auto,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -642,8 +642,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lawId != null and lawId != ''"> #{lawId},</if>
<if test="lawText != null and lawText != ''"> #{lawText},</if>
<if test="unionNo != null and unionNo != ''"> #{unionNo},</if>
<if test="hasUnion != null and hasUnion != ''"> #{hasUnion},</if>
<if test="hasAuto != null and hasAuto != ''"> #{hasAuto},</if>
<if test="hasUnion != null"> #{hasUnion},</if>
<if test="hasAuto != null"> #{hasAuto},</if>
</trim>
</insert>
@ -690,8 +690,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isEvaluate != null"> is_evaluate = #{isEvaluate},</if>
<if test="lawId != null and lawId != ''"> law_id = #{lawId},</if>
<if test="lawText != null and lawText != ''"> law_text = #{lawText},</if>
<if test="hasUnion != null and hasUnion != ''"> has_union = #{hasUnion}</if>
<if test="hasAuto != null and hasAuto != ''"> has_auto = #{hasAuto}</if>
<if test="unionNo != null and unionNo != '' and unionNo != '-1'"> union_no = #{unionNo},</if>
<if test="unionNo != null and unionNo != '' and unionNo == '-1'"> union_no = null,</if>
<if test="hasUnion != null"> has_union = #{hasUnion},</if>
<if test="hasAuto != null"> has_auto = #{hasAuto},</if>
</trim>
where id = #{id}
</update>
@ -1092,13 +1094,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectEnforcementRegistrationVo"/>
<where>
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<if test="checkCss != null and checkCss != ''"> and DATE_FORMAT(enforcement_time, '%Y-%m-%d') = #{checkCss}</if>
<if test="checkCss != null and checkCss != ''"> and DATE_FORMAT(enforcement_time, '%Y-%m-%d') = DATE_FORMAT(#{checkCss}, '%Y-%m-%d')</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and enforcement_time &gt;= #{beginTime}
and enforcement_time &gt; #{beginTime}
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and enforcement_time &lt;= #{endTime}
and enforcement_time &lt; #{endTime}
</if>
<if test="unionNo != null and unionNo !=''"> or union_no = #{unionNo}</if>
and union_no is not null
</where>
order by enforcement_time desc
@ -1108,7 +1111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateRegToUnionFlag" parameterType="EnforcementRegistration">
update enforcement_registration
<trim prefix="SET" suffixOverrides=",">
<if test="hasUnion != null and hasUnion != ''"> has_union = #{hasUnion}</if>
<if test="hasUnion != null"> has_union = #{hasUnion}</if>
</trim>
where union_no = #{unionNo}
</update>

Loading…
Cancel
Save