Commit e2735d86 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 30562b33 c87b1f79
......@@ -518,8 +518,10 @@
<select id="selectMtByAlertId" resultType="java.util.Map">
SELECT
SEQUENCE_NBR AS sequenceNbr,
ME_MASTER AS userName,
EMERGENCYCALL AS phone,
ME_MASTER AS userName1,
ME_MASTER_PHONE AS phone1,
ME_MASTER1 AS userName2,
ME_MASTER1_PHONE AS phone2,
'' AS address,
ME_UNIT_NAME AS unitName,
ME_UNIT_CREDIT_CODE AS useCode
......
......@@ -402,15 +402,15 @@ public class MaintenanceUnitController extends BaseController {
List<DutyPersonDto> dutyPersonList = new ArrayList<DutyPersonDto>();
DutyPersonDto principal = new DutyPersonDto();
principal.setDeptName("主要负责人1");
principal.setPhone(ObjectUtils.isEmpty(list.get(0).get("phone")) ? null : String.valueOf(list.get(0).get("phone")));
principal.setPhone(ObjectUtils.isEmpty(list.get(0).get("phone1")) ? null : String.valueOf(list.get(0).get("phone1")));
principal.setUserId(null);
principal.setUserName(ObjectUtils.isEmpty(list.get(0).get("userName")) ? null : String.valueOf(list.get(0).get("userName")));
principal.setUserName(ObjectUtils.isEmpty(list.get(0).get("userName1")) ? null : String.valueOf(list.get(0).get("userName1")));
dutyPersonList.add(principal);
DutyPersonDto manager = new DutyPersonDto();
manager.setDeptName("主要负责人2");
manager.setPhone(list.size() == 2 ? String.valueOf(list.get(0).get("phone")) : null);
manager.setPhone(ObjectUtils.isEmpty(list.get(0).get("phone2")) ? null : String.valueOf(list.get(0).get("phone2")));
manager.setUserId(null);
manager.setUserName(list.size() == 2 ? String.valueOf(list.get(0).get("userName")) : null);
manager.setUserName(ObjectUtils.isEmpty(list.get(0).get("userName2")) ? null : String.valueOf(list.get(0).get("userName2")));
dutyPersonList.add(manager);
maintenanceUnitVo.setDutyPersonList(dutyPersonList);
......
......@@ -8,6 +8,8 @@ import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.IPdfService;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,119 +20,120 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.stream.Collectors;
/**
* 装备分类
* 监管公共Api
*
* @author system_generator
* @date 2021-10-20
*/
@RestController
@Api(tags = "装备分类Api")
@Api(tags = "监管公共Api")
@RequestMapping(value = "/common")
public class CommonController extends BaseController {
@Autowired
ICommonService commonService;
@Autowired
IPdfService pdfService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getChildren")
@ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别")
public ResponseModel<List<EquipmentCategory>> getChildren(@RequestParam(value = "code") String code,
@RequestParam(value = "type", required = false) String type) {
return ResponseHelper.buildResponse(commonService.getEquipmentCategoryList(code, type));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getRegion")
@ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划")
public ResponseModel<Object> getRegion(@RequestParam(value = "level", required = false) String level,
@RequestParam(value = "parentId", required = false) String parentId) {
return ResponseHelper.buildResponse(commonService.getRegion(level, parentId));
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(commonService.getTree(getSelectedOrgInfo()));
}
/**
* 工作台接收机构树
* @param bizType 业务类型:notice-告知类, register-登记类
* @return 树
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{bizType}/receive-unit/tree")
@ApiOperation(httpMethod = "GET", value = "接收机构树", notes = "接收机构树")
public ResponseModel<Object> getNoticeReceiveTree(@PathVariable String bizType) {
return ResponseHelper.buildResponse(commonService.getReceiveUnitTree(bizType));
}
/**
* 获取行政审批局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getApproveTree")
@ApiOperation(httpMethod = "GET", value = "获取行政审批局树", notes = "获取行政审批局树")
public ResponseModel<Object> getApproveTree() {
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(commonService.getApproveTree(reginParams));
}
/**
* 通过单位类型获取单位列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUnitList")
@ApiOperation(httpMethod = "GET", value = "通过单位类型获取单位列表", notes = "通过单位类型获取单位列表")
public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(commonService.getUnitListByType(type));
}
/**
* 查找当前公司下所属的安全管理员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getSecurityAdmin")
@ApiOperation(httpMethod = "GET", value = "查找当前公司下所属的安全管理员", notes = "查找当前公司下所属的安全管理员")
public ResponseModel<List<Map<String, Object>>> getSecurityAdmin(@RequestParam(value = "type") String type,
@RequestParam(value = "useUnitCode",required = false)String useUnitCode) {
return ResponseHelper.buildResponse(commonService.getSecurityAdmin(type,useUnitCode));
}
/**
* 查询安全管理员的基本信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserPhone")
@ApiOperation(httpMethod = "GET", value = "查询用户对应联系方式", notes = "查询用户对应联系方式")
public ResponseModel<Map<String,Object>> getUserInfo(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(commonService.getUserInfo(sequenceNbr));
}
@Autowired
ICommonService commonService;
@Autowired
IPdfService pdfService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getChildren")
@ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别")
public ResponseModel<List<EquipmentCategory>> getChildren(@RequestParam(value = "code") String code,
@RequestParam(value = "type", required = false) String type) {
return ResponseHelper.buildResponse(commonService.getEquipmentCategoryList(code, type));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getRegion")
@ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划")
public ResponseModel<Object> getRegion(@RequestParam(value = "level", required = false) String level,
@RequestParam(value = "parentId", required = false) String parentId) {
return ResponseHelper.buildResponse(commonService.getRegion(level, parentId));
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(commonService.getTree(getSelectedOrgInfo()));
}
/**
* 工作台接收机构树
*
* @param bizType 业务类型:notice-告知类, register-登记类
* @return 树
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{bizType}/receive-unit/tree")
@ApiOperation(httpMethod = "GET", value = "接收机构树", notes = "接收机构树")
public ResponseModel<Object> getNoticeReceiveTree(@PathVariable String bizType) {
return ResponseHelper.buildResponse(commonService.getReceiveUnitTree(bizType));
}
/**
* 获取行政审批局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getApproveTree")
@ApiOperation(httpMethod = "GET", value = "获取行政审批局树", notes = "获取行政审批局树")
public ResponseModel<Object> getApproveTree() {
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(commonService.getApproveTree(reginParams));
}
/**
* 通过单位类型获取单位列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUnitList")
@ApiOperation(httpMethod = "GET", value = "通过单位类型获取单位列表", notes = "通过单位类型获取单位列表")
public ResponseModel<List<Map<String, Object>>> getUnitList(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(commonService.getUnitListByType(type));
}
/**
* 查找当前公司下所属的安全管理员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getSecurityAdmin")
@ApiOperation(httpMethod = "GET", value = "查找当前公司下所属的安全管理员", notes = "查找当前公司下所属的安全管理员")
public ResponseModel<List<Map<String, Object>>> getSecurityAdmin(@RequestParam(value = "type") String type,
@RequestParam(value = "useUnitCode", required = false) String useUnitCode) {
return ResponseHelper.buildResponse(commonService.getSecurityAdmin(type, useUnitCode));
}
/**
* 查询安全管理员的基本信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserPhone")
@ApiOperation(httpMethod = "GET", value = "查询用户对应联系方式", notes = "查询用户对应联系方式")
public ResponseModel<Map<String, Object>> getUserInfo(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(commonService.getUserInfo(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserInfoSplit")
@ApiOperation(httpMethod = "GET", value = "查询安全管理员的基本信息", notes = "查询安全管理员的基本信息")
......@@ -140,188 +143,211 @@ public class CommonController extends BaseController {
}
return ResponseHelper.buildResponse(commonService.getUserInfo(sequenceNbr));
}
/**
* 查询企业的基本信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEnterpriseInfo")
@ApiOperation(httpMethod = "GET", value = "查询企业的基本信息", notes = "查询企业的基本信息")
public ResponseModel<Map<String,Object>> getEnterpriseInfo(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(commonService.getEnterpriseInfo(sequenceNbr));
}
/**
* 查询企业的下面的人员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEnterpriseEmployee")
@ApiOperation(httpMethod = "GET", value = "查询企业的下面的人员", notes = "查询企业的下面的人员")
public ResponseModel<List<Map<String,Object>>> getEnterpriseEmployee(@RequestParam String unitCode) {
String companyCode = unitCode.split("_")[0];
return ResponseHelper.buildResponse(commonService.getEnterpriseEmployee(companyCode));
}
@TycloudOperation (ApiLevel = UserType.AGENCY)
@ApiOperation (httpMethod = "GET", value = "流程状态枚举列表", notes = "流程状态枚举列表")
@GetMapping (value = "/flow-status/list")
public ResponseModel<List<Map<String, Object>>> selectForFlowStatusList() {
return ResponseHelper.buildResponse(Arrays.stream(FlowStatusEnum.values()).map(this::mapPointTypeToMap).filter(Objects::nonNull).collect(Collectors.toList()));
}
private Map<String, Object> mapPointTypeToMap(FlowStatusEnum e) {
if (FlowStatusEnum.TO_SUBMITTED.getCode() == e.getCode() || FlowStatusEnum.TO_BE_DISCARD.getCode() == e.getCode()) {
return null;
}
Map<String, Object> record = new HashMap<>();
record.put("key", e.getCode());
record.put("label", e.getName());
return record;
}
/**
* 查询监管业务名称列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询监管业务名称列表", notes = "查询监管业务名称列表")
@GetMapping(value = "/superviseBusinessCategory")
public ResponseModel<Object> equipTree(String type) {
return ResponseHelper.buildResponse(commonService.superviseBusinessCategory(type));
}
@Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService;
/**
* 业务发起公共接口
* /jg/jg-installation-notice/save
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrSubmit")
@ApiOperation(httpMethod = "POST", value = "业务发起公共接口", notes = "业务发起公共接口")
public ResponseModel<Object> save(@RequestParam(value = "submitType", required = false) String submitType,
@RequestBody Map<String, Object> map) {
ReginParams reginParams = getSelectedOrgInfo();
Object result = commonService.invokeBusinessProcess(submitType, map, reginParams);
return ResponseHelper.buildResponse(result);
}
/**
* 根据公司id获取公司下人员
*
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyUser")
@ApiOperation(httpMethod = "get", value = "根据公司id获取公司下人员", notes = "根据公司id获取公司下人员")
public ResponseModel<Object> getCompanyUser(@RequestParam(value = "companyId",required = false) Long companyId) {
if(ObjectUtils.isEmpty(companyId)){
return null;
}
Object result = commonService.getCompanyUser(companyId);
return ResponseHelper.buildResponse(result);
}
/**
* 获取当前登录人企业类型
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyType")
@ApiOperation(httpMethod = "GET", value = "获取当前登录人企业类型", notes = "获取当前登录人企业类型")
public ResponseModel<Object> getCompanyType() {
return ResponseHelper.buildResponse(iJgInstallationNoticeService.getCompanyType());
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCreatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> getCreatTree() {
return ResponseHelper.buildResponse(commonService.getCreatTree());
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCreatTreeByInstallation")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树安装告知使用", notes = "获取管辖分局树安装告知使用")
public ResponseModel<Object> getCreatTreeByInstallation(String county) {
List<LinkedHashMap> creatTree = commonService.getCreatTreeByInstallation();
String code = county.split("_")[0];
List<LinkedHashMap> infoByCounty = getInfoByCounty(code, creatTree);
return ResponseHelper.buildResponse(infoByCounty);
}
private List<LinkedHashMap> getInfoByCounty(String county, List<LinkedHashMap> children) {
for (LinkedHashMap item : children) {
if (item.get("companyCode").toString().equals(county)) {
return (List<LinkedHashMap>) item.get("children");
} else {
if (!ObjectUtils.isEmpty(item.get("children"))) {
List<LinkedHashMap> children1 = getInfoByCounty(county, (List<LinkedHashMap>) item.get("children"));
if (!CollectionUtils.isEmpty(children1)) {
return children1;
}
}
}
}
return new ArrayList<>();
}
/**
* 公共转办接口
* /jg/common/transfer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/transfer")
@ApiOperation(httpMethod = "POST", value = "公共转办接口", notes = "公共转办接口")
public ResponseModel<Object> transfer(@RequestBody Map<String, Object> map) {
Object result = commonService.transfer(map);
return ResponseHelper.buildResponse(result);
}
/**
* 校验EQUCODE的唯一性
* @param equCode EQUCODE
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/checkUniquenessOfEQUCODE")
@ApiOperation(httpMethod = "GET", value = "校验EQUCODE的唯一性", notes = "校验EQUCODE的唯一性")
public ResponseModel<Object> checkUniquenessOfEQUCODE(String equCode) {
Boolean bool = commonService.checkUniquenessOfEQUCODE(equCode);
return ResponseHelper.buildResponse(bool);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/test-file")
@ApiOperation(httpMethod = "GET", value = "文件测试", notes = "文件测试")
public ResponseModel<String> testFile() {
return ResponseHelper.buildResponse(pdfService.signToPdf("upload/tzs/pdf/1708911268708_temp.pdf", "已作废"));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/water-print")
@ApiOperation(httpMethod = "GET", value = "文件测试", notes = "文件测试")
public ResponseModel<String> signToPdfWaterPrint() {
return ResponseHelper.buildResponse(pdfService.signToPdfWaterPrint("upload/tzs/pdf/1708911268708_temp.pdf", "已作废"));
}
/**
* 查询企业的基本信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEnterpriseInfo")
@ApiOperation(httpMethod = "GET", value = "查询企业的基本信息", notes = "查询企业的基本信息")
public ResponseModel<Map<String, Object>> getEnterpriseInfo(@RequestParam(value = "sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(commonService.getEnterpriseInfo(sequenceNbr));
}
/**
* 查询企业的下面的人员
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getEnterpriseEmployee")
@ApiOperation(httpMethod = "GET", value = "查询企业的下面的人员", notes = "查询企业的下面的人员")
public ResponseModel<List<Map<String, Object>>> getEnterpriseEmployee(@RequestParam String unitCode) {
String companyCode = unitCode.split("_")[0];
return ResponseHelper.buildResponse(commonService.getEnterpriseEmployee(companyCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "流程状态枚举列表", notes = "流程状态枚举列表")
@GetMapping(value = "/flow-status/list")
public ResponseModel<List<Map<String, Object>>> selectForFlowStatusList() {
return ResponseHelper.buildResponse(Arrays.stream(FlowStatusEnum.values()).map(this::mapPointTypeToMap).filter(Objects::nonNull).collect(Collectors.toList()));
}
private Map<String, Object> mapPointTypeToMap(FlowStatusEnum e) {
if (FlowStatusEnum.TO_SUBMITTED.getCode() == e.getCode() || FlowStatusEnum.TO_BE_DISCARD.getCode() == e.getCode()) {
return null;
}
Map<String, Object> record = new HashMap<>();
record.put("key", e.getCode());
record.put("label", e.getName());
return record;
}
/**
* 查询监管业务名称列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询监管业务名称列表", notes = "查询监管业务名称列表")
@GetMapping(value = "/superviseBusinessCategory")
public ResponseModel<Object> equipTree(String type) {
return ResponseHelper.buildResponse(commonService.superviseBusinessCategory(type));
}
@Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService;
/**
* 业务发起公共接口
* /jg/jg-installation-notice/save
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveOrSubmit")
@ApiOperation(httpMethod = "POST", value = "业务发起公共接口", notes = "业务发起公共接口")
public ResponseModel<Object> save(@RequestParam(value = "submitType", required = false) String submitType,
@RequestBody Map<String, Object> map) {
ReginParams reginParams = getSelectedOrgInfo();
Object result = commonService.invokeBusinessProcess(submitType, map, reginParams);
return ResponseHelper.buildResponse(result);
}
/**
* 根据公司id获取公司下人员
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyUser")
@ApiOperation(httpMethod = "get", value = "根据公司id获取公司下人员", notes = "根据公司id获取公司下人员")
public ResponseModel<Object> getCompanyUser(@RequestParam(value = "companyId", required = false) Long companyId) {
if (ObjectUtils.isEmpty(companyId)) {
return null;
}
Object result = commonService.getCompanyUser(companyId);
return ResponseHelper.buildResponse(result);
}
/**
* 获取当前登录人企业类型
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyType")
@ApiOperation(httpMethod = "GET", value = "获取当前登录人企业类型", notes = "获取当前登录人企业类型")
public ResponseModel<Object> getCompanyType() {
return ResponseHelper.buildResponse(iJgInstallationNoticeService.getCompanyType());
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCreatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> getCreatTree() {
return ResponseHelper.buildResponse(commonService.getCreatTree());
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCreatTreeByInstallation")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树安装告知使用", notes = "获取管辖分局树安装告知使用")
public ResponseModel<Object> getCreatTreeByInstallation(String county) {
List<LinkedHashMap> creatTree = commonService.getCreatTreeByInstallation();
String code = county.split("_")[0];
List<LinkedHashMap> infoByCounty = getInfoByCounty(code, creatTree);
return ResponseHelper.buildResponse(infoByCounty);
}
private List<LinkedHashMap> getInfoByCounty(String county, List<LinkedHashMap> children) {
for (LinkedHashMap item : children) {
if (item.get("companyCode").toString().equals(county)) {
return (List<LinkedHashMap>) item.get("children");
} else {
if (!ObjectUtils.isEmpty(item.get("children"))) {
List<LinkedHashMap> children1 = getInfoByCounty(county, (List<LinkedHashMap>) item.get("children"));
if (!CollectionUtils.isEmpty(children1)) {
return children1;
}
}
}
}
return new ArrayList<>();
}
/**
* 公共转办接口
* /jg/common/transfer
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/transfer")
@ApiOperation(httpMethod = "POST", value = "公共转办接口", notes = "公共转办接口")
public ResponseModel<Object> transfer(@RequestBody Map<String, Object> map) {
Object result = commonService.transfer(map);
return ResponseHelper.buildResponse(result);
}
/**
* 校验EQUCODE的唯一性
*
* @param equCode EQUCODE
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/checkUniquenessOfEQUCODE")
@ApiOperation(httpMethod = "GET", value = "校验EQUCODE的唯一性", notes = "校验EQUCODE的唯一性")
public ResponseModel<Object> checkUniquenessOfEQUCODE(String equCode) {
Boolean bool = commonService.checkUniquenessOfEQUCODE(equCode);
return ResponseHelper.buildResponse(bool);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/test-file")
@ApiOperation(httpMethod = "GET", value = "文件测试", notes = "文件测试")
public ResponseModel<String> testFile() {
return ResponseHelper.buildResponse(pdfService.signToPdf("upload/tzs/pdf/1708911268708_temp.pdf", "已作废"));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/water-print")
@ApiOperation(httpMethod = "GET", value = "文件测试", notes = "文件测试")
public ResponseModel<String> signToPdfWaterPrint() {
return ResponseHelper.buildResponse(pdfService.signToPdfWaterPrint("upload/tzs/pdf/1708911268708_temp.pdf", "已作废"));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equList")
@ApiOperation(httpMethod = "GET", value = "按照业务类型查询设备种类,工作台使用", notes = "按照业务类型查询设备种类,工作台使用")
public ResponseModel<List<DictionarieValueModel>> equList(@RequestParam(value = "type") String bizType) {
// 在平台字典配置的自定义业务的设备种类:格式{bizType}_SBZL,如BF_YZ_SBZL==》移装注销-设备种类
String suffix = "_SBZL";
String dictCode = bizType + suffix;
return ResponseHelper.buildResponse(Systemctl.dictionarieClient.dictValues(dictCode).getResult());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equ-category/{categoryCode}/list")
@ApiOperation(httpMethod = "GET", value = "按照业务类型、设备种类查询设备类别", notes = "按照业务类型、设备种类查询设备类别")
public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "type") String bizType,
@PathVariable String categoryCode) {
// 在平台字典配置的自定义业务的设备种类:格式{bizType}_{categoryCode},如BF_YZ_1000==》移装注销-锅炉
String dictCode = String.format("%s_%s", bizType, categoryCode);
return ResponseHelper.buildResponse(Systemctl.dictionarieClient.dictValues(dictCode).getResult());
}
}
......@@ -1090,6 +1090,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
boolMust.must(elBuilder);
}
// 设备类别
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY_CODE"))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("EQU_CATEGORY_CODE"));
pBuilder.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE",test));
boolMust.must(pBuilder);
}
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
......
......@@ -146,7 +146,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Value("classpath:/json/urlInfo.json")
public Resource bizTypeInfo;
@Value("${tzs.domain}")
@Value("${tzs.domain:http://sxtzsb.sxsei.com}")
String TZSDOMAIN ;
@Autowired
......
......@@ -513,32 +513,24 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
*/
private void updateEquipMessage(Long id) {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id);
ArrayList<String[]> maintenanceManager = new ArrayList<>();
maintenanceManager.add(new String[]{jgMaintenanceContract.getMaintenanceManagerOneName(), jgMaintenanceContract.getMaintenanceManagerOnePhone()});
maintenanceManager.add(new String[]{jgMaintenanceContract.getMaintenanceManagerTwoName(), jgMaintenanceContract.getMaintenanceManagerTwoPhone()});
LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda();
lambda.eq(JgMaintenanceContractEq::getEquipTransferId, id);
List<JgMaintenanceContractEq> list = jgMaintenanceContractEqService.getBaseMapper().selectList(lambda);
ArrayList<IdxBizJgMaintenanceRecordInfo> data = new ArrayList<>();
// 循环设备
list.forEach(item -> {
// 循环添加两条维保备案信息表数据,存储两个维保负责人
for (int i = 0; i < 2; i++) {
IdxBizJgMaintenanceRecordInfo info = new IdxBizJgMaintenanceRecordInfo();
info.setRecord(item.getEquId());
info.setMeUnitName(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitName()) ? null : jgMaintenanceContract.getMaintenanceUnitName());
info.setMeUnitCreditCode(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitCode()) ? null : jgMaintenanceContract.getMaintenanceUnitCode());
String[] manager = maintenanceManager.get(i);
info.setMeMaster(ObjectUtils.isEmpty(manager[0]) ? null : manager[0]);
info.setEmergencycall(ObjectUtils.isEmpty(manager[1]) ? null : manager[1]);
info.setInformStart(ObjectUtils.isEmpty(jgMaintenanceContract.getInformStart()) ? null : jgMaintenanceContract.getInformStart());
info.setInformEnd(ObjectUtils.isEmpty(jgMaintenanceContract.getInformEnd()) ? null : jgMaintenanceContract.getInformEnd());
info.setRepairInform(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceContract()) ? null : jgMaintenanceContract.getMaintenanceContract());
data.add(info);
}
IdxBizJgMaintenanceRecordInfo info = new IdxBizJgMaintenanceRecordInfo();
info.setRecord(item.getEquId());
info.setMeUnitName(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitName()) ? null : jgMaintenanceContract.getMaintenanceUnitName());
info.setMeUnitCreditCode(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceUnitCode()) ? null : jgMaintenanceContract.getMaintenanceUnitCode());
info.setMeMaster(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerOneName()) ? null : jgMaintenanceContract.getMaintenanceManagerOneName());
info.setMeMasterPhone(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerOnePhone()) ? null : jgMaintenanceContract.getMaintenanceManagerOnePhone());
info.setMeMaster1(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerTwoName()) ? null : jgMaintenanceContract.getMaintenanceManagerTwoName());
info.setMeMaster1Phone(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceManagerTwoPhone()) ? null : jgMaintenanceContract.getMaintenanceManagerTwoPhone());
info.setInformStart(ObjectUtils.isEmpty(jgMaintenanceContract.getInformStart()) ? null : jgMaintenanceContract.getInformStart());
info.setInformEnd(ObjectUtils.isEmpty(jgMaintenanceContract.getInformEnd()) ? null : jgMaintenanceContract.getInformEnd());
info.setRepairInform(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceContract()) ? null : jgMaintenanceContract.getMaintenanceContract());
data.add(info);
});
idxBizJgMaintenanceRecordInfoService.saveBatch(data);
}
......
......@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
......@@ -74,18 +74,41 @@ public class IdxBizJgMaintenanceRecordInfo extends TzsBaseEntity {
private Date informEnd;
/**
*
*维保负责人1姓名
*/
@TableField("\"ME_MASTER\"")
private String meMaster;
/**
*
*维保负责人2姓名
*/
@TableField("\"ME_MASTER1\"")
private String meMaster1;
/**
*维保负责人1身份证
*/
@TableField("\"ME_MASTER_ID\"")
private String meMasterId;
/**
*维保负责人2身份证
*/
@TableField("\"ME_MASTER1_ID\"")
private String meMaster1Id;
/**
*维保负责人2电话
*/
@TableField("\"ME_MASTER1_PHONE\"")
private String meMaster1Phone;
/**
*维保负责人1电话
*/
@TableField("\"ME_MASTER_PHONE\"")
private String meMasterPhone;
/**
*
*/
@TableField("\"EMERGENCYCALL\"")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment