Browse Source

执法监督码查询,获取人员信息部门接口,

v2
chenrui 3 years ago
parent
commit
454da227c6
  1. 13
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/common/CommonController.java
  2. 9
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/application.yml
  3. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java
  4. 9
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java
  5. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseLawEnforcementController.java
  6. 124
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/LawEnforcementWarningListController.java
  7. 12
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforceRegCount.java
  8. 26
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java
  9. 132
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/LawEnforcementWarningList.java
  10. 61
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/LawEnforcementWarningListMapper.java
  11. 20
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IAccessTokenService.java
  12. 61
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ILawEnforcementWarningListService.java
  13. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/SRZApiService.java
  14. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/YZYApiService.java
  15. 42
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/AccessTokenServiceImpl.java
  16. 28
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java
  17. 17
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java
  18. 98
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LawEnforcementWarningListServiceImpl.java
  19. 58
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/YZYApiServiceImpl.java
  20. 187
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java
  21. 34
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/PasswordTools.java
  22. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  23. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml
  24. 92
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LawEnforcementWarningListMapper.xml

13
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/common/CommonController.java

@ -7,8 +7,11 @@ import com.zdxt.auth.common.constant.Constants;
import com.zdxt.auth.common.utils.StringUtils; import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.auth.common.utils.file.FileUploadUtils; import com.zdxt.auth.common.utils.file.FileUploadUtils;
import com.zdxt.auth.common.utils.file.FileUtils; import com.zdxt.auth.common.utils.file.FileUtils;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.framework.config.ServerConfig; import com.zdxt.auth.framework.config.ServerConfig;
import com.zdxt.auth.framework.web.domain.AjaxResult; import com.zdxt.auth.framework.web.domain.AjaxResult;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.config.RuoYiConfig; import com.zdxt.common.config.RuoYiConfig;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -32,6 +35,9 @@ public class CommonController
@Autowired @Autowired
private ServerConfig serverConfig; private ServerConfig serverConfig;
@Autowired
private UserApi userApi;
/** /**
* 通用下载请求 * 通用下载请求
* *
@ -110,4 +116,11 @@ public class CommonController
"attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName)); "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
FileUtils.writeBytes(downloadPath, response.getOutputStream()); FileUtils.writeBytes(downloadPath, response.getOutputStream());
} }
@GetMapping("/getUserInfo")
@ResponseBody
public ZDResponse getUserInfo(){
UserBean user = userApi.getCurrentUser();
return ZDResponse.success("查询成功",user);
}
} }

9
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/application.yml

@ -198,5 +198,10 @@ excel:
export: true export: true
import: true import: true
jt808: # 粤政易对接令牌信息
httpUrl: http://139.186.148.21:8000 yzy:
yzyUrl: http://50.9.11.153
corpid: 123456
corpsecret: 88761
paasid: 123

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnforcementInspectionProgramController.java

@ -38,7 +38,7 @@ public class EnforcementInspectionProgramController extends BaseController
/** /**
* 查询执法检查计划列表 * 查询执法检查计划列表
*/ */
@RequiresPermissions("code:enforcementInspectionProgram:list") // @RequiresPermissions("code:enforcementInspectionProgram:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(EnforcementInspectionProgram enforcementInspectionProgram) public TableDataInfo list(EnforcementInspectionProgram enforcementInspectionProgram)
@ -52,7 +52,7 @@ public class EnforcementInspectionProgramController extends BaseController
/** /**
* 查询执法检查计划列表 * 查询执法检查计划列表
*/ */
@RequiresPermissions("code:enforcementInspectionProgram:queryList") // @RequiresPermissions("code:enforcementInspectionProgram:queryList")
@GetMapping("/queryList") @GetMapping("/queryList")
@ResponseBody @ResponseBody
public ZDResponse queryList(EnforcementInspectionProgram enforcementInspectionProgram) public ZDResponse queryList(EnforcementInspectionProgram enforcementInspectionProgram)
@ -75,7 +75,7 @@ public class EnforcementInspectionProgramController extends BaseController
/** /**
* 新增保存执法检查计划 * 新增保存执法检查计划
*/ */
@RequiresPermissions("code:enforcementInspectionProgram:add") // @RequiresPermissions("code:enforcementInspectionProgram:add")
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public ZDResponse addSave(@RequestBody EnforcementInspectionProgram enforcementInspectionProgram) public ZDResponse addSave(@RequestBody EnforcementInspectionProgram enforcementInspectionProgram)

9
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java

@ -171,14 +171,15 @@ public class EnterpriseInformationController extends BaseController
* @return * @return
*/ */
@ResponseBody @ResponseBody
@GetMapping("/getEnterpriseInformation") @GetMapping("/getEnterpriseInformation/{enterpriseNumber}")
public ZDResponse getEnterpriseInformation(String enterpriseNumber){ public ZDResponse getEnterpriseInformation(@PathVariable("enterpriseNumber") String enterpriseNumber){
//查询企业信息 //查询企业信息
EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber); EnterpriseInformation enterpriseInformation = enterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber);
if(PasswordTools.decrypt(enterpriseInformation.getEnterpriseNumber(),enterpriseNumber)){ /*if(PasswordTools.decrypt(enterpriseInformation.getEnterpriseNumber(),enterpriseNumber)){
return ZDResponse.success("查询成功",enterpriseInformation); return ZDResponse.success("查询成功",enterpriseInformation);
}else{ }else{
return ZDResponse.error("查询失败"); return ZDResponse.error("查询失败");
} }*/
return ZDResponse.success("查询成功",enterpriseInformation);
} }
} }

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseLawEnforcementController.java

@ -74,7 +74,7 @@ public class EnterpriseLawEnforcementController extends BaseController
/** /**
* 新增保存企业端-执法部门预约记录 * 新增保存企业端-执法部门预约记录
*/ */
@RequiresPermissions("code:enforcement:add") // @RequiresPermissions("code:enforcement:add")
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public ZDResponse addSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement) public ZDResponse addSave(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement)

124
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/LawEnforcementWarningListController.java

@ -0,0 +1,124 @@
package com.zdxt.code.controller;
import java.util.List;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController;
import com.zdxt.common.util.TableDataInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.zdxt.code.domain.LawEnforcementWarningList;
import com.zdxt.code.service.ILawEnforcementWarningListService;
/**
* 执法预警列表Controller
*
* @author chenrui
* @date 2024-03-22
*/
@Controller
@RequestMapping("/code/LawEnforcementWarningList")
public class LawEnforcementWarningListController extends BaseController
{
private String prefix = "code/LawEnforcementWarningList";
@Autowired
private ILawEnforcementWarningListService lawEnforcementWarningListService;
@RequiresPermissions("code:LawEnforcementWarningList:view")
@GetMapping()
public String LawEnforcementWarningList()
{
return prefix + "/LawEnforcementWarningList";
}
/**
* 查询执法预警列表列表
*/
@RequiresPermissions("code:LawEnforcementWarningList:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(LawEnforcementWarningList lawEnforcementWarningList)
{
startPage();
List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListList(lawEnforcementWarningList);
return getDataTable(list);
}
/**
* 查询执法预警列表列表
*/
@RequiresPermissions("code:LawEnforcementWarningList:queryList")
@GetMapping("/queryList")
@ResponseBody
public ZDResponse queryList(LawEnforcementWarningList lawEnforcementWarningList)
{
List<LawEnforcementWarningList> list = lawEnforcementWarningListService.selectLawEnforcementWarningListList(lawEnforcementWarningList);
return ZDResponse.success("查询成功",list);
}
/**
* 新增执法预警列表
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存执法预警列表
*/
@RequiresPermissions("code:LawEnforcementWarningList:add")
@PostMapping("/add")
@ResponseBody
public ZDResponse addSave(LawEnforcementWarningList lawEnforcementWarningList)
{
return lawEnforcementWarningListService.insertLawEnforcementWarningList(lawEnforcementWarningList)
> 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存成功");
}
/**
* 修改执法预警列表
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap)
{
LawEnforcementWarningList lawEnforcementWarningList = lawEnforcementWarningListService.selectLawEnforcementWarningListById(id);
mmap.put("lawEnforcementWarningList", lawEnforcementWarningList);
return prefix + "/edit";
}
/**
* 修改保存执法预警列表
*/
@RequiresPermissions("code:LawEnforcementWarningList:edit")
@PostMapping("/edit")
@ResponseBody
public ZDResponse editSave(LawEnforcementWarningList lawEnforcementWarningList)
{
return lawEnforcementWarningListService.updateLawEnforcementWarningList(lawEnforcementWarningList)
> 0 ? ZDResponse.success("修改成功"): ZDResponse.error("修改失败");
}
/**
* 删除执法预警列表
*/
@RequiresPermissions("code:LawEnforcementWarningList:remove")
@PostMapping( "/remove")
@ResponseBody
public ZDResponse remove(String ids)
{
return lawEnforcementWarningListService.deleteLawEnforcementWarningListByIds(ids) > 0?
ZDResponse.success("删除成功") : ZDResponse.error("删除失败");
}
}

12
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforceRegCount.java

@ -19,6 +19,10 @@ public class EnforceRegCount
private String lawEnforcement; private String lawEnforcement;
/** 企业id */ /** 企业id */
private String lawEnforcementId; private String lawEnforcementId;
/**
* 企业统一信用代码
*/
private String enterpriseNumber;
/** 统计数量 */ /** 统计数量 */
private Integer num; private Integer num;
/** 级别 */ /** 级别 */
@ -55,4 +59,12 @@ public class EnforceRegCount
public void setLevel(String level) { public void setLevel(String level) {
this.level = level; this.level = level;
} }
public String getEnterpriseNumber() {
return enterpriseNumber;
}
public void setEnterpriseNumber(String enterpriseNumber) {
this.enterpriseNumber = enterpriseNumber;
}
} }

26
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementRegistration.java

@ -103,6 +103,16 @@ public class EnforcementRegistration extends BaseDomain
*/ */
private String dateSearch; private String dateSearch;
/**
* 开始时间
*/
private String beginTime;
/**
* 结束时间
*/
private String endTime;
public String getId() { public String getId() {
return id; return id;
} }
@ -255,6 +265,22 @@ public class EnforcementRegistration extends BaseDomain
this.lawEnforcementCode = lawEnforcementCode; this.lawEnforcementCode = lawEnforcementCode;
} }
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
@Override @Override
public String getRemark() { public String getRemark() {
return remark; return remark;

132
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/LawEnforcementWarningList.java

@ -0,0 +1,132 @@
package com.zdxt.code.domain;
import com.zdxt.common.BaseDomain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 执法预警列表对象 law_enforcement_warning_list
*
* @author chenrui
* @date 2024-03-22
*/
public class LawEnforcementWarningList extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private String id;
/** 预警时间 */
private Date warningTime;
/** 预警原因 */
private String warningCause;
/** 预警级别: 1 一级 2 二级 3 三级 */
private Integer warningLevel;
/** 企业名称 */
private String enterpriseName;
/** 企业统一信用编码 */
private String enterpriseNumber;
/** 执法次数 */
private Integer enforcementNumber;
/**
* 搜索日期
*/
private String searchDate;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setWarningTime(Date warningTime)
{
this.warningTime = warningTime;
}
public Date getWarningTime()
{
return warningTime;
}
public void setWarningCause(String warningCause)
{
this.warningCause = warningCause;
}
public String getWarningCause()
{
return warningCause;
}
public void setWarningLevel(Integer warningLevel)
{
this.warningLevel = warningLevel;
}
public Integer getWarningLevel()
{
return warningLevel;
}
public void setEnterpriseName(String enterpriseName)
{
this.enterpriseName = enterpriseName;
}
public String getEnterpriseName()
{
return enterpriseName;
}
public void setEnterpriseNumber(String enterpriseNumber)
{
this.enterpriseNumber = enterpriseNumber;
}
public String getEnterpriseNumber()
{
return enterpriseNumber;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Integer getEnforcementNumber() {
return enforcementNumber;
}
public void setEnforcementNumber(Integer enforcementNumber) {
this.enforcementNumber = enforcementNumber;
}
public String getSearchDate() {
return searchDate;
}
public void setSearchDate(String searchDate) {
this.searchDate = searchDate;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("warningTime", getWarningTime())
.append("warningCause", getWarningCause())
.append("warningLevel", getWarningLevel())
.append("createTime", getCreateTime())
.append("enterpriseName", getEnterpriseName())
.append("enterpriseNumber", getEnterpriseNumber())
.toString();
}
}

61
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/LawEnforcementWarningListMapper.java

@ -0,0 +1,61 @@
package com.zdxt.code.mapper;
import com.zdxt.code.domain.LawEnforcementWarningList;
import java.util.List;
/**
* 执法预警列表Mapper接口
*
* @author chenrui
* @date 2024-03-22
*/
public interface LawEnforcementWarningListMapper
{
/**
* 查询执法预警列表
*
* @param id 执法预警列表ID
* @return 执法预警列表
*/
public LawEnforcementWarningList selectLawEnforcementWarningListById(String id);
/**
* 查询执法预警列表列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 执法预警列表集合
*/
public List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 新增执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
public int insertLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 修改执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
public int updateLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 删除执法预警列表
*
* @param id 执法预警列表ID
* @return 结果
*/
public int deleteLawEnforcementWarningListById(String id);
/**
* 批量删除执法预警列表
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteLawEnforcementWarningListByIds(String[] ids);
}

20
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IAccessTokenService.java

@ -0,0 +1,20 @@
package com.zdxt.code.service;
import java.util.Map;
/**
* 获取登录令牌接口 包含粤政易,市认证平台
*/
public interface IAccessTokenService {
/**
* 获取粤政易令牌
*/
void getYZYToken(Map<String,Object> params);
/**
* 获取市认证平台token
* @param params
*/
void getSRZToken(Map<String,Object> params);
}

61
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ILawEnforcementWarningListService.java

@ -0,0 +1,61 @@
package com.zdxt.code.service;
import com.zdxt.code.domain.LawEnforcementWarningList;
import java.util.List;
/**
* 执法预警列表Service接口
*
* @author chenrui
* @date 2024-03-22
*/
public interface ILawEnforcementWarningListService
{
/**
* 查询执法预警列表
*
* @param id 执法预警列表ID
* @return 执法预警列表
*/
public LawEnforcementWarningList selectLawEnforcementWarningListById(String id);
/**
* 查询执法预警列表列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 执法预警列表集合
*/
public List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 新增执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
public int insertLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 修改执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
public int updateLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList);
/**
* 批量删除执法预警列表
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteLawEnforcementWarningListByIds(String ids);
/**
* 删除执法预警列表信息
*
* @param id 执法预警列表ID
* @return 结果
*/
public int deleteLawEnforcementWarningListById(String id);
}

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/SRZApiService.java

@ -0,0 +1,7 @@
package com.zdxt.code.service;
/**
* 市认证
*/
public interface SRZApiService {
}

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/YZYApiService.java

@ -0,0 +1,10 @@
package com.zdxt.code.service;
/**
* 对接粤政易接口
*/
public interface YZYApiService {
void getUserInfo();
}

42
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/AccessTokenServiceImpl.java

@ -0,0 +1,42 @@
package com.zdxt.code.service.impl;
import com.zdxt.code.service.IAccessTokenService;
import com.zdxt.code.utils.HttpUtil;
import org.apache.poi.hssf.record.DVALRecord;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 获取登录令牌接口 包含粤政易,市认证平台
*/
@Service
public class AccessTokenServiceImpl implements IAccessTokenService {
//粤政易 认证信息
// @Value("${yzy.yzyUr}")
private String YZYUrl;
// @Value("${yzy.corpid}")
private String YZYCorpid;
// @Value("${yzy.corpsecret}")
private String YZYCorpsecret;
@Override
public void getYZYToken(Map<String, Object> params) {
try {
//获取粤政易令牌信息
String s = HttpUtil.HttpSendGet(YZYUrl + "/ebus/yzyapi/cgi-bin/gettoken?corpid=" + YZYCorpid +
"&corpsecret=" + YZYCorpsecret, "");
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void getSRZToken(Map<String, Object> params) {
}
}

28
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnforcementRegistrationServiceImpl.java

@ -9,7 +9,9 @@ import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi; import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.feign.ZdxtFileCommonApi; import com.zdxt.auth.feign.ZdxtFileCommonApi;
import com.zdxt.code.domain.EnforceRegCount; import com.zdxt.code.domain.EnforceRegCount;
import com.zdxt.code.domain.LawEnforcementWarningList;
import com.zdxt.code.domain.RuleItemList; import com.zdxt.code.domain.RuleItemList;
import com.zdxt.code.service.ILawEnforcementWarningListService;
import com.zdxt.code.service.IRuleItemListService; import com.zdxt.code.service.IRuleItemListService;
import com.zdxt.common.util.DateUtils; import com.zdxt.common.util.DateUtils;
import com.zdxt.common.util.StringUtils; import com.zdxt.common.util.StringUtils;
@ -42,6 +44,9 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
@Autowired @Autowired
private UserApi userApi; private UserApi userApi;
@Autowired
private ILawEnforcementWarningListService lawEnforcementWarningListService;
/** /**
* 查询执法端-执法登记 * 查询执法端-执法登记
* *
@ -166,6 +171,8 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
) )
)); ));
Date nowDate = DateUtils.getNowDate();
List<LawEnforcementWarningList> lawEnforcementWarningLists = new ArrayList<>();
List<EnforceRegCount> results = new ArrayList<>(); List<EnforceRegCount> results = new ArrayList<>();
Iterator<Map.Entry<String, EnforceRegCount>> iterator = maxItems.entrySet().iterator(); Iterator<Map.Entry<String, EnforceRegCount>> iterator = maxItems.entrySet().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@ -174,11 +181,32 @@ public class EnforcementRegistrationServiceImpl implements IEnforcementRegistrat
for (RuleItemList rule : ruleItemLists) { for (RuleItemList rule : ruleItemLists) {
if (reg.getNum() >= rule.getExistAlarm() && reg.getNum() <= rule.getExistAlarmEnd()) { if (reg.getNum() >= rule.getExistAlarm() && reg.getNum() <= rule.getExistAlarmEnd()) {
reg.setLevel(rule.getAlarmType()); reg.setLevel(rule.getAlarmType());
LawEnforcementWarningList lawEnforcementWarningList = new LawEnforcementWarningList();
lawEnforcementWarningList.setId(IdUtil.simpleUUID());
//获取执法次数
lawEnforcementWarningList.setEnforcementNumber(reg.getNum());
//企业名称
lawEnforcementWarningList.setEnterpriseName(reg.getLawEnforcement());
//企业统一信用代码
lawEnforcementWarningList.setEnterpriseNumber(reg.getEnterpriseNumber());
//预警原因
lawEnforcementWarningList.setWarningCause(""+ reg.getNum() +"");
//预警时间
lawEnforcementWarningList.setWarningTime(nowDate);
//创建时间
lawEnforcementWarningList.setCreateTime(nowDate);
//存储告警信息
lawEnforcementWarningLists.add(lawEnforcementWarningList);
break; break;
} }
} }
results.add(reg); results.add(reg);
} }
//添加预警信息
for (LawEnforcementWarningList lawEnforcementWarningList : lawEnforcementWarningLists) {
lawEnforcementWarningListService.insertLawEnforcementWarningList(lawEnforcementWarningList);
}
return results; return results;
} }

17
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseLawEnforcementServiceImpl.java

@ -7,6 +7,8 @@ import cn.hutool.core.util.IdUtil;
import com.zdxt.auth.dto.UserBean; import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi; import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.feign.ZdxtFileCommonApi; import com.zdxt.auth.feign.ZdxtFileCommonApi;
import com.zdxt.code.domain.EnterpriseMerchantAuthorization;
import com.zdxt.code.service.IEnterpriseMerchantAuthorizationService;
import com.zdxt.common.util.DateUtils; import com.zdxt.common.util.DateUtils;
import com.zdxt.common.zdxtFile.ZdxtFileCommon; import com.zdxt.common.zdxtFile.ZdxtFileCommon;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +35,9 @@ public class EnterpriseLawEnforcementServiceImpl implements IEnterpriseLawEnforc
@Autowired @Autowired
private UserApi userApi; private UserApi userApi;
@Autowired
private IEnterpriseMerchantAuthorizationService enterpriseMerchantAuthorizationService;
/** /**
* 查询企业端-执法部门预约记录 * 查询企业端-执法部门预约记录
* *
@ -74,6 +79,18 @@ public class EnterpriseLawEnforcementServiceImpl implements IEnterpriseLawEnforc
enterpriseLawEnforcement.setCreateBy(user.getUserName()); enterpriseLawEnforcement.setCreateBy(user.getUserName());
//预约记录,默认正常 //预约记录,默认正常
enterpriseLawEnforcement.setStatus(0); enterpriseLawEnforcement.setStatus(0);
EnterpriseMerchantAuthorization enterpriseMerchantAuthorization =
new EnterpriseMerchantAuthorization();
//联系人手机号码
enterpriseMerchantAuthorization.setMerchantTel(enterpriseLawEnforcement.getLinkTel());
//查询企业信息
List<EnterpriseMerchantAuthorization> enterpriseMerchantAuthorizations =
enterpriseMerchantAuthorizationService.selectEnterpriseMerchantAuthorizationList(enterpriseMerchantAuthorization);
if(enterpriseMerchantAuthorizations.size() > 0){
//设置企业的统一信用代码
enterpriseLawEnforcement.setEnterpriseNumber(
enterpriseMerchantAuthorizations.get(0).getEnterpriseNumber());
}
int i = enterpriseLawEnforcementMapper.insertEnterpriseLawEnforcement(enterpriseLawEnforcement); int i = enterpriseLawEnforcementMapper.insertEnterpriseLawEnforcement(enterpriseLawEnforcement);
return i; return i;
} }

98
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LawEnforcementWarningListServiceImpl.java

@ -0,0 +1,98 @@
package com.zdxt.code.service.impl;
import java.util.List;
import cn.hutool.core.convert.Convert;
import com.zdxt.common.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zdxt.code.mapper.LawEnforcementWarningListMapper;
import com.zdxt.code.domain.LawEnforcementWarningList;
import com.zdxt.code.service.ILawEnforcementWarningListService;
/**
* 执法预警列表Service业务层处理
*
* @author chenrui
* @date 2024-03-22
*/
@Service
public class LawEnforcementWarningListServiceImpl implements ILawEnforcementWarningListService
{
@Autowired
private LawEnforcementWarningListMapper lawEnforcementWarningListMapper;
/**
* 查询执法预警列表
*
* @param id 执法预警列表ID
* @return 执法预警列表
*/
@Override
public LawEnforcementWarningList selectLawEnforcementWarningListById(String id)
{
return lawEnforcementWarningListMapper.selectLawEnforcementWarningListById(id);
}
/**
* 查询执法预警列表列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 执法预警列表
*/
@Override
public List<LawEnforcementWarningList> selectLawEnforcementWarningListList(LawEnforcementWarningList lawEnforcementWarningList)
{
return lawEnforcementWarningListMapper.selectLawEnforcementWarningListList(lawEnforcementWarningList);
}
/**
* 新增执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
@Override
public int insertLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList)
{
lawEnforcementWarningList.setCreateTime(DateUtils.getNowDate());
return lawEnforcementWarningListMapper.insertLawEnforcementWarningList(lawEnforcementWarningList);
}
/**
* 修改执法预警列表
*
* @param lawEnforcementWarningList 执法预警列表
* @return 结果
*/
@Override
public int updateLawEnforcementWarningList(LawEnforcementWarningList lawEnforcementWarningList)
{
lawEnforcementWarningList.setUpdateTime(DateUtils.getNowDate());
return lawEnforcementWarningListMapper.updateLawEnforcementWarningList(lawEnforcementWarningList);
}
/**
* 删除执法预警列表对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteLawEnforcementWarningListByIds(String ids)
{
return lawEnforcementWarningListMapper.deleteLawEnforcementWarningListByIds(Convert.toStrArray(ids));
}
/**
* 删除执法预警列表信息
*
* @param id 执法预警列表ID
* @return 结果
*/
@Override
public int deleteLawEnforcementWarningListById(String id)
{
return lawEnforcementWarningListMapper.deleteLawEnforcementWarningListById(id);
}
}

58
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/YZYApiServiceImpl.java

@ -0,0 +1,58 @@
package com.zdxt.code.service.impl;
import cn.hutool.core.util.IdUtil;
import com.zdxt.code.service.IAccessTokenService;
import com.zdxt.code.service.YZYApiService;
import com.zdxt.code.utils.HttpUtil;
import com.zdxt.code.utils.PasswordTools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
@Service
public class YZYApiServiceImpl implements YZYApiService {
@Autowired
private IAccessTokenService accessTokenService;
//应用ID
private String paasid;
//粤政易 认证信息
// @Value("${yzy.yzyUr}")
private String YZYUrl;
// @Value("${yzy.corpid}")
private String YZYCorpid;
// @Value("${yzy.corpsecret}")
private String YZYCorpsecret;
@Override
public void getUserInfo() {
//随机ID
String nonceId = IdUtil.simpleUUID();
//当前时间戳
long unix = System.currentTimeMillis();
String token = "";
//获取登录令牌
accessTokenService.getYZYToken(null);
String h256Str = unix + token + nonceId + unix;
String s = PasswordTools.SHA256(h256Str);
Map<String,Object> headerParams = new HashMap<>();
headerParams.put("x-tif-paasid",paasid);
headerParams.put("x-tif-signature",s);
headerParams.put("x-tif-timestamp",unix);
//粤政易参数
headerParams.put("x-tif-nonce", nonceId);
try {
HttpUtil.HttpSendPost(YZYUrl + "/ebus/yzyapi/cgi_bin/gettoken?corpid=wl2bee594e73&corpsecret=",null,headerParams,"");
} catch (Exception e) {
e.printStackTrace();
}
}
}

187
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/HttpUtil.java

@ -0,0 +1,187 @@
package com.zdxt.code.utils;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.dto.DictDataBean;
import com.zdxt.common.util.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Slf4j
public class HttpUtil {
public static String getDictName(List<DictDataBean> list, String name){
String value = "";
for(DictDataBean bean : list){
if(name.equals(bean.getDictLabel())){
value = bean.getDictValue();
return value;
}
}
return value;
}
public static String HttpSendPost(String url, Map<String,? extends Object> param,Map<String,? extends Object> headerParams,String accessToken) throws Exception{
HttpPost post = new HttpPost(url);
log.info("url:"+url);
log.info("param:"+ JSONObject.toJSONString(param));
CloseableHttpResponse response=null;
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https",new SSLConnectionSocketFactory(sc))
.build();
PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(registry);
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(manager).build();
if(null != param){
HttpEntity entity = new StringEntity(JSONObject.toJSONString(param),"utf-8");
post.setEntity(entity);
}
RequestConfig config = RequestConfig.custom().
setConnectTimeout(300000).
setSocketTimeout(300000).
build();
post.setConfig(config);
if(StringUtils.isNotEmpty(accessToken)){
post.setHeader("accessToken",accessToken);
}
if(MapUtil.isNotEmpty(headerParams)){
Set<String> strings = headerParams.keySet();
for (Object o : strings) {
System.out.println(o+""+headerParams.get(o));
post.setHeader(o.toString(),headerParams.get(o).toString());
}
}
post.setHeader("Content-Type","application/json");
response = httpClient.execute(post);
return EntityUtils.toString(response.getEntity(),"utf-8");
}
public static String HttpSendGet(String url,String accessToken) throws Exception{
HttpGet httpGet = new HttpGet(url);
CloseableHttpResponse response=null;
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https",new SSLConnectionSocketFactory(sc))
.build();
PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(registry);
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(manager).build();
RequestConfig config = RequestConfig.custom().
setConnectTimeout(300000).
setSocketTimeout(300000).
build();
httpGet.setConfig(config);
httpGet.setHeader("accessToken",accessToken);
httpGet.setHeader("Content-Type","application/json");
response = httpClient.execute(httpGet);
return EntityUtils.toString(response.getEntity(),"utf-8");
}
public static String HttpSendDelete(String url,Map<String,? extends Object> param,String accessToken) throws Exception{
HttpDelete httpDelete = new HttpDelete(url);
CloseableHttpResponse response = null;
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https",new SSLConnectionSocketFactory(sc))
.build();
PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(registry);
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(manager).build();
RequestConfig config = RequestConfig.custom().
setConnectTimeout(3000).
setSocketTimeout(3000).
build();
httpDelete.setConfig(config);
httpDelete.setHeader("accessToken",accessToken);
httpDelete.setHeader("Content-Type","application/json");
response = httpClient.execute(httpDelete);
return EntityUtils.toString(response.getEntity(),"utf-8");
}
public static String HttpSendForm(String url, Map<String,String> param,String accessToken) throws Exception{
HttpPost post = new HttpPost(url);
List<NameValuePair> paramList = new ArrayList<>();
for(String key : param.keySet()){
NameValuePair pair = new BasicNameValuePair(key,param.get(key));
paramList.add(pair);
}
CloseableHttpResponse response=null;
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https",new SSLConnectionSocketFactory(sc))
.build();
PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(registry);
CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(manager).build();
HttpEntity entity = new UrlEncodedFormEntity(paramList,"utf-8");
post.setEntity(entity);
RequestConfig config = RequestConfig.custom().
setConnectTimeout(3000).
setSocketTimeout(3000).
build();
post.setConfig(config);
if(StringUtils.isNotEmpty(accessToken)){
Header header = new BasicHeader("accessToken",accessToken);
post.setHeader(header);
}
response = httpClient.execute(post);
return EntityUtils.toString(response.getEntity(),"utf-8");
}
public static class TrustAnyTrustManager implements X509TrustManager
{
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType)
{
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType)
{
}
@Override
public X509Certificate[] getAcceptedIssuers()
{
return new X509Certificate[] {};
}
}
}

34
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/utils/PasswordTools.java

@ -4,6 +4,8 @@ import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.UUID; import java.util.UUID;
/** /**
@ -48,6 +50,38 @@ public class PasswordTools {
return false; return false;
} }
/**
* 字符串256 加密
* @param str
* @return
*/
public static String SHA256(String str){
try {
// 创建SHA-256哈希算法的MessageDigest对象
MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
// 使用SHA-256计算输入字符串的哈希值
byte[] hash = sha256.digest(str.getBytes("UTF-8"));
// 将字节转换为十六进制字符串
StringBuilder hexString = new StringBuilder();
for (byte b : hash) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex);
}
return hexString.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] args) { public static void main(String[] args) {
String dbPassword = encrypt("88879ayqwt"); String dbPassword = encrypt("88879ayqwt");
System.out.println(decrypt("88879ayqwt",dbPassword)); //true System.out.println(decrypt("88879ayqwt",dbPassword)); //true

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

@ -97,6 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dateSearch != null and dateSearch != ''"> <if test="dateSearch != null and dateSearch != ''">
and DATE_FORMAT(create_time, '%Y-%m') = #{dateSearch} and DATE_FORMAT(create_time, '%Y-%m') = #{dateSearch}
</if> </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(create_time, '%Y-%m') <![CDATA[ >= ]]> #{beginTime}
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(create_time, '%Y-%m') <![CDATA[ <= ]]> #{endTime}
</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
@ -214,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countMentByTime" resultMap="EnforceRegCountResult" <select id="countMentByTime" resultMap="EnforceRegCountResult"
resultType="com.zdxt.code.domain.EnforceRegCount"> resultType="com.zdxt.code.domain.EnforceRegCount">
SELECT law_enforcement, law_enforcement_id, COUNT(law_enforcement_id) AS num SELECT law_enforcement, law_enforcement_id,enterprise_number COUNT(law_enforcement_id) AS num
FROM enforcement_registration FROM enforcement_registration
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL #{timeMonth} MONTH) WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL #{timeMonth} MONTH)
<if test="searchValue != null and searchValue != ''">AND law_enforcement like concat(concat('%',#{searchValue}),'%')</if> <if test="searchValue != null and searchValue != ''">AND law_enforcement like concat(concat('%',#{searchValue}),'%')</if>

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseLawEnforcementMapper.xml

@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" /> <result property="status" column="status" />
<result property="lawEnforcementItem" column="law_enforcement_item" /> <result property="lawEnforcementItem" column="law_enforcement_item" />
<result property="lawEnforcementCode" column="law_enforcement_code" /> <result property="lawEnforcementCode" column="law_enforcement_code" />
<result property="enterpriseNumber" column="enterprise_number" />
</resultMap> </resultMap>
<sql id="selectEnterpriseLawEnforcementVo"> <sql id="selectEnterpriseLawEnforcementVo">
select id, law_enforcement, law_enforcement_id, enterprise_id, enterprise_name, check_time, create_time, create_by, law_enforcer, law_enforcer_id, remark, user_id, dept_id, is_delete, status, law_enforcement_code, link_man, link_tel, check_item, check_require from enterprise_law_enforcement select id, law_enforcement, law_enforcement_id, enterprise_id, enterprise_name, check_time, create_time, create_by, law_enforcer, law_enforcer_id, remark, user_id, dept_id, is_delete, status, law_enforcement_code, link_man, link_tel, check_item, check_require,enterprise_number from enterprise_law_enforcement
</sql> </sql>
<select id="selectEnterpriseLawEnforcementList" parameterType="EnterpriseLawEnforcement" resultMap="EnterpriseLawEnforcementResult"> <select id="selectEnterpriseLawEnforcementList" parameterType="EnterpriseLawEnforcement" resultMap="EnterpriseLawEnforcementResult">
@ -32,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lawEnforcement != null and lawEnforcement != ''"> and law_enforcement = #{lawEnforcement}</if> <if test="lawEnforcement != null and lawEnforcement != ''"> and law_enforcement = #{lawEnforcement}</if>
<if test="lawEnforcementId != null and lawEnforcementId != ''"> and law_enforcement_id = #{lawEnforcementId}</if> <if test="lawEnforcementId != null and lawEnforcementId != ''"> and law_enforcement_id = #{lawEnforcementId}</if>
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if> <if test="enterpriseId != null and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> <if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="checkTime != null "> and check_time = #{checkTime}</if> <if test="checkTime != null "> and check_time = #{checkTime}</if>
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer = #{lawEnforcer}</if> <if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer = #{lawEnforcer}</if>
@ -110,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkTel != null and linkTel != ''">link_tel,</if> <if test="linkTel != null and linkTel != ''">link_tel,</if>
<if test="checkItem != null and checkItem != ''">check_item,</if> <if test="checkItem != null and checkItem != ''">check_item,</if>
<if test="checkRequire != null and checkRequire != ''">check_require,</if> <if test="checkRequire != null and checkRequire != ''">check_require,</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if> <if test="id != null and id != ''">#{id},</if>
@ -132,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="linkTel != null and linkTel != ''">#{linkTel},</if> <if test="linkTel != null and linkTel != ''">#{linkTel},</if>
<if test="checkItem != null and checkItem != ''">#{checkItem},</if> <if test="checkItem != null and checkItem != ''">#{checkItem},</if>
<if test="checkRequire != null and checkRequire != ''">#{checkRequire},</if> <if test="checkRequire != null and checkRequire != ''">#{checkRequire},</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">#{enterpriseNumber},</if>
</trim> </trim>
</insert> </insert>

92
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LawEnforcementWarningListMapper.xml

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zdxt.code.mapper.LawEnforcementWarningListMapper">
<resultMap type="LawEnforcementWarningList" id="LawEnforcementWarningListResult">
<result property="id" column="id" />
<result property="warningTime" column="warning_time" />
<result property="warningCause" column="warning_cause" />
<result property="warningLevel" column="warning_level" />
<result property="createTime" column="create_time" />
<result property="enterpriseName" column="enterprise_name" />
<result property="enterpriseNumber" column="enterprise_number" />
<result property="enforcementNumber" column="enforcement_number" />
</resultMap>
<sql id="selectLawEnforcementWarningListVo">
select id, warning_time, warning_cause, warning_level, create_time, enterprise_name, enterprise_number,enforcement_number from law_enforcement_warning_list
</sql>
<select id="selectLawEnforcementWarningListList" parameterType="LawEnforcementWarningList" resultMap="LawEnforcementWarningListResult">
<include refid="selectLawEnforcementWarningListVo"/>
<where>
<if test="warningTime != null "> and warning_time = #{warningTime}</if>
<if test="warningCause != null and warningCause != ''"> and warning_cause = #{warningCause}</if>
<if test="warningLevel != null "> and warning_level = #{warningLevel}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<if test="searchValue != null and searchValue != ''"> and (
enterprise_name like concat('%',#{searchValue},'%')
)</if>
<if test="searchDate != null and searchDate != ''">
and DATE_FORMAT(warning_time, '%Y-%m') = #{searchDate}
</if>
</where>
</select>
<select id="selectLawEnforcementWarningListById" parameterType="String" resultMap="LawEnforcementWarningListResult">
<include refid="selectLawEnforcementWarningListVo"/>
where id = #{id}
</select>
<insert id="insertLawEnforcementWarningList" parameterType="LawEnforcementWarningList">
insert into law_enforcement_warning_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="warningTime != null ">warning_time,</if>
<if test="warningCause != null and warningCause != ''">warning_cause,</if>
<if test="warningLevel != null ">warning_level,</if>
<if test="createTime != null ">create_time,</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number,</if>
<if test="enforcementNumber != null and enforcementNumber != ''">enforcement_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="warningTime != null ">#{warningTime},</if>
<if test="warningCause != null and warningCause != ''">#{warningCause},</if>
<if test="warningLevel != null ">#{warningLevel},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">#{enterpriseNumber},</if>
<if test="enforcementNumber != null and enforcementNumber != ''">#{enforcementNumber},</if>
</trim>
</insert>
<update id="updateLawEnforcementWarningList" parameterType="LawEnforcementWarningList">
update law_enforcement_warning_list
<trim prefix="SET" suffixOverrides=",">
<if test="warningTime != null ">warning_time = #{warningTime},</if>
<if test="warningCause != null and warningCause != ''">warning_cause = #{warningCause},</if>
<if test="warningLevel != null ">warning_level = #{warningLevel},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number = #{enterpriseNumber},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteLawEnforcementWarningListById" parameterType="String">
delete from law_enforcement_warning_list where id = #{id}
</delete>
<delete id="deleteLawEnforcementWarningListByIds" parameterType="String">
delete from law_enforcement_warning_list where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save