Commit e0dcc9ed authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715 # Conflicts: # amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/DPSubServiceImpl.java
parents 661d1d11 6ff47bb4
...@@ -166,6 +166,9 @@ public class JgReformNoticeDto extends BaseDto { ...@@ -166,6 +166,9 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty(value = "设备类别名称") @ApiModelProperty(value = "设备类别名称")
private String equCategoryName; private String equCategoryName;
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
/* ---------------- -------------- */ /* ---------------- -------------- */
@ApiModelProperty (value = "告知设备列表") @ApiModelProperty (value = "告知设备列表")
......
...@@ -360,4 +360,10 @@ public class JgMaintainNotice extends BaseEntity { ...@@ -360,4 +360,10 @@ public class JgMaintainNotice extends BaseEntity {
*/ */
@TableField("receive_company_org_code") @TableField("receive_company_org_code")
private String receiveCompanyOrgCode; private String receiveCompanyOrgCode;
/**
* 工程装置
*/
@TableField("project_contraption")
private String projectContraption;
} }
...@@ -177,6 +177,12 @@ public class JgReformNotice extends BaseEntity { ...@@ -177,6 +177,12 @@ public class JgReformNotice extends BaseEntity {
private String constructionManagerId; private String constructionManagerId;
/** /**
* 工程装置名称
*/
@TableField("project_contraption")
private String projectContraption;
/**
* 施工负责人手机 * 施工负责人手机
*/ */
@TableField("construction_manager_phone") @TableField("construction_manager_phone")
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
......
...@@ -33,7 +33,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> { ...@@ -33,7 +33,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> {
* @param noticeDto 维修告知 * @param noticeDto 维修告知
* @param op 操作类型 * @param op 操作类型
*/ */
JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op); JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op, ReginParams reginParams);
/** /**
* 分页查询 * 分页查询
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
tjtn.create_user_id as createUserId, tjtn.create_user_id as createUserId,
tjtn.next_execute_user_ids as nextExecuteUserIds, tjtn.next_execute_user_ids as nextExecuteUserIds,
tjtn.next_task_id AS nextTaskId, tjtn.next_task_id AS nextTaskId,
tjtn.equ_category AS equCategory,
tjtn.equ_list AS equList,
DATE_FORMAT(tjtn.notice_date,'%Y-%m-%d') AS noticeDate, DATE_FORMAT(tjtn.notice_date,'%Y-%m-%d') AS noticeDate,
DATE_FORMAT(tjtn.handle_date,'%Y-%m-%d') AS handleDate, DATE_FORMAT(tjtn.handle_date,'%Y-%m-%d') AS handleDate,
DATE_FORMAT(tjtn.plan_date,'%Y-%m-%d') AS planDate DATE_FORMAT(tjtn.plan_date,'%Y-%m-%d') AS planDate
...@@ -125,7 +127,7 @@ ...@@ -125,7 +127,7 @@
tjtn.plan_date AS installStartDate, tjtn.plan_date AS installStartDate,
tjtn.construction_manager AS installLeaderName, tjtn.construction_manager AS installLeaderName,
tjtn.construction_manager_phone AS installLeaderPhone, tjtn.construction_manager_phone AS installLeaderPhone,
tjtn.inform_number AS informNumber, re.inform_number AS informNumber,
re.equ_id as equId, re.equ_id as equId,
ri.EQU_CODE AS equRegisterCode, ri.EQU_CODE AS equRegisterCode,
ri.PRODUCT_NAME AS productName, ri.PRODUCT_NAME AS productName,
...@@ -176,7 +178,6 @@ ...@@ -176,7 +178,6 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
WHERE WHERE
tjtn.sequence_nbr = #{sequenceNbr} tjtn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select> </select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"> <select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select select
......
...@@ -11,7 +11,6 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService; ...@@ -11,7 +11,6 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import jdk.nashorn.api.scripting.JSObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -70,7 +69,8 @@ public class JgMaintainNoticeController extends BaseController { ...@@ -70,7 +69,8 @@ public class JgMaintainNoticeController extends BaseController {
Object o1 = ((LinkedHashMap<?, ?>) model.get(TABLE_PAGE_ID)).get("powerOfAttorneyList"); Object o1 = ((LinkedHashMap<?, ?>) model.get(TABLE_PAGE_ID)).get("powerOfAttorneyList");
maintainInfo.setConstructionContractList((List<Map<String, Object>>) o); maintainInfo.setConstructionContractList((List<Map<String, Object>>) o);
maintainInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1); maintainInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1);
return ResponseHelper.buildResponse(iJgMaintainNoticeService.updateMaintainNotice(submitType, maintainInfo, op)); ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iJgMaintainNoticeService.updateMaintainNotice(submitType, maintainInfo, op,reginParams));
} }
/** /**
......
...@@ -158,6 +158,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -158,6 +158,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
public static final String DATA_SOURCE_NAME = "DATA_SOURCE_NAME"; public static final String DATA_SOURCE_NAME = "DATA_SOURCE_NAME";
private static final String ATTACHMENT_UPLOAD = "attachmentUpload"; private static final String ATTACHMENT_UPLOAD = "attachmentUpload";
public static final String USE_PLACE_CODE = "USE_PLACE_CODE"; public static final String USE_PLACE_CODE = "USE_PLACE_CODE";
public static final String EQU_CATEGORY_CODE = "EQU_CATEGORY_CODE";
public static final String PROJECT_CONTRAPTION = "PROJECT_CONTRAPTION";// 工程装置名称
private final List<String> resultError = new ArrayList<>(); private final List<String> resultError = new ArrayList<>();
List<String> useInnerCodeList = new ArrayList<>();// 单位内部编号集合 List<String> useInnerCodeList = new ArrayList<>();// 单位内部编号集合
...@@ -1373,6 +1375,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1373,6 +1375,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice"); this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice");
// 安装告知设备选择 - 业务限制 // 安装告知设备选择 - 业务限制
// 根据设备类别(EQU_CATEGORY)、安装单位过滤设备(USC_UNIT_CREDIT_CODE) 下面过滤条件已有 // 根据设备类别(EQU_CATEGORY)、安装单位过滤设备(USC_UNIT_CREDIT_CODE) 下面过滤条件已有
// 设备类别为工业管道(8300)时,用工程装置名称过滤
if (!ValidationUtil.isEmpty(EQU_CATEGORY_CODE) && ValidationUtil.equals(EQU_CATEGORY_CODE, "8300")) {
if (ValidationUtil.isEmpty(map.get("projectContraption"))) {
throw new BadRequest("请先选择工程装置信息!");
}
map.put(PROJECT_CONTRAPTION, String.valueOf(map.get("projectContraption")));
}
} else if (ValidationUtil.equals(queryType, "WB")) {// 维保 } else if (ValidationUtil.equals(queryType, "WB")) {// 维保
// 查询 维保备案【可绑定设备列表】【(EQU_STATE=== null || "")】 // 查询 维保备案【可绑定设备列表】【(EQU_STATE=== null || "")】
BoolQueryBuilder wbBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder wbBuilder = QueryBuilders.boolQuery();
...@@ -1384,7 +1393,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1384,7 +1393,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE")); syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*")); syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder); boolMust.must(syBuilder);
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegister"); this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
} else if (ValidationUtil.equals(queryType, "FINISH_SY")) { } else if (ValidationUtil.equals(queryType, "FINISH_SY")) {
// 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备 // 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备
// 查询 已经做过【使用登记】 的设备 【(EQU_STATUS != 空 ) && (USE_ORG_CODE(使用登记证编号) != 空)】 // 查询 已经做过【使用登记】 的设备 【(EQU_STATUS != 空 ) && (USE_ORG_CODE(使用登记证编号) != 空)】
...@@ -1397,28 +1406,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1397,28 +1406,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
syBuilder.must(QueryBuilders.existsQuery("EQU_STATE")); syBuilder.must(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*")); syBuilder.must(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder); boolMust.must(syBuilder);
// 设备类别为工业管道(8300)时,用工程装置名称过滤
if (!ValidationUtil.isEmpty(EQU_CATEGORY_CODE) && ValidationUtil.equals(EQU_CATEGORY_CODE, "8300")) {
if (ValidationUtil.isEmpty(map.get("projectContraption"))) {
throw new BadRequest("请先选择工程装置信息!");
}
map.put(PROJECT_CONTRAPTION, String.valueOf(map.get("projectContraption")));
}
if (ValidationUtil.equals(queryType, "GZ_GZ")) {// 改造告知设备选择 - 业务限制 if (ValidationUtil.equals(queryType, "GZ_GZ")) {// 改造告知设备选择 - 业务限制
// 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、选择的区县(USE_PLACE_CODE)过滤数据 // 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、选择的区县(USE_PLACE_CODE)过滤数据
if (ValidationUtil.isEmpty(map.get("useUnitCreditCode")) || ValidationUtil.isEmpty(map.get("county"))) { if (ValidationUtil.isEmpty(map.get("useUnitCreditCode")) || ValidationUtil.isEmpty(map.get("county"))) {
throw new BadRequest("请先选择使用单位,施工区县等信息"); throw new BadRequest("请先选择使用单位,施工区县等信息");
} }
map.put("USE_UNIT_CREDIT_CODE", String.valueOf(map.get("useUnitCreditCode")).split("_")[0]); map.put("USE_UNIT_CREDIT_CODE", String.valueOf(map.get("useUnitCreditCode")).split("_")[0]);
map.put(USE_PLACE_CODE, String.valueOf(map.get("county")).split("_")[0]); map.put(USE_PLACE_CODE, String.valueOf(map.get("county")).split("_")[0]);
} else if (ValidationUtil.equals(queryType, "GZ_WX")) {// 维修告知设备选择 - 业务限制 } else if (ValidationUtil.equals(queryType, "GZ_WX")) {// 维修告知设备选择 - 业务限制
// 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、选择的区县(USE_PLACE_CODE)过滤数据 // 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、选择的区县(USE_PLACE_CODE)过滤数据
if (ValidationUtil.isEmpty(map.get("useUnitCreditCode")) || ValidationUtil.isEmpty(map.get("county"))) { if (ValidationUtil.isEmpty(map.get("useUnitCreditCode")) || ValidationUtil.isEmpty(map.get("county"))) {
throw new BadRequest("请先选择使用单位,施工区县等信息"); throw new BadRequest("请先选择使用单位,施工区县等信息");
} }
map.put("USE_UNIT_CREDIT_CODE", map.get("useUnitCreditCode")); map.put("USE_UNIT_CREDIT_CODE", map.get("useUnitCreditCode"));
map.put(USE_PLACE_CODE, String.valueOf(map.get("county")).split("_")[0]); map.put(USE_PLACE_CODE, String.valueOf(map.get("county")).split("_")[0]);
} else if (ValidationUtil.equals(queryType, "GZ_YZ")) {// 移装告知设备选择 - 业务限制 } else if (ValidationUtil.equals(queryType, "GZ_YZ")) {// 移装告知设备选择 - 业务限制
// 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、(区内移装(transferType=区内移装)根据区县(USE_PLACE_CODE))过滤数据 // 设备类别(EQU_CATEGORY)、安装单位(USC_UNIT_CREDIT_CODE)、选择的使用单位(USE_UNIT_CREDIT_CODE)、(区内移装(transferType=区内移装)根据区县(USE_PLACE_CODE))过滤数据
if (ValidationUtil.isEmpty(map.get("useUnitCreditCode"))) { if (ValidationUtil.isEmpty(map.get("useUnitCreditCode"))) {
throw new BadRequest("请先选择使用单位等信息"); throw new BadRequest("请先选择使用单位等信息");
} }
if (!ValidationUtil.isEmpty(map.get("transferType")) && ValidationUtil.equals(map.get("transferType"), "区内移装") if (!ValidationUtil.isEmpty(map.get("transferType")) && ValidationUtil.equals(map.get("transferType"), "区内移装")
&& ValidationUtil.isEmpty(map.get("county"))) { && ValidationUtil.isEmpty(map.get("county"))) {
throw new BadRequest("请先选择施工区域等信息"); throw new BadRequest("请先选择施工区域等信息");
} }
map.put("USE_UNIT_CREDIT_CODE", map.get("useUnitCreditCode")); map.put("USE_UNIT_CREDIT_CODE", map.get("useUnitCreditCode"));
map.put(USE_PLACE_CODE, ValidationUtil.equals(map.get("transferType"), "区内移装") ? String.valueOf(map.get("county")).split("_")[0] : null); map.put(USE_PLACE_CODE, ValidationUtil.equals(map.get("transferType"), "区内移装") ? String.valueOf(map.get("county")).split("_")[0] : null);
...@@ -1521,10 +1537,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1521,10 +1537,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
// 设备类别 // 设备类别
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY_CODE"))) { if (!ObjectUtils.isEmpty(map.getString(EQU_CATEGORY_CODE))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("EQU_CATEGORY_CODE")); String test = QueryParser.escape(map.getString(EQU_CATEGORY_CODE));
pBuilder.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", test)); pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
// 是否车用气瓶 // 是否车用气瓶
...@@ -1576,6 +1592,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1576,6 +1592,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
pBuilder.must(QueryBuilders.wildcardQuery(USE_PLACE_CODE, "*" + QueryParser.escape(test.toLowerCase()) + "*")); pBuilder.must(QueryBuilders.wildcardQuery(USE_PLACE_CODE, "*" + QueryParser.escape(test.toLowerCase()) + "*"));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
// 工程装置名称模糊查询
if (!ObjectUtils.isEmpty(map.getString(PROJECT_CONTRAPTION))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString(PROJECT_CONTRAPTION));
pBuilder.must(QueryBuilders.wildcardQuery(PROJECT_CONTRAPTION, "*" + QueryParser.escape(test.toLowerCase()) + "*"));
boolMust.must(pBuilder);
}
builder.query(boolMust); builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC); builder.sort("REC_DATE", SortOrder.DESC);
builder.from((pageNumber - 1) * size); builder.from((pageNumber - 1) * size);
...@@ -1673,43 +1696,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1673,43 +1696,43 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return result; return result;
} }
private void setRepeatUsedCheckFilterByType(BoolQueryBuilder boolMust, String companyCode, String queryType) { // private void setRepeatUsedCheckFilterByType(BoolQueryBuilder boolMust, String companyCode, String queryType) {
if ("AZ".equals(queryType)) {// 安装告知 // if ("AZ".equals(queryType)) {// 安装告知
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice");
} else if ("GZ_GZ".equals(queryType)) {// 改造告知 // } else if ("GZ_GZ".equals(queryType)) {// 改造告知
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "renovationNoticeNew"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "renovationNoticeNew");
} else if ("GZ_WX".equals(queryType)) {// 维修告知 // } else if ("GZ_WX".equals(queryType)) {// 维修告知
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintainInfo"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintainInfo");
} else if ("GZ_YZ".equals(queryType)) {// 移装告知 // } else if ("GZ_YZ".equals(queryType)) {// 移装告知
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "transferNotice"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "transferNotice");
} else if ("SY".equals(queryType)) {// 使用登记 // } else if ("SY".equals(queryType)) {// 使用登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegister"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
} else if ("DJ_GZ".equals(queryType)) {// 改造变更登记 // } else if ("DJ_GZ".equals(queryType)) {// 改造变更登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistration"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistration");
} else if ("DJ_YZ".equals(queryType)) {// 移装变更登记 // } else if ("DJ_YZ".equals(queryType)) {// 移装变更登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistrationTransfer"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistrationTransfer");
} else if ("DJ_DW".equals(queryType)) {// 单位变更登记 // } else if ("DJ_DW".equals(queryType)) {// 单位变更登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "unitChange"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "unitChange");
} else if ("DJ_GM".equals(queryType)) {// 更名变更登记 // } else if ("DJ_GM".equals(queryType)) {// 更名变更登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeName"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeName");
} else if ("BF_YZ".equals(queryType)) {// 注销 // } else if ("BF_YZ".equals(queryType)) {// 注销
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, ""); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
} else if ("BF_ZX".equals(queryType)) {// 报废 // } else if ("BF_ZX".equals(queryType)) {// 报废
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, ""); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
} else if ("SB_QY".equals(queryType)) {// 启用 // } else if ("SB_QY".equals(queryType)) {// 启用
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, ""); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
} else if ("SB_TY".equals(queryType)) {// 停用 // } else if ("SB_TY".equals(queryType)) {// 停用
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, ""); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
} else if ("WB_BA".equals(queryType)) {// 维保备案 // } else if ("WB_BA".equals(queryType)) {// 维保备案
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintenanceFiling"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintenanceFiling");
} else if ("SB_YJ".equals(queryType)) {// 设备移交 // } else if ("SB_YJ".equals(queryType)) {// 设备移交
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "equipmentHandover"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "equipmentHandover");
} else if ("QP_BG".equals(queryType)) {// 车用气瓶变更 // } else if ("QP_BG".equals(queryType)) {// 车用气瓶变更
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleGasCylinderChange"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleGasCylinderChange");
} else if ("QP_DJ".equals(queryType)) {// 车用气瓶登记 // } else if ("QP_DJ".equals(queryType)) {// 车用气瓶登记
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleInformation"); // this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleInformation");
} // }
} // }
/** /**
* 设备注册信息分页查询 * 设备注册信息分页查询
...@@ -1798,7 +1821,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1798,7 +1821,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE")); syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*")); syBuilder.mustNot(QueryBuilders.wildcardQuery("USE_ORG_CODE", "*"));
boolMust.must(syBuilder); boolMust.must(syBuilder);
this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegister"); this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
} else if (ValidationUtil.equals(queryType, "FINISH_SY")) { } else if (ValidationUtil.equals(queryType, "FINISH_SY")) {
// 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备 // 注意:上面条件是过滤出【未做过】某个业务的设备,下面部分是过滤出【做过】某个业务的设备
// 查询 已经做过【使用登记】 的设备 【(EQU_STATUS != 空 ) && (USE_ORG_CODE(使用登记证编号) != 空)】 // 查询 已经做过【使用登记】 的设备 【(EQU_STATUS != 空 ) && (USE_ORG_CODE(使用登记证编号) != 空)】
...@@ -1909,10 +1932,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1909,10 +1932,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
// 设备类别 // 设备类别
if (!ObjectUtils.isEmpty(map.getString("EQU_CATEGORY_CODE"))) { if (!ObjectUtils.isEmpty(map.getString(EQU_CATEGORY_CODE))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("EQU_CATEGORY_CODE")); String test = QueryParser.escape(map.getString(EQU_CATEGORY_CODE));
pBuilder.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", test)); pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
// 是否车用气瓶 // 是否车用气瓶
...@@ -2489,10 +2512,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2489,10 +2512,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
jsonObject.put("useUnitCreditCode", useUnitCreditCode); jsonObject.put("useUnitCreditCode", useUnitCreditCode);
Page<JSONObject> page = new Page<>(jsonObject.getLong("number"), jsonObject.getLong("size")); Page<JSONObject> page = new Page<>(jsonObject.getLong("number"), jsonObject.getLong("size"));
Set<String> records = EquipUsedCheckStrategyContext.getUsedStrategy("useRegister").getEquipInFlow(useUnitCreditCode); Set<String> records = EquipUsedCheckStrategyContext.getUsedStrategy("useRegistration").getEquipInFlow(useUnitCreditCode);
if ("8300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {// 管道 if ("8300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 管道
return jgUseRegistrationMapper.queryForUnitPipelineEquipmentPage(page, jsonObject, records); return jgUseRegistrationMapper.queryForUnitPipelineEquipmentPage(page, jsonObject, records);
} else if ("2300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {// 气瓶 } else if ("2300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 气瓶
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult(); List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue)); Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, records); Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, records);
......
...@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum; import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
...@@ -67,8 +66,8 @@ import java.util.concurrent.TimeUnit; ...@@ -67,8 +66,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate; import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
/** /**
* 移装变更登记登记服务实现类 * 移装变更登记登记服务实现类
...@@ -589,12 +588,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -589,12 +588,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//移装变更详情 //移装变更详情
JgChangeRegistrationTransfer transfer = this.getById(sequenceNbr); JgChangeRegistrationTransfer transfer = this.getById(sequenceNbr);
//查询设备详情 //查询设备详情
//String equipId = jgChangeRegistrationTransferEqMapper.getEquipIdByEquipTransferId(sequenceNbr); JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
if (ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), transfer.getStatus())) { if (ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), transfer.getStatus())) {
// 执行完成时查询历史表 // 执行完成时查询历史表
JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
if (!ValidationUtil.isEmpty(historyData)) { if (!ValidationUtil.isEmpty(historyData)) {
Map<String, Object> newPosition = JSON.parseObject(historyData.getChangeData(), Map.class); Map<String, Object> newPosition = JSON.parseObject(historyData.getChangeData(), Map.class);
resultDataMap.putAll(newPosition); resultDataMap.putAll(newPosition);
...@@ -606,15 +603,17 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -606,15 +603,17 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
} }
} else { } else {
// 非执行完成状态显示最新设备信息 // 非执行完成状态显示最新设备信息
//Map<String, Object> equipDetailMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId); Map<String, Object> changeData = JSON.parseObject(historyData.getChangeData(), Map.class);
//resultDataMap.putAll(equipDetailMap); List<String> ids = ((List<?>) changeData.get("registrationList")).stream()
.map(obj -> ((JSONObject) obj).getString("sequenceNbr"))
.collect(Collectors.toList());
List<JgUseRegistrationManage> newRegistrationList = useRegistrationManageService.lambdaQuery()
.in(BaseEntity::getSequenceNbr, ids)
.list();
if (!ValidationUtil.isEmpty(transfer)) { if (!ValidationUtil.isEmpty(transfer)) {
Map<String, Object> transferToMap = Bean.BeantoMap(transfer); Map<String, Object> transferToMap = Bean.BeantoMap(transfer);
resultDataMap.putAll(transferToMap); resultDataMap.putAll(transferToMap);
} }
JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
Map<String, Object> changeData = JSON.parseObject(historyData.getChangeData(), Map.class);
// 省市区街道字段等业务字段 // 省市区街道字段等业务字段
resultDataMap.put("transferProvince", changeData.get("transferProvince")); resultDataMap.put("transferProvince", changeData.get("transferProvince"));
resultDataMap.put("transferCity", changeData.get("transferCity")); resultDataMap.put("transferCity", changeData.get("transferCity"));
...@@ -631,7 +630,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -631,7 +630,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
resultDataMap.put("transferUseInfo", changeData.get("transferUseInfo")); resultDataMap.put("transferUseInfo", changeData.get("transferUseInfo"));
//resultDataMap.put("useInnerCode", equipDetailMap.get("equCode")); //resultDataMap.put("useInnerCode", equipDetailMap.get("equCode"));
resultDataMap.put("receiveCompanyCode", transfer.getReceiveCompanyCode() + "_" + transfer.getReceiveOrgName()); resultDataMap.put("receiveCompanyCode", transfer.getReceiveCompanyCode() + "_" + transfer.getReceiveOrgName());
resultDataMap.put("registrationList", changeData.get("registrationList")); resultDataMap.put("registrationList", newRegistrationList);
} }
String transferSafetyManager = Optional.ofNullable(resultDataMap.get("transferSafetyManager")).orElse("").toString(); String transferSafetyManager = Optional.ofNullable(resultDataMap.get("transferSafetyManager")).orElse("").toString();
if (StringUtil.isNotEmpty(transferSafetyManager)) { if (StringUtil.isNotEmpty(transferSafetyManager)) {
...@@ -955,19 +954,32 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -955,19 +954,32 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
private void updateUseRegistrationManage(JgChangeRegistrationTransfer transfer, JgRegistrationHistory historyData, String useRegistrationCode, boolean isUpdateRegistrationCode) { private void updateUseRegistrationManage(JgChangeRegistrationTransfer transfer, JgRegistrationHistory historyData, String useRegistrationCode, boolean isUpdateRegistrationCode) {
JSONObject historyJson = JSON.parseObject(historyData.getChangeData()); JSONObject historyJson = JSON.parseObject(historyData.getChangeData());
List<Map<String, Object>> registrationList = (List<Map<String, Object>>) historyJson.get("registrationList"); List<JgUseRegistrationManage> registrationList = useRegistrationManageService.lambdaQuery()
List<String> ids = registrationList.stream().map(v -> JSON.parseObject(v.toString()).getString("sequenceNbr")).collect(Collectors.toList()); .in(BaseEntity::getSequenceNbr,
List<JgUseRegistrationManage> list = useRegistrationManageService.lambdaQuery().in(BaseEntity::getSequenceNbr, ids).list(); ((List<?>) historyJson.get("registrationList")).stream()
for (JgUseRegistrationManage registrationManage : list) { .map(obj -> ((JSONObject) obj).getString("sequenceNbr"))
.collect(Collectors.toList())
).list();
registrationList.forEach(registrationManage -> {
registrationManage.setReceiveOrgName(transfer.getReceiveOrgName()); registrationManage.setReceiveOrgName(transfer.getReceiveOrgName());
registrationManage.setReceiveCompanyCode(transfer.getReceiveOrgCode()); registrationManage.setReceiveCompanyCode(transfer.getReceiveOrgCode());
registrationManage.setAuditPassDate(transfer.getAuditPassDate()); registrationManage.setAuditPassDate(new Date());
registrationManage.setEquUseAddress(transfer.getFullAddress()); registrationManage.setEquUseAddress(transfer.getFullAddress());
if (isUpdateRegistrationCode) { if (isUpdateRegistrationCode) {
registrationManage.setUseRegistrationCode(useRegistrationCode); registrationManage.setUseRegistrationCode(useRegistrationCode);
} }
} registrationManage.setCertificateStatus("已登记");
useRegistrationManageService.updateBatchById(list); });
List<JSONObject> updatedRegistrationList = registrationList.stream()
.map(registrationManage -> {
JSONObject jsonObject = (JSONObject) JSON.toJSON(registrationManage);
jsonObject.put("auditPassDate", new SimpleDateFormat("yyyy-MM-dd").format(registrationManage.getAuditPassDate()));
return jsonObject;
})
.collect(Collectors.toList());
useRegistrationManageService.updateBatchById(registrationList);
historyJson.put("registrationList", updatedRegistrationList);
historyData.setChangeData(JSONObject.toJSONString(historyJson));
} }
/** /**
...@@ -1368,12 +1380,12 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -1368,12 +1380,12 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
/** /**
* 新增代办任务 * 新增代办任务
*/ */
private void createToDoTask(List<WorkflowResultDto> sorkflows, JgChangeRegistrationTransfer transfer, String submitType) { private void createToDoTask(List<WorkflowResultDto> workflows, JgChangeRegistrationTransfer transfer, String submitType) {
if (!ValidationUtil.isEmpty(sorkflows)) { if (!ValidationUtil.isEmpty(workflows)) {
List<TaskModelDto> toDoTasklist = new ArrayList<>(); List<TaskModelDto> toDoTasklist = new ArrayList<>();
for (WorkflowResultDto sorkflow : sorkflows) { for (WorkflowResultDto workflow : workflows) {
TaskModelDto toDoTask = new TaskModelDto(); TaskModelDto toDoTask = new TaskModelDto();
toDoTask.setTaskName(sorkflow.getTaskName()); toDoTask.setTaskName(workflow.getTaskName());
toDoTask.setFlowCreateDate(transfer.getCreateDate()); toDoTask.setFlowCreateDate(transfer.getCreateDate());
toDoTask.setTaskCode(transfer.getApplyNo()); toDoTask.setTaskCode(transfer.getApplyNo());
toDoTask.setTaskContent(this.getSummaryInfo(transfer)); toDoTask.setTaskContent(this.getSummaryInfo(transfer));
...@@ -1381,13 +1393,13 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang ...@@ -1381,13 +1393,13 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
toDoTask.setTaskType(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getCode()); toDoTask.setTaskType(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getCode());
toDoTask.setTaskTypeLabel(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getName()); toDoTask.setTaskTypeLabel(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getName());
toDoTask.setRelationId(transfer.getInstanceId()); toDoTask.setRelationId(transfer.getInstanceId());
toDoTask.setExecuteUserIds(sorkflow.getNextExecutorUserIds()); toDoTask.setExecuteUserIds(workflow.getNextExecutorUserIds());
FlowStatusEnum flowStatusEnum = this.getTaskStatus(submitType); FlowStatusEnum flowStatusEnum = this.getTaskStatus(submitType);
toDoTask.setTaskStatus(flowStatusEnum.getCode()); toDoTask.setTaskStatus(flowStatusEnum.getCode());
toDoTask.setTaskStatusLabel(flowStatusEnum.getName()); toDoTask.setTaskStatusLabel(flowStatusEnum.getName());
toDoTask.setFlowStatus(commonService.getDictionaryCodeByName(transfer.getStatus())); toDoTask.setFlowStatus(commonService.getDictionaryCodeByName(transfer.getStatus()));
toDoTask.setFlowStatusLabel(transfer.getStatus()); toDoTask.setFlowStatusLabel(transfer.getStatus());
toDoTask.setFlowCode(sorkflow.getNextTaskId()); toDoTask.setFlowCode(workflow.getNextTaskId());
toDoTask.setStartUserId(transfer.getCreateUserId()); toDoTask.setStartUserId(transfer.getCreateUserId());
toDoTask.setStartUser(transfer.getCreateUserName()); toDoTask.setStartUser(transfer.getCreateUserName());
toDoTask.setStartUserCompanyName(transfer.getCreateUserCompanyName()); toDoTask.setStartUserCompanyName(transfer.getCreateUserCompanyName());
......
...@@ -517,7 +517,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg ...@@ -517,7 +517,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private void checkForRepeatUsedEquip(JSONObject map, CompanyBo company) { private void checkForRepeatUsedEquip(JSONObject map, CompanyBo company) {
if (!ObjectUtils.isEmpty(map.get("submit"))) { if (!ObjectUtils.isEmpty(map.get("submit"))) {
// 流程中或已完成 // 流程中或已完成
EquipUsedCheckStrategyContext.getUsedStrategy("useRegister").equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode()); EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode());
} }
} }
......
...@@ -285,7 +285,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -285,7 +285,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Override @Override
@SuppressWarnings({"rawtypes", "Duplicates"}) @SuppressWarnings({"rawtypes", "Duplicates"})
@Transactional @Transactional
public JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op) { public JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op, ReginParams reginParams) {
try { try {
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) { if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) {
...@@ -293,8 +293,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -293,8 +293,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
} }
// 字段转换 // 字段转换
this.convertField(noticeDto); this.convertField(noticeDto);
// 获取告知设备列表
List<Map<String, Object>> deviceList = noticeDto.getDeviceList();
if (CollectionUtils.isEmpty(deviceList)) {
throw new BadRequest("请选择设备");
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请)
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
this.repeatUsedEquipCheck(deviceList, reginParams.getCompany().getCompanyCode());
}
JgMaintainNotice notice = jgMaintainNoticeMapper.selectById(noticeDto.getSequenceNbr()); JgMaintainNotice notice = jgMaintainNoticeMapper.selectById(noticeDto.getSequenceNbr());
this.checkRepeatUsed(submitType, notice);
// submitType=1为流程提交否则仅为保存业务数据 // submitType=1为流程提交否则仅为保存业务数据
if (SUBMIT_TYPE_FLOW.equals(submitType)) { if (SUBMIT_TYPE_FLOW.equals(submitType)) {
ProcessTaskDTO processTaskDTO = new ProcessTaskDTO(); ProcessTaskDTO processTaskDTO = new ProcessTaskDTO();
...@@ -395,6 +406,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto ...@@ -395,6 +406,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
BeanUtils.copyProperties(noticeDto, bean); BeanUtils.copyProperties(noticeDto, bean);
jgMaintainNoticeMapper.updateById(bean); jgMaintainNoticeMapper.updateById(bean);
} }
LambdaQueryWrapper<JgMaintainNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, noticeDto.getSequenceNbr());
jgMaintainNoticeEqMapper.delete(lambdaQueryWrapper);
List<JgMaintainNoticeEq> equipList = new ArrayList<>();
deviceList.forEach(obj -> {
JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipTransferId(noticeDto.getSequenceNbr().toString());
jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE"))?null:String.valueOf(obj.get("EQU_CODE")));
jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE")));
jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE")));
equipList.add(jgRelationEquip);
});
jgMaintainNoticeEqMapper.insertBatchSomeColumn(equipList);
return noticeDto; return noticeDto;
} catch (BadRequest | LocalBadRequest e) { } catch (BadRequest | LocalBadRequest e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -151,8 +151,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -151,8 +151,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} }
} else { } else {
// 显示最新的设备信息 // 显示最新的设备信息
List<JgReformNoticeEq> noticeEqs = jgReformNoticeEqMapper.selectList(new LambdaQueryWrapper<JgReformNoticeEq>() List<JgReformNoticeEq> noticeEqs = jgReformNoticeEqMapper.selectList(new LambdaQueryWrapper<JgReformNoticeEq>().eq(JgReformNoticeEq::getEquipTransferId, sequenceNbr));
.eq(JgReformNoticeEq::getEquipTransferId, sequenceNbr));
List<String> ids = noticeEqs.stream().map(JgReformNoticeEq::getEquId).collect(Collectors.toList()); List<String> ids = noticeEqs.stream().map(JgReformNoticeEq::getEquId).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids); Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips); List<Map<String, Object>> equipListMaps = getEquipListMaps(equips);
...@@ -342,11 +341,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -342,11 +341,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 删除单子 // 删除单子
this.baseMapper.deleteById(notice.getSequenceNbr()); this.baseMapper.deleteById(notice.getSequenceNbr());
// 删除对应eq // 删除对应eq
jgReformNoticeEqMapper.delete(new LambdaQueryWrapper<JgReformNoticeEq>() jgReformNoticeEqMapper.delete(new LambdaQueryWrapper<JgReformNoticeEq>().eq(JgReformNoticeEq::getEquipTransferId, notice.getSequenceNbr()));
.eq(JgReformNoticeEq::getEquipTransferId, notice.getSequenceNbr()));
// 删除单子对应历史表数据 // 删除单子对应历史表数据
jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>() jgRegistrationHistoryMapper.delete(new LambdaQueryWrapper<JgRegistrationHistory>().eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr()));
.eq(JgRegistrationHistory::getCurrentDocumentId, notice.getSequenceNbr()));
}); });
return Boolean.TRUE; return Boolean.TRUE;
} }
...@@ -428,16 +425,15 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -428,16 +425,15 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
notice.setCreateUserName(reginParams.getUserModel().getRealName()); notice.setCreateUserName(reginParams.getUserModel().getRealName());
notice.setCreateUserId(reginParams.getUserModel().getUserId()); notice.setCreateUserId(reginParams.getUserModel().getUserId());
notice.setCreateUserCompanyName(reginParams.getCompany().getCompanyName()); notice.setCreateUserCompanyName(reginParams.getCompany().getCompanyName());
notice.setProjectContraption(String.valueOf(jsonObject.get("projectContraption")));
String equListCode = String.valueOf(jsonObject.get("EQU_LIST_CODE")); String equListCode = String.valueOf(jsonObject.get("EQU_LIST_CODE"));
String equCategoryCode = String.valueOf(jsonObject.get("EQU_CATEGORY_CODE")); String equCategoryCode = String.valueOf(jsonObject.get("EQU_CATEGORY_CODE"));
notice.setEquListCode(equListCode); notice.setEquListCode(equListCode);
EquipmentCategory equipmentCategory1 = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>() EquipmentCategory equipmentCategory1 = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, equListCode));
.eq(EquipmentCategory::getCode, equListCode)); notice.setEquListName(ValidationUtil.isEmpty(equipmentCategory1) ? null : equipmentCategory1.getName());
notice.setEquListName(equipmentCategory1.getName());
notice.setEquCategoryCode(equCategoryCode); notice.setEquCategoryCode(equCategoryCode);
EquipmentCategory equipmentCategory2 = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>() EquipmentCategory equipmentCategory2 = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, equCategoryCode));
.eq(EquipmentCategory::getCode, equCategoryCode)); notice.setEquCategoryName(ValidationUtil.isEmpty(equipmentCategory2) ? null : equipmentCategory2.getName());
notice.setEquCategoryName(equipmentCategory2.getName());
// 统计用 // 统计用
notice.setReceiveCompanyOrgCode(companyBo.getOrgCode()); notice.setReceiveCompanyOrgCode(companyBo.getOrgCode());
...@@ -492,7 +488,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -492,7 +488,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
this.rollBackForDelRedisData(); this.rollBackForDelRedisData();
throw new BadRequest("保存失败!"); throw new BadRequest("告知单保存失败!");
} finally { } finally {
FlowingEquipRedisContext.clean(); FlowingEquipRedisContext.clean();
} }
...@@ -507,9 +503,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -507,9 +503,10 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
// 流程中校验 // 流程中校验
LambdaQueryWrapper<JgReformNoticeEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgReformNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgReformNoticeEq::getEquipTransferId, jgReformNotice.getSequenceNbr()); queryWrapper.eq(JgReformNoticeEq::getEquipTransferId, jgReformNotice.getSequenceNbr());
JgReformNoticeEq jgRelationEquip = jgReformNoticeEqMapper.selectOne(queryWrapper); List<JgReformNoticeEq> noticeEqs = jgReformNoticeEqMapper.selectList(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY) for (JgReformNoticeEq noticeEq : noticeEqs) {
.equipRepeatUsedCheck(jgRelationEquip.getEquId(), jgReformNotice.getInstallUnitCreditCode()); EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(noticeEq.getEquId(), jgReformNotice.getInstallUnitCreditCode());
}
} }
} }
...@@ -520,14 +517,12 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -520,14 +517,12 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
LambdaQueryWrapper<JgReformNoticeEq> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgReformNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgReformNoticeEq::getEquipTransferId, notice.getSequenceNbr()); queryWrapper.eq(JgReformNoticeEq::getEquipTransferId, notice.getSequenceNbr());
JgReformNoticeEq jgRelationEquip = jgReformNoticeEqMapper.selectOne(queryWrapper); JgReformNoticeEq jgRelationEquip = jgReformNoticeEqMapper.selectOne(queryWrapper);
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY) EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).delDataForCheckEquipRepeatUsed(Collections.singletonList(jgRelationEquip.getEquId()), notice.getInstallUnitCreditCode());
.delDataForCheckEquipRepeatUsed(Collections.singletonList(jgRelationEquip.getEquId()), notice.getInstallUnitCreditCode());
} }
private void rollBackForDelRedisData() { private void rollBackForDelRedisData() {
FlowingEquipRedisContext.getContext().forEach(e -> { FlowingEquipRedisContext.getContext().forEach(e -> {
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY) EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).delDataForCheckWithKey(e.getData(), e.getRedisKey());
.delDataForCheckWithKey(e.getData(), e.getRedisKey());
}); });
} }
...@@ -551,13 +546,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -551,13 +546,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
} }
private TaskModelDto buildTempTaskModelDto(JgReformNotice item) { private TaskModelDto buildTempTaskModelDto(JgReformNotice item) {
return TaskModelDto.builder() return TaskModelDto.builder().model(item).taskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquListName(), item.getApplyNo())).taskCode(item.getApplyNo()).taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode()).relationId(item.getSequenceNbr() + "").build();
.model(item)
.taskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquListName(), item.getApplyNo()))
.taskCode(item.getApplyNo())
.taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode())
.relationId(item.getSequenceNbr() + "")
.build();
} }
/** /**
...@@ -581,29 +570,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -581,29 +570,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private TaskModelDto buildTaskModelDto(JgReformNotice item, WorkflowResultDto workflowResultDto) { private TaskModelDto buildTaskModelDto(JgReformNotice item, WorkflowResultDto workflowResultDto) {
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(item, taskMessageDto); BeanUtil.copyProperties(item, taskMessageDto);
return TaskModelDto.builder() return TaskModelDto.builder().flowCreateDate(item.getCreateDate()).taskName(workflowResultDto.getNextTaskName()).taskCode(item.getApplyNo()).relationId(workflowResultDto.getInstanceId()).taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode()).taskTypeLabel(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName()).relationId(item.getInstanceId()).executeUserIds(workflowResultDto.getNextExecutorUserIds()).taskStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode()).taskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName()).flowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode()).flowCode(workflowResultDto.getNextTaskId()).flowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName()).taskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo())).taskDesc(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo())).startUserId(item.getCreateUserId()).startUser(item.getCreateUserName()).startUserCompanyName(item.getCreateUserCompanyName()).startDate(item.getCreateDate()).model(taskMessageDto).nextExecuteUser(item.getNextExecuteIds()).build();
.flowCreateDate(item.getCreateDate())
.taskName(workflowResultDto.getNextTaskName())
.taskCode(item.getApplyNo())
.relationId(workflowResultDto.getInstanceId())
.taskType(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getCode())
.taskTypeLabel(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName())
.relationId(item.getInstanceId())
.executeUserIds(workflowResultDto.getNextExecutorUserIds())
.taskStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode())
.taskStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName())
.flowStatus(FlowStatusEnum.TO_BE_PROCESSED.getCode())
.flowCode(workflowResultDto.getNextTaskId())
.flowStatusLabel(FlowStatusEnum.TO_BE_PROCESSED.getName())
.taskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()))
.taskDesc(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()))
.startUserId(item.getCreateUserId())
.startUser(item.getCreateUserName())
.startUserCompanyName(item.getCreateUserCompanyName())
.startDate(item.getCreateDate())
.model(taskMessageDto)
.nextExecuteUser(item.getNextExecuteIds())
.build();
} }
/** /**
...@@ -834,8 +801,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -834,8 +801,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
queryWrapper2.eq(RegistrationInfo::getRecord, noticeEq.getEquId()); queryWrapper2.eq(RegistrationInfo::getRecord, noticeEq.getEquId());
RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2); RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
String equCode = Optional.ofNullable(tzsJgRegistrationInfo.getEquDefine()) String equCode = Optional.ofNullable(tzsJgRegistrationInfo.getEquDefine()).orElse(tzsJgRegistrationInfo.getEquCategory());
.orElse(tzsJgRegistrationInfo.getEquCategory());
String registrationCode = equCode + jgReformNotice.getReceiveCompanyCode() + ym; String registrationCode = equCode + jgReformNotice.getReceiveCompanyCode() + ym;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode); ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
String deviceRegistrationCode = responseModel.getResult(); String deviceRegistrationCode = responseModel.getResult();
...@@ -889,16 +855,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -889,16 +855,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private void saveHisDataBeforeUpdate(JgReformNotice jgReformNotice, JSONObject jsonObject) { private void saveHisDataBeforeUpdate(JgReformNotice jgReformNotice, JSONObject jsonObject) {
commonService.saveOrUpdateHistory(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName(), commonService.saveOrUpdateHistory(BusinessTypeEnum.JG_MODIFICATION_NOTIFICATION.getName(), new JSONObject(jsonObject), null, String.valueOf(jgReformNotice.getSequenceNbr()));
new JSONObject(jsonObject), null, String.valueOf(jgReformNotice.getSequenceNbr()));
} }
public InstanceRuntimeData buildInstanceRuntimeData(JgReformNotice jgReformNotice) { public InstanceRuntimeData buildInstanceRuntimeData(JgReformNotice jgReformNotice) {
return InstanceRuntimeData.builder() return InstanceRuntimeData.builder().nextExecuteUserIds(jgReformNotice.getNextExecuteUserIds()).promoter(jgReformNotice.getPromoter()).nextTaskId(jgReformNotice.getNextTaskId()).build();
.nextExecuteUserIds(jgReformNotice.getNextExecuteUserIds())
.promoter(jgReformNotice.getPromoter())
.nextTaskId(jgReformNotice.getNextTaskId())
.build();
} }
/** /**
...@@ -908,14 +869,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -908,14 +869,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
* @return 代办信息 * @return 代办信息
*/ */
private TaskV2Model updateLastTodo(JgReformNotice jgReformNotice, FlowStatusEnum statusEnum) { private TaskV2Model updateLastTodo(JgReformNotice jgReformNotice, FlowStatusEnum statusEnum) {
return commonService.updateTaskModel(MapBuilder.<String, Object>create() return commonService.updateTaskModel(MapBuilder.<String, Object>create().put("taskStatus", statusEnum.getCode()).put("taskStatusLabel", statusEnum.getName()).put("flowStatus", statusEnum.getCode()).put("flowStatusLabel", statusEnum.getName()).put("relationId", jgReformNotice.getInstanceId()).put("model", jgReformNotice).build());
.put("taskStatus", statusEnum.getCode())
.put("taskStatusLabel", statusEnum.getName())
.put("flowStatus", statusEnum.getCode())
.put("flowStatusLabel", statusEnum.getName())
.put("relationId", jgReformNotice.getInstanceId())
.put("model", jgReformNotice)
.build());
} }
/** /**
...@@ -928,28 +882,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg ...@@ -928,28 +882,7 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
private void createNewTodo(JgReformNotice transfer, WorkflowResultDto workflowResultDto, TaskV2Model taskV2Model, FlowStatusEnum statusEnum) { private void createNewTodo(JgReformNotice transfer, WorkflowResultDto workflowResultDto, TaskV2Model taskV2Model, FlowStatusEnum statusEnum) {
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtil.copyProperties(transfer, taskMessageDto); BeanUtil.copyProperties(transfer, taskMessageDto);
TaskModelDto taskModelDto = TaskModelDto.builder() TaskModelDto taskModelDto = TaskModelDto.builder().flowCreateDate(taskV2Model.getFlowCreateDate()).taskName(workflowResultDto.getNextTaskName()).taskCode(taskV2Model.getTaskCode()).taskType(taskV2Model.getTaskType()).taskTypeLabel(taskV2Model.getTaskTypeLabel()).relationId(taskV2Model.getRelationId()).executeUserIds(workflowResultDto.getNextExecutorUserIds()).taskStatusLabel(statusEnum.getName()).flowStatus(statusEnum.getCode()).flowCode(workflowResultDto.getNextTaskId()).flowStatusLabel(statusEnum.getName()).taskContent(String.format("来自%s的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getApplyNo())).taskDesc(String.format("来自%s的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getApplyNo())).startUserCompanyName(transfer.getCreateUserCompanyName()).startUserId(taskV2Model.getStartUserId()).startUser(taskV2Model.getStartUser()).startDate(taskV2Model.getStartDate()).model(taskMessageDto).pageType(statusEnum.getCode() == 6614 ? "edit" : "look").nextExecuteUser(workflowResultDto.getNextExecutorRoleIds()).build();
.flowCreateDate(taskV2Model.getFlowCreateDate())
.taskName(workflowResultDto.getNextTaskName())
.taskCode(taskV2Model.getTaskCode())
.taskType(taskV2Model.getTaskType())
.taskTypeLabel(taskV2Model.getTaskTypeLabel())
.relationId(taskV2Model.getRelationId())
.executeUserIds(workflowResultDto.getNextExecutorUserIds())
.taskStatusLabel(statusEnum.getName())
.flowStatus(statusEnum.getCode())
.flowCode(workflowResultDto.getNextTaskId())
.flowStatusLabel(statusEnum.getName())
.taskContent(String.format("来自%s的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getApplyNo()))
.taskDesc(String.format("来自%s的业务办理,【申请单号:%s】", transfer.getEquList(), transfer.getApplyNo()))
.startUserCompanyName(transfer.getCreateUserCompanyName())
.startUserId(taskV2Model.getStartUserId())
.startUser(taskV2Model.getStartUser())
.startDate(taskV2Model.getStartDate())
.model(taskMessageDto)
.pageType(statusEnum.getCode() == 6614 ? "edit" : "look")
.nextExecuteUser(workflowResultDto.getNextExecutorRoleIds())
.build();
commonService.buildTaskModel(Collections.singletonList(taskModelDto)); commonService.buildTaskModel(Collections.singletonList(taskModelDto));
} }
} }
\ No newline at end of file
...@@ -289,26 +289,24 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -289,26 +289,24 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if (Objects.isNull(sequenceNbr)) { if (Objects.isNull(sequenceNbr)) {
throw new IllegalArgumentException("参数不能为空"); throw new IllegalArgumentException("参数不能为空");
} }
JgTransferNotice notice = this.getById(sequenceNbr);
JgTransferNotice jgTransferNotice = this.getById(sequenceNbr); HashMap<String, Object> map = new HashMap<>();
List<Map<String, Object>> informationList = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr); ArrayList<Map<String, Object>> maps = new ArrayList<>();
if (Objects.isNull(jgTransferNotice) || CollectionUtils.isEmpty(informationList)) { List<Map<String, Object>> informationList = this.getBaseMapper().queryEquipInformation(notice.getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("移装告知单不存在"); throw new IllegalArgumentException("移装告知单不存在");
} }
for (Map<String, Object> objectMap : informationList) {
Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(informationList, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2)); List<Map<String, Object>> temp = new ArrayList<>();
temp.add(objectMap);
Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(temp, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2));
maps.add(placeholders);
}
String tempFileName = "移装告知单_" + System.currentTimeMillis() + "_temp"; String tempFileName = "移装告知单_" + System.currentTimeMillis() + "_temp";
// String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders); map.put("equipBasicInfoList", maps);
// WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response);
// // 更新到数据库
// jgTransferNotice.setNoticeReportUrl(url);
// this.updateById(jgTransferNotice);
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", placeholders, response);
} }
/** /**
* 更新移装告知 * 更新移装告知
* *
...@@ -547,7 +545,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -547,7 +545,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
BeanUtils.copyProperties(obj, taskMessageDto); BeanUtils.copyProperties(obj, taskMessageDto);
dto.setModel(taskMessageDto); dto.setModel(taskMessageDto);
//摘要 按原有规则组装 //摘要 按原有规则组装
dto.setTaskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", obj.getEquList(), StringUtils.isEmpty(obj.getSupervisoryCode()) ? "" : obj.getSupervisoryCode(), obj.getApplyNo())); dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", obj.getEquList(), obj.getApplyNo()));
//申请单号 //申请单号
dto.setTaskCode(obj.getApplyNo()); dto.setTaskCode(obj.getApplyNo());
//业务类型枚举code值 //业务类型枚举code值
...@@ -640,7 +638,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -640,7 +638,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDto.setStartDate(item.getCreateDate()); taskModelDto.setStartDate(item.getCreateDate());
taskModelDto.setNextExecuteUser(item.getNextExecuteIds()); taskModelDto.setNextExecuteUser(item.getNextExecuteIds());
taskModelDto.setTaskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), StringUtils.isEmpty(item.getSupervisoryCode()) ? "" : item.getSupervisoryCode(), item.getApplyNo())); taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()));
TaskMessageDto taskMessageDto = new TaskMessageDto(); TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(item, taskMessageDto); BeanUtils.copyProperties(item, taskMessageDto);
taskModelDto.setModel(taskMessageDto); taskModelDto.setModel(taskMessageDto);
......
...@@ -21,7 +21,7 @@ public class UseRegisterEquipUsedCheckImpl extends BaseEquipUsedCheckService { ...@@ -21,7 +21,7 @@ public class UseRegisterEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient; private RedissonClient redissonClient;
private String bizType = "useRegister"; private String bizType = "useRegistration";
private JgUseRegistrationMapper useRegistrationMapper; private JgUseRegistrationMapper useRegistrationMapper;
......
...@@ -14,7 +14,17 @@ ...@@ -14,7 +14,17 @@
"useCode": "{useUnitCode}" "useCode": "{useUnitCode}"
} }
}, },
"resultConvert": "" "resultConvert": "",
"dictionaryFieldKeys": [
{
"fieldKey": "industrySupervisor",
"dictionaryType": "HYZGBM"
},
{
"fieldKey": "registeredOrganCode",
"dictionaryType": "DJJG"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,21 @@ ...@@ -35,7 +49,21 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "DEVICE_LEVEL",
"dictionaryType": "GLJB"
},
{
"fieldKey": "FUEL_TYPE",
"dictionaryType": "GLZL"
},
{
"fieldKey": "NAME_OF_PRESSURE_PARTS",
"dictionaryType": "GLBJMC"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,25 @@ ...@@ -35,7 +49,25 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "QP_LOSSLESS",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "RQJCFF",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "MAIN_STRUCTURE_TYPE",
"dictionaryType": "RQJG"
},
{
"fieldKey": "CHECK_LOSSLESS",
"dictionaryType": "RQJCFF"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,21 @@ ...@@ -35,7 +49,21 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "CONTROL_MODE",
"dictionaryType": "KZFS"
},
{
"fieldKey": "EXPLOSIONPROOF_GRADE",
"dictionaryType": "FBDJ"
},
{
"fieldKey": "JACKING_TYPE",
"dictionaryType": "DSXS"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,17 @@ ...@@ -35,7 +49,17 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "WORK_LEVEL",
"dictionaryType": "GZJB"
},
{
"fieldKey": "select_bq8h7v9tj1",
"dictionaryType": "FBDJ"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "PROTECT_GRADE",
"dictionaryType": "FBDJ"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "GDLB",
"dictionaryType": "GDLB"
}
]
} }
}, },
{ {
......
...@@ -17,7 +17,21 @@ ...@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo" "responseSuccess": "data.result.equipInfo"
} }
}, },
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"] "paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
} }
}, },
{ {
...@@ -35,7 +49,13 @@ ...@@ -35,7 +49,13 @@
"ruleData": { "ruleData": {
"responseSuccess": "data.result.equipParams" "responseSuccess": "data.result.equipParams"
} }
} },
"dictionaryFieldKeys": [
{
"fieldKey": "CARRIER_LINE",
"dictionaryType": "YZS"
}
]
} }
}, },
{ {
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl; package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.JsonValueUtils; import com.yeejoin.amos.boot.biz.common.utils.JsonValueUtils;
import com.yeejoin.amos.boot.biz.common.utils.RestTemplateUtils; import com.yeejoin.amos.boot.biz.common.utils.RestTemplateUtils;
import com.yeejoin.amos.boot.biz.common.utils.StringUtils; import com.yeejoin.amos.boot.biz.common.utils.StringUtils;
...@@ -12,7 +15,6 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel; ...@@ -12,7 +15,6 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
import jdk.nashorn.api.scripting.ScriptObjectMirror; import jdk.nashorn.api.scripting.ScriptObjectMirror;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -47,6 +49,9 @@ public class DPSubServiceImpl { ...@@ -47,6 +49,9 @@ public class DPSubServiceImpl {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
public JSONObject commonQuery(String template, @RequestBody Map<String, Object> param) { public JSONObject commonQuery(String template, @RequestBody Map<String, Object> param) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
String templateJson = DpSubUtils.getFileContent(template + ".json"); String templateJson = DpSubUtils.getFileContent(template + ".json");
...@@ -378,11 +383,25 @@ public class DPSubServiceImpl { ...@@ -378,11 +383,25 @@ public class DPSubServiceImpl {
Object value = apiResult.get(fieldKey); Object value = apiResult.get(fieldKey);
Object paramFieldKeys = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.paramFieldKeys"); Object paramFieldKeys = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.paramFieldKeys");
Object dictionaryFieldKeys = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.dictionaryFieldKeys");
JSONObject param = tab.getJSONObject("param"); JSONObject param = tab.getJSONObject("param");
jsonObject.put("type", "text"); jsonObject.put("type", "text");
jsonObject.put("value", value); jsonObject.put("value", value);
if (!ValidationUtil.isEmpty(paramFieldKeys) && ((JSONArray) paramFieldKeys).contains(fieldKey)) { if (!ValidationUtil.isEmpty(paramFieldKeys) && ((JSONArray) paramFieldKeys).contains(fieldKey)) {
jsonObject.put("value", param.getString(fieldKey)); jsonObject.put("value", param.getString(fieldKey));
} else if (!ValidationUtil.isEmpty(dictionaryFieldKeys) && ((JSONArray) dictionaryFieldKeys).stream().anyMatch(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey")))) {
((JSONArray) dictionaryFieldKeys).stream().filter(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey"))).findFirst().ifPresent(y -> {
JSONObject yObj = (JSONObject) y;
String dictionaryType = yObj.getString("dictionaryType");
try {
List<DataDictionary> dataDictionaryList = iDataDictionaryService.getByType(dictionaryType);
dataDictionaryList.stream().filter(dataDictionary -> dataDictionary.getCode().equals(value)).findFirst().ifPresent(map -> {
jsonObject.put("value", map.getName());
});
} catch (Exception e) {
throw new RuntimeException(e);
}
});
} else { } else {
if ("upload".equals(xObj.getString("componentKey"))) { if ("upload".equals(xObj.getString("componentKey"))) {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas"); JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
......
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