Commit 06e5a064 authored by chenzhao's avatar chenzhao

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents ba10b0e3 60898c49
......@@ -91,4 +91,11 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
void updateEsCylinderInfoStatus(@Param("ids")List<String> ids);
Integer saveOrUpdateBatch(@Param("list") List<CylinderInfo> list);
Page<Map<String,Object>> timeOutList(@Param("page") Page<Map<String, Object>> page, @Param("companyId") String companyId, @Param("regionCode") String regionCode);
Page<Map<String,Object>> licenceList(@Param("page") Page<Map<String, Object>> page, @Param("companyId") String companyId);
int countNumber(@Param("status") String status, @Param("companyId") String companyId, @Param("regionCode") String regionCode);
}
......@@ -310,7 +310,8 @@
d3.name AS cylinder_status_str,
ct.qrCode,
ct.electronic_label_code,
cu.region_code
cu.region_code,
(SELECT date_format(inspection_date,'%Y-%m-%d %h:%m:%s') from tz_cylinder_filling where sequence_code = ci.sequence_code and app_id = cu.app_id ORDER BY inspection_date desc limit 1) as inspectionDate
FROM
tz_cylinder_info AS ci
LEFT JOIN cb_data_dictionary AS d1 ON d1.type = 'CZJZMC' AND d1.code = ci.filling_media
......@@ -335,6 +336,93 @@
where ci.is_not_es IS NULL
AND region_code is not null
</select>
<select id="timeOutList" resultType="java.util.Map">
SELECT DISTINCT(onlyCode),sequence_code,status,expire_day,unit_name
FROM(
SELECT
concat(insp.app_id,insp.sequence_code) as onlyCode,
insp.sequence_code,
unit.unit_name ,
CASE
WHEN ( now() > ( to_date(( insp.next_inspection_date ), 'yyyy-mm-dd' )) ) THEN
'已超期'
WHEN ((
to_days (( to_date(( insp.next_inspection_date ) , 'yyyy-mm-dd' )) ) - to_days (
now())) &lt;= 30
) THEN
'即将超期'
END AS status,
concat ((
to_days (( to_date(( insp.next_inspection_date ) :: TEXT, 'yyyy-mm-dd' :: TEXT )) ) - to_days (
now())),
'天'
) AS expire_day
FROM
tz_cylinder_inspection insp
LEFT JOIN tz_cylinder_unit unit ON insp.app_id = unit.app_id
WHERE
(to_date( insp.next_inspection_date, 'yyyy-mm-dd' ) &lt; now()
OR (( to_days ( to_date(( insp.next_inspection_date ), 'yyyy-mm-dd' ) ) - to_days ( now())) &lt;= 30 ))
<if test="companyId != null and companyId != ''">
and unit.app_id = #{companyId}
</if>
<if test="regionCode != null and regionCode != ''">
and unit.region_code like concat('%',#{regionCode},'%')
</if>
)
</select>
<select id="licenceList" resultType="java.util.Map">
SELECT status,
filling_perm_scope,
filling_permit_date,
unit_name
FROM view_licence_unit_table
<where>
<if test="companyId != null and companyId != ''">
app_id = #{companyId}
</if>
</where>
</select>
<select id="countNumber" resultType="java.lang.Integer">
SELECT count(DISTINCT(onlyCode))
FROM(
SELECT
concat(insp.app_id,insp.sequence_code) as onlyCode,
insp.sequence_code,
unit.unit_name ,
CASE
WHEN ( now() > ( to_date(( insp.next_inspection_date ), 'yyyy-mm-dd' )) ) THEN
'已超期'
WHEN ((
to_days (( to_date(( insp.next_inspection_date ) , 'yyyy-mm-dd' )) ) - to_days (
now())) &lt;= 30
) THEN
'即将超期'
END AS status,
concat ((
to_days (( to_date(( insp.next_inspection_date ) :: TEXT, 'yyyy-mm-dd' :: TEXT )) ) - to_days (
now())),
'天'
) AS expire_day
FROM
tz_cylinder_inspection insp
LEFT JOIN tz_cylinder_unit unit ON insp.app_id = unit.app_id
WHERE
(to_date( insp.next_inspection_date, 'yyyy-mm-dd' ) &lt; now()
OR (( to_days ( to_date(( insp.next_inspection_date ), 'yyyy-mm-dd' ) ) - to_days ( now())) &lt;= 30 ))
<if test="companyId != null and companyId != ''">
and unit.app_id = #{companyId}
</if>
)where status = #{status}
<if test="regionCode != null and regionCode != ''">
and unit.region_code like concat('%',#{regionCode},'%')
</if>
</select>
<update id="updateEsCylinderInfoStatus">
UPDATE tz_cylinder_info SET "is_not_es" = 1 WHERE "sequence_nbr" IN
......
......@@ -1200,4 +1200,133 @@ public class CylinderInfoController extends BaseController {
return ResponseHelper.buildResponse(true);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "超期列表")
@GetMapping(value = "/timeOutList")
public ResponseModel<Object> timeOutList(@RequestParam("number") Long number, @RequestParam("size") Long size, @RequestParam(value = "companyId", required = false) String companyId, @RequestParam(value = "regionCode", required = false) String regionCode) {
Page<Map<String, Object>> page = new Page<>(number, size);
HashMap<String, Object> map = new HashMap<>();
HashMap<String, Object> result = new HashMap<>();
Page<Map<String, Object>> mapPage = cylinderInfoServiceImpl.getBaseMapper().timeOutList(page, companyId, regionCode);
// 组装分页信息
map.put("current", page.getCurrent());
map.put("pageSize", page.getSize());
map.put("total", mapPage.getTotal());
map.put("pagination", false);
map.put("totalPage", mapPage.getPages());
map.put("dataList", mapPage.getRecords());
result.put("dataGridMock", map);
// 组装表头信息
ArrayList<Map<String, Object>> maps = new ArrayList<>();
HashMap<String, Object> status = new HashMap<>();
status.put("fid", "status");
status.put("dataIndex", "status");
status.put("name", "状态");
status.put("title", "状态");
status.put("type", "dataGrid");
status.put("key", "status");
maps.add(status);
// 检验有效期
HashMap<String, Object> expire_day = new HashMap<>();
expire_day.put("fid", "expire_day");
expire_day.put("dataIndex", "expire_day");
expire_day.put("name", "检验有效期");
expire_day.put("title", "检验有效期");
expire_day.put("type", "dataGrid");
expire_day.put("key", "expire_day");
maps.add(expire_day);
// 气瓶编码
HashMap<String, Object> sequence_code = new HashMap<>();
sequence_code.put("fid", "sequence_code");
sequence_code.put("dataIndex", "sequence_code");
sequence_code.put("name", "气瓶编码");
sequence_code.put("title", "气瓶编码");
sequence_code.put("type", "dataGrid");
sequence_code.put("key", "sequence_code");
maps.add(sequence_code);
// 产权单位
HashMap<String, Object> unit_name = new HashMap<>();
unit_name.put("fid", "unit_name");
unit_name.put("dataIndex", "unit_name");
unit_name.put("name", "产权单位");
unit_name.put("title", "产权单位");
unit_name.put("type", "dataGrid");
unit_name.put("key", "unit_name");
maps.add(unit_name);
result.put("colModel", maps);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "许可列表")
@GetMapping(value = "/licenceList")
public ResponseModel<Object> licenceList(@RequestParam("number") Long number, @RequestParam("size") Long size, @RequestParam(value = "companyId", required = false) String companyId) {
Page<Map<String, Object>> page = new Page<>(number, size);
HashMap<String, Object> map = new HashMap<>();
HashMap<String, Object> result = new HashMap<>();
Page<Map<String, Object>> mapPage = cylinderInfoServiceImpl.getBaseMapper().licenceList(page, companyId);
// 组装分页信息
map.put("current", page.getCurrent());
map.put("pageSize", page.getSize());
map.put("total", mapPage.getTotal());
map.put("pagination", false);
map.put("totalPage", mapPage.getPages());
map.put("dataList", mapPage.getRecords());
result.put("dataGridMock", map);
// 组装表头信息
ArrayList<Map<String, Object>> maps = new ArrayList<>();
HashMap<String, Object> status = new HashMap<>();
status.put("fid", "status");
status.put("dataIndex", "status");
status.put("name", "状态");
status.put("title", "状态");
status.put("type", "dataGrid");
status.put("key", "status");
maps.add(status);
// 许可范围
HashMap<String, Object> filling_perm_scope = new HashMap<>();
filling_perm_scope.put("fid", "filling_perm_scope");
filling_perm_scope.put("dataIndex", "filling_perm_scope");
filling_perm_scope.put("name", "检验有效期");
filling_perm_scope.put("title", "检验有效期");
filling_perm_scope.put("type", "dataGrid");
filling_perm_scope.put("key", "expire_day");
maps.add(filling_perm_scope);
// 许可有效期
HashMap<String, Object> filling_permit_date = new HashMap<>();
filling_permit_date.put("fid", "filling_permit_date");
filling_permit_date.put("dataIndex", "filling_permit_date");
filling_permit_date.put("name", "许可范围");
filling_permit_date.put("title", "许可范围");
filling_permit_date.put("type", "dataGrid");
filling_permit_date.put("key", "sequence_code");
maps.add(filling_permit_date);
// 气瓶企业
HashMap<String, Object> unit_name = new HashMap<>();
unit_name.put("fid", "unit_name");
unit_name.put("dataIndex", "unit_name");
unit_name.put("name", "气瓶企业");
unit_name.put("title", "气瓶企业");
unit_name.put("type", "dataGrid");
unit_name.put("key", "unit_name");
maps.add(unit_name);
result.put("colModel", maps);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "统计")
@GetMapping(value = "/countNumber")
public ResponseModel<Object> countNumber(@RequestParam("status") String status, @RequestParam(value = "companyId", required = false) String companyId, @RequestParam(value = "regionCode", required = false) String regionCode) {
HashMap<String, Object> map = new HashMap<>();
int number = cylinderInfoServiceImpl.getBaseMapper().countNumber(status, companyId, regionCode);
map.put("status", number);
return ResponseHelper.buildResponse(map);
}
}
......@@ -48,7 +48,9 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -467,6 +469,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
@Override
public void synUnitCylinderFillingData() {
DecimalFormat df = new DecimalFormat("#0.00");
cylinderFillingDataUnitServiceImpl.remove(new LambdaQueryWrapper<>());
countByUnit(cylinderUnit -> {
// 按照月份 获取数据 取一年数据
......@@ -485,7 +488,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
// 本月
Double thisMonth = cylinderFillingRecordServiceImpl.getFillingSumByMonth(cylinderUnit.getAppId(),
calendar.getTime());
temp.setTotalSum(thisMonth);
temp.setTotalSum(Double.valueOf(df.format(thisMonth)));
calendar.add(Calendar.MONTH, -1);
// 上月
Double lastMonth = cylinderFillingRecordServiceImpl.getFillingSumByMonth(cylinderUnit.getAppId(),
......@@ -499,6 +502,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
temp.setChangePercent((int) (percent * 100) + "");
temp.setAppId(cylinderUnit.getAppId());
temp.setChangeSum(thisMonth - lastMonth);
temp.setChangeSum(Double.valueOf(df.format(temp.getChangeSum())));
cylinderFillingDataUnitServiceImpl.createWithModel(temp);
}
});
......@@ -667,6 +671,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
* @param cylinderFillingCheckDataUnitDto
*/
public void calcCylinderFillingCheckDataUnitData(CylinderUnit cylinderUnit, Calendar calender, CylinderFillingCheckDataUnitDto cylinderFillingCheckDataUnitDto) {
DecimalFormat df = new DecimalFormat("#0.00");
String year = calender.get(Calendar.YEAR) + "";
int month = calender.get(Calendar.MONTH) + 1;
String monthStr = month < 10 ? "0" + month : month + "";
......@@ -687,14 +692,14 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
before = (double) (fillingCount) / (double) countThisMonth;
}
cylinderFillingCheckDataUnitDto.setFillingCount((long) fillingCount);
cylinderFillingCheckDataUnitDto.setFillingPercent(before * 100);
cylinderFillingCheckDataUnitDto.setFillingPercent(Double.valueOf(df.format(before * 100)));
// 充装后检查率:充装后检查次数/充装次数
double after = 0d;
if (countThisMonth != 0) {
after = (double) (fillingCheckCount) / (double) countThisMonth;
}
cylinderFillingCheckDataUnitDto.setFillingCheckCount((long) fillingCheckCount);
cylinderFillingCheckDataUnitDto.setFillingCheckPercent(after * 100);
cylinderFillingCheckDataUnitDto.setFillingCheckPercent(Double.valueOf(df.format(after * 100)));
// 充装合格率:充装前检查合格次数+充装后检查合格次数/2*充装次数
double passed = 0d;
// 充装前检查合格次数
......@@ -709,7 +714,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
}
cylinderFillingCheckDataUnitDto.setFillingPassedCount((long) (fillingPassedCount + fillingCheckPassedCount));
cylinderFillingCheckDataUnitDto.setTotalSumDouble((long) 2 * countThisMonth);
cylinderFillingCheckDataUnitDto.setFillingPassedPercent(passed * 100);
cylinderFillingCheckDataUnitDto.setFillingPassedPercent(Double.valueOf(df.format(passed * 100)));
cylinderFillingCheckDataUnitDto.setAppId(cylinderUnit.getAppId());
}
......
......@@ -102,7 +102,7 @@ public class JgEquipTransferDto extends BaseDto {
private String factoryNum;
@ApiModelProperty(value = "设备注册代码")
private String equRegisterCode;
private String equCode;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
......
......@@ -23,14 +23,15 @@
jet.instance_status AS instanceStatus,
jet.accept_date AS acceptDate,
jet.task_name AS taskName,
ri.equ_list AS equList,
ri.equ_category AS equCategory,
ri.equ_define AS equDefine,
ri.product_name AS productName,
ri.brand_name AS brandName,
ri.equ_type AS equType,
ri.equ_price AS equPrice,
ri.product_photo AS productPhoto,
ri.EQU_LIST AS equList,
ri.EQU_CATEGORY AS equCategory,
ri.EQU_DEFINE AS equDefine,
ri.PRODUCT_NAME AS productName,
ri.BRAND_NAME AS brandName,
ri.EQU_TYPE AS equType,
ri.EQU_PRICE AS equPrice,
ri.PRODUCT_PHOTO AS productPhoto,
ri.EQU_CODE,
di.design_unit_credit_code AS designUnitCreditCode,
di.design_unit_name AS designUnitName,
di.design_license_num AS designLicenseNum,
......@@ -53,7 +54,7 @@
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
CONCAT(ui.PROVINCE_NAME,'', ui.CITY_NAME, ' ', ui.COUNTY_NAME, ' ', ui.ADDRESS, ' ', ui.street_name) AS concatenatedAddress,
CONCAT_WS(', ',ui.PROVINCE_NAME, ui.CITY_NAME, ui.COUNTY_NAME, ui.STREET_NAME, ui.ADDRESS) AS concatenatedAddress,
ui.USE_INNER_CODE AS useInnerCode,
oi.SUPERVISORY_CODE AS supervisoryCode
FROM
......@@ -120,6 +121,7 @@
ri.equ_type AS equType,
ri.equ_price AS equPrice,
ri.product_photo AS productPhoto,
ri.EQU_CODE as equCode,
di.design_unit_credit_code AS designUnitCreditCode,
di.design_unit_name AS designUnitName,
di.design_license_num AS designLicenseNum,
......
......@@ -343,7 +343,7 @@ public class CommonServiceImpl implements ICommonService {
map.put("giveOutMonth", Optional.ofNullable(map.get("giveOutMonth")).orElse("").toString()); // 发证日期-月
map.put("giveOutDay", Optional.ofNullable(map.get("giveOutDay")).orElse("").toString()); // 发证日期-日
// 生成二维码
String qrCode = ImageUtils.generateQRCode(Optional.ofNullable(map.get("supervisoryCode")).orElse("").toString(), 70, 65);
String qrCode = ImageUtils.generateQRCode(Optional.ofNullable(map.get("supervisoryCode")).orElse("").toString(), 100, 100);
map.put("supervisoryCode", qrCode); // 监管二维码
// word转pdf
......
......@@ -553,6 +553,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if (ObjectUtils.isEmpty(map.getString("SEQUENCE_NBR")) && ObjectUtils.isEmpty(map.getString("useUnitCreditCode"))) {
if (!ValidationUtil.isEmpty(type) && type.contains("使用单位")) {
if(ValidationUtil.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))){
map.put("USE_UNIT_CREDIT_CODE", companyCode);
......@@ -564,12 +565,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
result.setTotal(0);
return result;
}
}
// 默认条件【STATUS==="" || null】
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.boolQuery()
.should(QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery("STATUS")))
.should(QueryBuilders.boolQuery().must(QueryBuilders.matchPhraseQuery("STATUS", ""))));
meBuilder.should(QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery("STATUS")));
meBuilder.should(QueryBuilders.boolQuery().must(QueryBuilders.matchPhraseQuery("STATUS", "")));
meBuilder.minimumShouldMatch(1);
boolMust.must(meBuilder);
String queryType = map.getString("QUERY_TYPE");
......@@ -635,24 +637,25 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BoolQueryBuilder ubuilder = QueryBuilders.boolQuery();
String useCode = QueryParser.escape(map.getString("USE_UNIT_CREDIT_CODE"));
useCode = useCode.contains("_") ? useCode.split("_")[0] : useCode;
ubuilder.should(QueryBuilders.termQuery("USE_UNIT_CREDIT_CODE.keyword", useCode));
ubuilder.should(QueryBuilders.matchQuery("USE_UNIT_CREDIT_CODE", useCode));
String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
ubuilder.should(QueryBuilders.termQuery("USC_UNIT_CREDIT_CODE.keyword", uscCode));
ubuilder.should(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", "*" + uscCode + "*"));
ubuilder.minimumShouldMatch(1);
boolMust.must(ubuilder);
}else {
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE")) || !ObjectUtils.isEmpty(map.getString("useUnitCreditCode"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USE_UNIT_CREDIT_CODE"));
String uucc = !ValidationUtil.isEmpty(map.getString("USE_UNIT_CREDIT_CODE")) ? map.getString("USE_UNIT_CREDIT_CODE") : map.getString("useUnitCreditCode");
String param = QueryParser.escape(uucc);
param = param.contains("_") ? param.split("_")[0] : param;
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", param));
uuccBuilder.must(QueryBuilders.matchQuery("USE_UNIT_CREDIT_CODE", param));
boolMust.must(uuccBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", param));
String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", "*" + uscCode + "*"));
boolMust.must(uuccBuilder);
}
}
......@@ -729,6 +732,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(company)) {
object.put("level", company.getLevel());
object.put("orgCode", company.getOrgCode());
object.put("companyName", company.getCompanyName());
object.put("companyCode", company.getCompanyCode());
CompanyModel result = Privilege.companyClient.queryByCompanyCode(company.getCompanyCode()).getResult();
if(!ValidationUtil.isEmpty(result)){
......@@ -768,9 +772,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgFactoryInfoService.saveOrUpdateData(factoryInfo);
//施工信息
JSONObject company = getCompanyType();
String companyName = company.getString("companyName");
String companyCode = company.getString("companyCode").contains("_") ?
company.getString("companyCode").split("_")[1] : company.getString("companyCode");
IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgConstructionInfo.class);
constructionInfo.setRecord(record);
constructionInfo.setRecDate(date);
constructionInfo.setUscUnitCreditCode(companyCode);
constructionInfo.setUscUnitName(companyName);
constructionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : String.valueOf(equipmentInfoForm.get("CONSTRUCTIONINFO_SEQ")));
iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo);
......
......@@ -430,6 +430,7 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
public void flowExecute(Long id, String instanceId, String operate, String comment) {
try {
JgChangeRegistrationName jgChangeRegistrationName = this.getBaseMapper().selectById(id);
JSONObject task = workFlowFeignService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -440,6 +441,11 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
if (!ObjectUtils.isEmpty(jgChangeRegistrationName.getInstanceStatus()) &&
(jgChangeRegistrationName.getInstanceStatus().equals(WorkFlowStatusEnum.UNIT_RENAME_SUBMIT.getReject()) ||
jgChangeRegistrationName.getInstanceStatus().equals(WorkFlowStatusEnum.UNIT_RENAME_SUBMIT.getRollBack()))) {
map.put("approvalStatus", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......
......@@ -304,49 +304,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
}
this.getBaseMapper().updateById(jgChangeRegistrationReform);
}
// public String flowExecute(Long id, String instanceId, String operate, String comment, Boolean update) {
// String role = "";
// String taskName = "流程结束";
// ArrayList<String> roleList = new ArrayList<>();
// try {
// JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
// JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
// String taskId = taskMessage.getString("id");
// //组装信息
// TaskResultDTO dto = new TaskResultDTO();
// dto.setResultCode("approvalStatus");
// dto.setTaskId(taskId);
// dto.setComment(comment);
// HashMap<String, Object> map = new HashMap<>();
// map.put("approvalStatus", operate);
// dto.setVariable(map);
// //执行流程
// Workflow.taskClient.completeByTask(taskId, dto);
// // 查询下节点任务
// JSONObject taskNoAuth = workFlowFeginService.getTaskNoAuth(instanceId);
// if (!ObjectUtils.isEmpty(taskNoAuth.get("data"))) {
// JSONObject nextTask = JSON.parseObject(JSON.toJSONString(taskNoAuth.get("data")));
// String nextTaskId = nextTask.getString("id");
// taskName = nextTask.getString("name");
// AjaxResult taskGroupName = Workflow.taskClient.getTaskGroupName(nextTaskId);
// JSONArray data = JSON.parseArray(JSON.toJSONString(taskGroupName.get("data")));
// for (Object datum : data) {
// if (((Map) datum).containsKey("groupId")) {
// roleList.add(((Map) datum).get("groupId").toString());
// }
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// role = String.join(",", roleList);
// if (update) {
// Boolean rollBack = "1".equals(operate) ? true : false;
// updateStatus(id, instanceId, taskName, role, rollBack);
// }
// return role;
// }
public void flowExecute(Long id, String instanceId, String operate, String comment) {
try {
......@@ -361,6 +318,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
//2023年12月27日16点33分 流程状态为起草人撤回或者一级审批驳回时需要将提交时的已同意修改为已提交
if(!ObjectUtils.isEmpty(jgChangeRegistrationReform)&&(jgChangeRegistrationReform.getStatus().equals(WorkFlowStatusEnum.CHANGE_SUBMIT.getRollBack())||jgChangeRegistrationReform.getStatus().equals(WorkFlowStatusEnum.CHANGE_SUBMIT.getReject()))){
map.put("approvalStatus", "提交");
}
......@@ -374,36 +332,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
updateExecuteIds(instanceId, id, operate);
}
// public void updateStatus(Long id, String instanceId, String taskName, String role, Boolean rollBack) {
// ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// LambdaQueryWrapper<JgChangeRegistrationReform> lambda = new QueryWrapper<JgChangeRegistrationReform>().lambda();
// lambda.eq(JgChangeRegistrationReform::getSequenceNbr, id);
// JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectOne(lambda);
// if ("流程结束".equals(taskName)) {
// JgChangeRegistrationReformEq jgChangeRegistrationReformEq = jgChangeRegistrationReformEqMapper.selectOne(new QueryWrapper<JgChangeRegistrationReformEq>().eq("equip_transfer_id", jgChangeRegistrationReform.getSequenceNbr()));
// jgChangeRegistrationReform.setStatus("已完成");
// jgChangeRegistrationReform.setAuditStatus(RenovationRegistrationWorkFlowStatusEnum.COMPLETE.getName());
//
// //交换历史数据与新增数据
// updateTechparamsByEquIdAndCurrentDoucumentId(jgChangeRegistrationReformEq.getEquId(), jgChangeRegistrationReform.getSequenceNbr().toString(), jgChangeRegistrationReform.getSupervisoryCode());
// } else {
// jgChangeRegistrationReform.setNextExecutorIds(role);
// jgChangeRegistrationReform.setPromoter(reginParams.getUserModel().getUserId());
// if (!ObjectUtils.isEmpty(jgChangeRegistrationReform.getInstanceStatus())) {
// jgChangeRegistrationReform.setInstanceStatus(jgChangeRegistrationReform.getInstanceStatus() + "," + role);
// } else {
// jgChangeRegistrationReform.setInstanceStatus(role);
// }
// }
// if (rollBack) {
// jgChangeRegistrationReform.setAuditStatus(RenovationRegistrationWorkFlowStatusEnum.getMessage(taskName).getReject());
// this.getBaseMapper().update(jgChangeRegistrationReform, lambda);
// this.getBaseMapper().updatePromoter(jgChangeRegistrationReform.getSequenceNbr());
// } else {
// jgChangeRegistrationReform.setAuditStatus(RenovationRegistrationWorkFlowStatusEnum.getMessage(taskName).getPass());
// this.getBaseMapper().update(jgChangeRegistrationReform, lambda);
// }
// }
public void withdraw(String instanceId) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
......
......@@ -654,6 +654,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
} else {
jgChangeRegistrationUnit.setPromoter("");
jgChangeRegistrationUnit.setNextExecutorIds(String.join(",", roleList));
jgChangeRegistrationUnit.setStatus(WorkFlowStatusEnum.getMessage(taskName[0]).getReject());
}
JgChangeRegistrationUnitMapper.updateById(jgChangeRegistrationUnit);
......
......@@ -140,6 +140,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
public void flowExecute(Long id, String instanceId, String operate, String comment) {
try {
JgEnableDisable jgEnableDisable = this.baseMapper.selectById(id);
JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -150,6 +151,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
if (WorkFlowStatusEnum.ENABLE_SUBMIT.getReject().equals(jgEnableDisable.getAuditStatus()) || WorkFlowStatusEnum.ENABLE_SUBMIT.getRollBack().equals(jgEnableDisable.getAuditStatus())) {
map.put("approvalStatus", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -304,6 +305,8 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
String userId = RequestContext.getExeUserId();
JgEquipTransfer jgEquipTransfer = this.baseMapper.selectById(jgEquipTransferDto.getSequenceNbr());
jgEquipTransfer.setProcessAdvice(jgEquipTransferDto.getProcessAdvice());
JgEquipTransferEq jgEquipTransferEq = jgEquipTransferEqMapper.selectOne(Wrappers.<JgEquipTransferEq>lambdaQuery().select(JgEquipTransferEq::getEquId)
.eq(JgEquipTransferEq::getEquipTransferId, jgEquipTransferDto.getSequenceNbr()));
ArrayList<String> roleList = new ArrayList<>();
boolean submit = submit(jgEquipTransfer, op);
......@@ -315,6 +318,14 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
if (roleList.isEmpty()) {
jgEquipTransfer.setApplyStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
jgEquipTransfer.setPromoter("");
if (jgEquipTransferEq != null){
Map<String,Map<String,Object>> resultMap = new HashMap<>();
Map<String,Object> esParamMap =new HashMap<>();
esParamMap.put("USC_UNIT_NAME", jgEquipTransfer.getInstallUnitName());
esParamMap.put("USC_UNIT_CREDIT_CODE", jgEquipTransfer.getInstallUnitName());
resultMap.put(jgEquipTransferEq.getEquId(),esParamMap);
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
}
} else {
jgEquipTransfer.setNextExecuteIds(String.join(",", roleList));
if (!ObjectUtils.isEmpty(jgEquipTransfer.getInstanceStatus())) {
......
......@@ -780,6 +780,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 使用信息表更新是否西咸
IdxBizJgUseInfo useInfo = useInfoService.getOneData(jgRelationEquip.getEquId());
if (!ObjectUtils.isEmpty(useInfo)) {
useInfo.setUseUnitCreditCode(jgInstallationNotice.getUseUnitCreditCode());
useInfo.setUseUnitName(jgInstallationNotice.getUseUnitName());
useInfo.setIsNotXiXian(jgInstallationNotice.getIsXixian() == null ? "0" : jgInstallationNotice.getIsXixian());
useInfoService.saveOrUpdateData(useInfo);
}
......
......@@ -133,8 +133,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
return maintenanceContractMapper.updateBySequenceNbr(dto);
}
public void flowExecute(Long id,String instanceId, String operate, String comment, Boolean update) {
public void flowExecute(Long id, String instanceId, String operate, String comment, Boolean update) {
try {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id);
JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -145,6 +146,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
if (WorkFlowStatusEnum.MAIN_SUBMIT.getReject().equals(jgMaintenanceContract.getStatus()) || WorkFlowStatusEnum.MAIN_SUBMIT.getRollBack().equals(jgMaintenanceContract.getStatus())) {
map.put("approvalStatus", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel;
import com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancelEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CancelTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper;
......@@ -443,6 +444,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
public void flowExecute(Long id, String instanceId, String operate, String comment) {
try {
JgScrapCancel jgScrapCancel = this.getBaseMapper().selectById(id);
JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -453,6 +455,11 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
if (!ObjectUtils.isEmpty(jgScrapCancel.getInstanceStatus()) &&
(jgScrapCancel.getInstanceStatus().equals(WorkFlowStatusEnum.CANCEL_SUBMIT.getReject()) ||
jgScrapCancel.getInstanceStatus().equals(WorkFlowStatusEnum.CANCEL_SUBMIT.getRollBack()))) {
map.put("approvalStatus", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......@@ -541,7 +548,11 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
map1.put("ORG_BRANCH_NAME", "");
}
resultMap.put(jgScrapCancelEq.getEquId(), map1);
try {
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
} catch (Exception e) {
e.printStackTrace();
}
jgScrapCancel.setAuditStatus(FlowStatusEnum.TO_BE_FINISHED.getName());
jgScrapCancel.setAuditPassDate(new Date());
}
......
......@@ -548,7 +548,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
dto.setTaskId(taskId);
dto.setComment("提交流程");
HashMap<String, Object> map = new HashMap<>();
if(notice.getNoticeStatus().equals("6614") || notice.getNoticeStatus().equals("6615") ) {
map.put("approvalStatus", "提交");
} else {
map.put("approvalStatus", op);
}
dto.setVariable(map);
//执行流程
AjaxResult ajaxResult1 = null;
......
......@@ -324,6 +324,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public void flowExecute(Long id, String instanceId, String operate, String comment) {
try {
JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(id);
JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -334,6 +335,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
dto.setComment(comment);
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", operate);
if (jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getReject()) || jgUseRegistration.getStatus().equals(WorkFlowStatusEnum.USE_SUBMIT.getRollBack())) {
map.put("approvalStatus", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......
......@@ -328,7 +328,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
jyjcOpeningApplicationModel = new JyjcOpeningApplicationModel();
unitCode = reginParams.getCompany().getCompanyCode();
}
// unitCode = "91611103MAC4Q1EG7B"; // 测试用,之后务必删除!!!
QueryWrapper enterpriseInfoQueryWrapper = new QueryWrapper<>();
enterpriseInfoQueryWrapper.eq("use_code", unitCode);
TzBaseEnterpriseInfo baseUnitLicenceEntity = enterpriseInfoMapper.selectOne(enterpriseInfoQueryWrapper);
......@@ -363,7 +362,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 获取检验人员信息
QueryWrapper userInfoQueryWrapper = new QueryWrapper<>();
userInfoQueryWrapper.eq("unit_code", unitCode);
if (StringUtils.isBlank(jyjcOpeningApplicationModel.getWorkflowProstanceId())) {
// 如果未开启流程则只查询未被删除的用户
userInfoQueryWrapper.eq("is_delete", false);
}
List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper);
if (!ValidationUtil.isEmpty(userInfos)) {
// List<String> codes = userInfos.stream()
......
spring.application.name=TZS-JYJC-YY
spring.application.name=TZS-JYJC
server.servlet.context-path=/jyjc
server.port=12000
spring.profiles.active=dev
......
......@@ -95,7 +95,6 @@
CONSTRUCTION_TYPE,
USC_UNIT_CREDIT_CODE,
USC_UNIT_NAME,
DATE_FORMAT(USC_DATE, '%Y-%m-%d %H:%i:%s') as USC_DATE,
EQU_DEFINE,
EQU_DEFINE_CODE,
PRODUCT_NAME,
......
......@@ -2471,6 +2471,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if(paramMap.isEmpty()){
return null;
}
String oldUscUnitCreditCode = "";
String oldUscUnitName = "";
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<String, Map<String, Object>> entry : paramMap.entrySet()) {
String record = entry.getKey();
......@@ -2481,15 +2483,22 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if(!ObjectUtils.isEmpty(optional)){
oldData = optional.get();
oldUscUnitCreditCode = oldData.getUSC_UNIT_CREDIT_CODE();
oldUscUnitName = oldData.getUSC_UNIT_NAME();
}
//获取Es中新的参数
ESEquipmentCategoryDto newData = JSON.parseObject(toJSONString(childMap), ESEquipmentCategoryDto.class);
String newUscUnitCreditCode = newData.getUSC_UNIT_CREDIT_CODE();
String newUscUnitName = newData.getUSC_UNIT_NAME();
//删除Es中旧的数据
if (!ObjectUtils.isEmpty(oldData)) {
esEquipmentCategory.deleteById(record);
//整合新旧数据
Bean.copyExistPropertis(newData, oldData);
//处理施工单位信息
oldData.setUSC_UNIT_CREDIT_CODE(oldUscUnitCreditCode+","+newUscUnitCreditCode);
oldData.setUSC_UNIT_NAME(oldUscUnitName+","+newUscUnitName);
}
if (!ObjectUtils.isEmpty(oldData)) {
oldData.setREC_DATE(System.currentTimeMillis());
......
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