Commit f9867c66 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' into develop_tzs_1227

parents 931c4cca d4d0f8f0
package com.yeejoin.amos.boot.biz.common.dto;
import lombok.Data;
import java.util.Date;
@Data
public class SystemCtlTaskModel extends BaseDto{
/**
* 任务名称
*/
private String taskName;
/**
* 任务标题
*/
private String taskTitle;
/**
* 任务编号
*/
private String taskCode;
/**
* 内容
*/
private String taskContent;
/**
* 描述
*/
private String taskDesc;
/**
* 任务类型
*/
private String taskType;
/**
* 任务类型label
*/
private String taskTypeLabel;
/**
* 关联id
*/
private String relationId;
/**
* 执行人用户ids
*/
private String executeUserIds;
/**
* 任务状态
*/
private Integer taskStatus;
/**
* 任务状态 (展示态)
*/
private String taskStatusLabel;
/**
* 发起人
*/
private String startUserId;
/**
* 发起人
*/
private String startUser;
/**
* 发起时间
*/
private Date startDate;
/**
* 结束人
*/
private String endUserId;
/**
* 结束时间
*/
private Date endDate;
/**
* 流程创建人(同recUserId)
*/
private String createUserId;
/**
* 流程创建时间
*/
private Date createDate;
/**
* 详情路径
*/
private String routePath;
private String agencyCode;
/**
* 任务来源
*/
private String taskSource;
/**
* 扩展字段
*/
private String extras;
/**
* 终端标识
*/
private String terminal;
}
......@@ -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());
}
......
......@@ -126,7 +126,9 @@ public class TzCylinderServiceImpl extends BaseService<TzCylinderInfoDto, Cylind
for (TzCylinderFillingDto tzCylinderFillingDto : tzCylinderFillingDtoList) {
Double fillingQuantity = Double.valueOf(ObjectUtils.isEmpty(tzCylinderFillingDto.getFillingQuantity()) ? "0" : tzCylinderFillingDto.getFillingQuantity());
tzCylinderFillingDto.setFillingQuantity(new DecimalFormat("#.00").format(fillingQuantity));
tzCylinderFillingDto.setFillingQuantity(new DecimalFormat("#0.00").format(fillingQuantity));
Double temperature = Double.valueOf(ObjectUtils.isEmpty(tzCylinderFillingDto.getTemperature()) ? "0" : tzCylinderFillingDto.getTemperature());
tzCylinderFillingDto.setTemperature(new DecimalFormat("#0.00").format(temperature));
if (!ValidationUtil.isEmpty(tzCylinderFillingDto) && !ValidationUtil.isEmpty(tzCylinderFillingDto.getAbnormal())) {
tzCylinderFillingDto.setAbnormal(CyclinderStatus.getName(String.valueOf(tzCylinderFillingDto.getAbnormal())));
}
......
......@@ -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;
......
......@@ -17,8 +17,6 @@ import java.util.Map;
public interface JgEquipTransferMapper extends CustomBaseMapper<JgEquipTransfer> {
Page<JgEquipTransferDto> queryForPage(Page<JgEquipTransferDto> page, @Param("param") JgEquipTransferDto model, @Param("type") String type, @Param("companyCode") String companyCode);
void updatePromoter(@Param("id")Long id);
@MapKey("sequenceNbr")
List<Map<String, Object>> queryEquipInformation(Long sequenceNbr);
}
......@@ -20,6 +20,10 @@ public interface PrivilegeFeginService {
@RequestMapping(value = "/privilege/v1/company/tree", method = RequestMethod.GET)
FeignClientResult tree(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product);
@RequestMapping(value = {"/privilege/v1/company/tree/cache"}, method = {RequestMethod.GET})
FeignClientResult queryAgencyTreeForCache(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product) throws InnerInvokException;
//获取省级行政区划
@RequestMapping(value = "systemctl/v1/region/level", method = RequestMethod.GET)
FeignClientResult getProvince(@RequestParam String level);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgEquipTransferMapper">
<update id="updatePromoter">
</update>
<select id="queryForPage" resultType="com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto">
select
jet.sequence_nbr AS sequenceNbr,
......@@ -23,14 +19,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 +50,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
......@@ -71,8 +68,8 @@
<if test="param.applyNo != null and param.applyNo != ''">
AND jet.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
<if test="param.useUnitName != null and param.useUnitName != ''">
AND jet.use_unit_name LIKE CONCAT('%', #{param.useUnitName}, '%')
<if test="param.useUnitCreditCode != null and param.useUnitCreditCode != ''">
AND jet.use_unit_credit_code = #{param.useUnitCreditCode}
</if>
<if test="param.installUnitCreditCode != null and param.installUnitCreditCode != ''">
AND jet.install_unit_credit_code = #{param.installUnitCreditCode}
......@@ -120,6 +117,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,
......
......@@ -18,6 +18,9 @@
<if test="param.receiveOrgCode != null and param.receiveOrgCode != ''">
AND isn.receive_org_code = #{param.receiveOrgCode}
</if>
<if test="param.useUnitCreditCode != null and param.useUnitCreditCode != ''">
AND isn.use_unit_credit_code = #{param.useUnitCreditCode}
</if>
<if test="param.useUnitName != null and param.useUnitName != ''">
AND isn.use_unit_name LIKE CONCAT('%', #{param.useUnitName}, '%')
</if>
......
......@@ -124,13 +124,13 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
ei.legal_person AS safetyManager,
ei.legal_phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress,
ei.use_code AS useCode
eio.use_code AS useCode
FROM
tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr
......@@ -140,6 +140,7 @@
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info ei ON ei.use_code = tjtn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info eio ON eio.use_code = tjtn.install_unit_credit_code
WHERE
tjtn.sequence_nbr = #{sequenceNbr}
LIMIT 1
......
......@@ -13,6 +13,7 @@
date_format(reg_date,'%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.status,
other.CODE96333 code96333,
ur.receive_org_name as receiveOrgName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.PRODUCT_NAME as productName,
......@@ -32,6 +33,7 @@
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
<where>
and ur.is_delete = 0
......@@ -76,7 +78,7 @@
jri.PRODUCT_PHOTO as proDuctPhoto,
jfi.FACTORY_NUM as factoryNum,
jfi.PRODUCE_UNIT_NAME as produceUnitName,
jfi.PRODUCE_DATE as produceDate,
date_format(jfi.PRODUCE_DATE,'%Y-%m-%d') as produceDate,
jfi.FACTORY_STANDARD as factoryStandard,
jfi.PRODUCT_QUALITY_YIELD_PROVE as productQualityYieldProve,
jfi.INS_USE_MAINTAIN_EXPLAIN as insUseMaintainExplanin,
......@@ -109,6 +111,7 @@
USE_UNIT_CREDIT_CODE as useUnitCreditCode,
USE_PLACE as usePlace,
SAFETY_MANAGER as safetyManager,
SAFETY_MANAGER_CODE as safetyManagerCode,
PHONE as phone,
ESTATE_UNIT_NAME as estateUnitName,
ESTATE_UNIT_CREDIT_CODE as estateUnitCreditCode,
......
......@@ -67,6 +67,19 @@ public class CommonController extends BaseController {
return ResponseHelper.buildResponse(commonService.getTree());
}
/**
* 获取行政审批局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getApproveTree")
@ApiOperation(httpMethod = "GET", value = "获取行政审批局树", notes = "获取行政审批局树")
public ResponseModel<Object> getApproveTree() {
return ResponseHelper.buildResponse(commonService.getApproveTree());
}
/**
* 通过单位类型获取单位列表
*
......
......@@ -78,8 +78,9 @@ public class JgTransferNoticeByWorkFlowController {
// TODO 受理移装告知流程
LinkedHashMap model1 = (LinkedHashMap)model.get("model");
LinkedHashMap installationInfo = (LinkedHashMap)model1.get("transferNoticeInfo");
String opinion = model.get("opinion").toString();
JgTransferNoticeDto JgTransferNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgTransferNoticeDto.class);
jgTransferNoticeService.accept(JgTransferNoticeDto,op);
jgTransferNoticeService.accept(JgTransferNoticeDto, op, opinion);
return ResponseHelper.buildResponse(null);
}
}
......@@ -169,18 +169,16 @@ public class JgTransferNoticeController extends BaseController {
map.put("useUnitName", "西安市高科物业服务有限公司"); // 使用单位名称
map.put("fullAddress", "西安市曲江新区春临东街南湖意境1单元2号楼"); // 设备使用地点
map.put("equList", "电梯"); // 设备种类
map.put("equDefine", "曳引驱动电梯"); // 设备品种
map.put("equDefine", "曳引驱动电梯啊啊啊啊啊啊啊啊啊啊啊啊啊"); // 设备品种
map.put("equipCode", ""); // 设备代码
map.put("equCategory", "曳引电梯"); // 设备类别
map.put("useInnerCode", "KY-9527"); // 单位内编号
map.put("factoryNum", "G60001"); // 产品编号
map.put("equCategory", "曳引电梯噜啦噜啦嘞绿绿绿绿绿绿绿"); // 设备类别
map.put("useInnerCode", "KY-9527555555555555"); // 单位内编号
map.put("factoryNum", "FUCK-G600010000056"); // 产品编号
map.put("receiveOrgName", "西安市曲江新区质检院"); // 登记机关
map.put("giveOutYear", "2023"); // 发证日期-年
map.put("giveOutMonth", "12"); // 发证日期-月
map.put("giveOutDay", "26"); // 发证日期-日
// 生成二维码
String qrCode = ImageUtils.generateQRCode("YZGZ20231225001", 70, 65);
map.put("supervisoryCode", qrCode); // 监管二维码
map.put("supervisoryCode", "YZGZ20231225001"); // 监管二维码
commonService.generateCertificateReport(map, response);
}
}
......@@ -17,6 +17,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -133,4 +134,11 @@ public class JgUseRegistrationController extends BaseController {
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/export")
@ApiOperation(httpMethod = "GET", value = "导出使用登记证", notes = "导出使用登记证")
public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr){
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response);
}
}
package com.yeejoin.amos.boot.module.jg.biz.listener;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.StartPlatformTokenService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.component.emq.EmqxListener;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@Component
@Slf4j
public class PlatformUserTopicMessage extends EmqxListener {
private final String companyType = "行政审批局";
@Resource
protected EmqKeeper emqKeeper;
@Value("${amos.operation.log}")
private String amosOperationLog;
@PostConstruct
void init() throws Exception {
emqKeeper.subscript(amosOperationLog, 2, this);
}
@Value("${amos.agency.code}")
String amosAgencyCode;
@Autowired
RedisUtils redisUtil;
@Autowired
StartPlatformTokenService platformTokenService;
@Autowired
ICommonService commonService;
@Override
public void processMessage(String topic, MqttMessage message) {
platformTokenService.getToken();
JSONObject jsonObject = JSON.parseObject(message.toString());
JSONObject result = jsonObject.getJSONObject("result");
JSONObject dataResult = result.getJSONObject("result");
String path = result.getString("path");
String agencyCode = jsonObject.getString("agencyCode");
if (!amosAgencyCode.equals(agencyCode)) {
return;
}
try {
if (StringUtils.isNotEmpty(path)) {
if (dataResult.get("companyType").toString().contains(companyType)) {
commonService.creatApproveTree();
}
}
} catch (Exception e) {
log.info("平台同步消息失败:{}", e.getMessage());
}
log.info("平台推送消息同步完成");
}
}
......@@ -23,6 +23,7 @@ public interface ICommonService {
List<LinkedHashMap> getRegion(String level, String parentId);
List<LinkedHashMap> getTree();
List<LinkedHashMap> getApproveTree();
List<LinkedHashMap> creatTree();
......@@ -37,4 +38,6 @@ public interface ICommonService {
List<Map<String,Object>> getEnterpriseEmployee(String unitCode);
void generateCertificateReport(Map<String, Object> map, HttpServletResponse response);
List<LinkedHashMap> creatApproveTree();
}
......@@ -73,6 +73,9 @@ public class CommonServiceImpl implements ICommonService {
//管辖机构redis缓存key
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
//行政审批局redis缓存key
private static final String ADMINISTRATION_UNIT_TREE = "ADMINISTRATION_UNIT_TREE";
@Value("${regulator.unit.code}")
private String code;
......@@ -174,7 +177,7 @@ public class CommonServiceImpl implements ICommonService {
@Override
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
FeignClientResult tree = privilegeFeginService.queryAgencyTreeForCache(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
......@@ -184,6 +187,41 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
public List<LinkedHashMap> getApproveTree() {
List<LinkedHashMap> result = (List<LinkedHashMap>) redisUtils.get(ADMINISTRATION_UNIT_TREE);
//判断redis是否存在行政审批局树
return !ObjectUtils.isEmpty(result) ? result : creatApproveTree();
}
@Override
public List<LinkedHashMap> creatApproveTree() {
FeignClientResult tree = privilegeFeginService.queryAgencyTreeForCache(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> children = (List<LinkedHashMap>)result.get(0).get("children");
List<LinkedHashMap> treeData = deleteTreeData(children);
List<LinkedHashMap> resultTree = updateNullChildren(treeData);
redisUtils.set(ADMINISTRATION_UNIT_TREE, resultTree);
return resultTree;
}
private List<LinkedHashMap> deleteTreeData(List<LinkedHashMap> result) {
Iterator it = result.iterator();
while (it.hasNext()) {
LinkedHashMap e = (LinkedHashMap) it.next();
// 删除非行政审批局
if (!e.get("companyType").toString().contains("行政审批局")) {
it.remove();
}
if (!ObjectUtils.isEmpty(e.get("children"))) {
deleteTreeData((List<LinkedHashMap>) e.get("children"));
}
}
return result;
}
@Override
public List<Map<String, Object>> getUnitListByType(String type) {
if (type.equals("use")) {
......@@ -305,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
......@@ -341,6 +379,7 @@ public class CommonServiceImpl implements ICommonService {
}
}
/**
* word 转 pdf
*
......
......@@ -553,17 +553,25 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "使用单位")) {
map.put("USE_UNIT_CREDIT_CODE", companyCode);
} else if (!ValidationUtil.isEmpty(type) && ValidationUtil.equals(type, "安装改造维修单位")) {
map.put("USC_UNIT_CREDIT_CODE", companyCode);
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);
}
} else if (!ValidationUtil.isEmpty(type) && type.contains("安装改造维修单位")) {
map.put("USC_UNIT_CREDIT_CODE", companyCode);
}else {
result.setRecords(new ArrayList<>());
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");
......@@ -623,21 +631,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esBuilder.must(QueryBuilders.matchQuery("EQU_STATE", param));
boolMust.must(esBuilder);
}
//使用单位
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USE_UNIT_CREDIT_CODE"));
param = param.contains("_") ? param.split("_")[0] : param;
uuccBuilder.must(QueryBuilders.matchPhraseQuery("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));
boolMust.must(uuccBuilder);
//使用单位 //安装改造维修单位
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE")) && !ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))){
BoolQueryBuilder ubuilder = QueryBuilders.boolQuery();
String useCode = QueryParser.escape(map.getString("USE_UNIT_CREDIT_CODE"));
useCode = useCode.contains("_") ? useCode.split("_")[0] : useCode;
ubuilder.should(QueryBuilders.matchQuery("USE_UNIT_CREDIT_CODE", useCode));
String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
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")) || !ObjectUtils.isEmpty(map.getString("useUnitCreditCode"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
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.matchQuery("USE_UNIT_CREDIT_CODE", param));
boolMust.must(uuccBuilder);
}
if (!ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String uscCode = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", "*" + uscCode + "*"));
boolMust.must(uuccBuilder);
}
}
//监管码
if (!ObjectUtils.isEmpty(map.getString("SUPERVISORY_CODE"))) {
BoolQueryBuilder scBuilder = QueryBuilders.boolQuery();
......@@ -710,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)){
......@@ -749,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);
......
......@@ -18,7 +18,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto;
import com.yeejoin.amos.boot.module.jg.api.service.IJgRegistrationHistoryService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgUseInfoService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
......@@ -119,18 +118,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
public void save(JSONObject map) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
UseInfo useInfo = new UseInfo();
BeanUtil.copyProperties(map, useInfo);
String equipId = map.get("record").toString();
LambdaQueryWrapper<UseInfo> lambda = new QueryWrapper<UseInfo>().lambda();
lambda.eq(UseInfo::getRecord, equipId);
// 更新使用信息
useInfoMapper.update(useInfo, lambda);
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo);
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, equipId);
// 更新检验检测信息
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
// 使用登记信息
JgChangeRegistrationReform jgChangeRegistrationReform = new JgChangeRegistrationReform();
LambdaQueryWrapper<OtherInfo> otherLambda = new QueryWrapper<OtherInfo>().lambda();
......@@ -138,8 +128,9 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
OtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
String supervisoryCode = otherInfo.getSupervisoryCode();
jgChangeRegistrationReform.setSupervisoryCode(supervisoryCode);
jgChangeRegistrationReform.setUseUnitName(useInfo.getUseUnitName());
jgChangeRegistrationReform.setUseUnitCreditCode(useInfo.getUseUnitCreditCode());
jgChangeRegistrationReform.setUseUnitName(ObjectUtils.isEmpty(useInfo.getUseUnitName())?reginParams.getCompany().getCompanyName():useInfo.getUseUnitName());
jgChangeRegistrationReform.setUseUnitCreditCode(ObjectUtils.isEmpty(useInfo.getUseUnitCreditCode())?reginParams.getCompany().getCompanyCode():useInfo.getUseUnitCreditCode());
if (!ObjectUtils.isEmpty(map.get("transformationQualityCertificate"))) {
jgChangeRegistrationReform.setTransformationQualityCertificate(JSONObject.toJSONString(map.get("transformationQualityCertificate")));
}
......@@ -305,52 +296,10 @@ 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 {
JgChangeRegistrationReform jgChangeRegistrationReform = this.getBaseMapper().selectById(id);
JSONObject task = workFlowFeginService.getTaskNoAuth(instanceId);
JSONObject taskMessage = JSON.parseObject(JSON.toJSONString(task.get("data")));
String taskId = taskMessage.getString("id");
......@@ -361,6 +310,10 @@ 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", "提交");
}
dto.setVariable(map);
//执行流程
Workflow.taskClient.completeByTask(taskId, dto);
......@@ -371,36 +324,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);
......
......@@ -299,7 +299,12 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
// 修改数据信息
this.updateExecuteIds(instanceId, oldTransfer.getSequenceNbr(), "0");
// 默认执行流程
this.flowExecute(oldTransfer.getSequenceNbr(), instanceId, "0", "", false);
String status = oldTransfer.getStatus();
String operate = "0";
if(ValidationUtil.equals(status,WorkFlowStatusEnum.TRANSFER_SUBMIT.getRollBack()) || ValidationUtil.equals(status,WorkFlowStatusEnum.TRANSFER_SUBMIT.getReject())){
operate="提交";
}
this.flowExecute(oldTransfer.getSequenceNbr(), instanceId, operate, "", false);
}
}
return true;
......@@ -632,21 +637,20 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
if (!FlowStatusEnum.TO_BE_FINISHED.getName().equals(taskCode)) {
role = String.join(",", roleList);
jgChangeRegistrationTransfer.setNextExecutorIds(role);
jgChangeRegistrationTransfer.setPromoter(reginParams.getUserModel().getUserId());
jgChangeRegistrationTransfer.setInstanceId(instanceId);
if (!ObjectUtils.isEmpty(jgChangeRegistrationTransfer.getExecuteSequence())) {
jgChangeRegistrationTransfer.setExecuteSequence(jgChangeRegistrationTransfer.getExecuteSequence() + "," + role);
} else {
jgChangeRegistrationTransfer.setExecuteSequence(role);
}
jgChangeRegistrationTransfer.setAuditStatus(WorkFlowStatusEnum.getMessage(taskCode).getPass());
jgChangeRegistrationTransfer.setStatus(WorkFlowStatusEnum.getMessage(taskCode).getPass());
if ("0".equals(operate)) {
// 通过操作
jgChangeRegistrationTransfer.setAuditStatus(WorkFlowStatusEnum.getMessage(taskCode).getPass());
jgChangeRegistrationTransfer.setStatus(WorkFlowStatusEnum.getMessage(taskCode).getPass());
jgChangeRegistrationTransfer.setPromoter(reginParams.getUserModel().getUserId());
} else {
// 驳回操作
jgChangeRegistrationTransfer.setAuditStatus(WorkFlowStatusEnum.getMessage(taskCode).getPass());
jgChangeRegistrationTransfer.setStatus(WorkFlowStatusEnum.getMessage(taskCode).getReject());
jgChangeRegistrationTransfer.setPromoter("");
}
......
......@@ -229,10 +229,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
JgChangeRegistrationUnit notice = new JgChangeRegistrationUnit();
BeanUtils.copyProperties(noticeDto,notice);
JgChangeRegistrationUnit noticeOld = JgChangeRegistrationUnitMapper.selectById(noticeDto.getSequenceNbr());
BeanUtils.copyProperties(noticeOld,notice);
boolean submit = submit(notice, op);
notice.setChangeCertificate(noticeDto.getChangeCertificate());
notice.setRemark(noticeDto.getRemark());
if(submit) {
// 查询下节点任务
getNext(roleListSecond, notice.getInstanceId(),taskName);
......@@ -547,7 +548,11 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
dto.setComment(notice.getProcessAdvice());
}
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
if(notice.getStatus().equals(WorkFlowStatusEnum.UNIT_RENAME_SUBMIT.getReject()) || notice.getStatus().equals(WorkFlowStatusEnum.UNIT_RENAME_SUBMIT.getRollBack()) ) {
map.put("approvalStatus", "提交");
} else {
map.put("approvalStatus", op);
}
dto.setVariable(map);
//执行流程
AjaxResult ajaxResult1 = null;
......@@ -650,6 +655,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())) {
......
......@@ -641,7 +641,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
dto.setComment(notice.getProcessAdvice());
}
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
if(notice.getNoticeStatus().equals("6614") || notice.getNoticeStatus().equals("6615") ) {
map.put("approvalStatus", "提交");
} else {
map.put("approvalStatus", op);
}
dto.setVariable(map);
//执行流程
AjaxResult ajaxResult1 = null;
......@@ -775,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;
......@@ -165,7 +166,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
List<ActWorkflowStartDTO> list = new ArrayList<>();
for (int i = 0; i < deviceList.size(); i++) {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("scrapCancel");
dto.setProcessDefinitionKey("scrapCancelNew");
dto.setBusinessKey(String.valueOf(i));
list.add(dto);
}
......@@ -272,7 +273,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
// 发起流程
if (!StringUtils.hasText(jgScrapCancelDto.getInstanceId())) {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("scrapCancel");
dto.setProcessDefinitionKey("scrapCancelNew");
dto.setBusinessKey("1");
try {
ajaxResult = Workflow.taskClient.startByVariable(dto);
......@@ -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);
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
try {
tzsServiceFeignClient.commonUpdateEsDataByIds(resultMap);
} catch (Exception e) {
e.printStackTrace();
}
jgScrapCancel.setAuditStatus(FlowStatusEnum.TO_BE_FINISHED.getName());
jgScrapCancel.setAuditPassDate(new Date());
}
......
......@@ -205,7 +205,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
placeholders.put("produceCode", getValue.apply("factoryNum")); // TODO: 制造编号 - 设备出厂编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("address"));
placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("streetName") + getValue.apply("address"));
placeholders.put("installStartDate", getValue.apply("installStartDate"));
placeholders.put("installType", "移装"); // TODO: 施工类别
placeholders.put("installLicenseNo", "");
......@@ -216,7 +216,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
placeholders.put("useUnitName", getValue.apply("useUnitName"));
placeholders.put("useUnitLeaderName", getValue.apply("safetyManager"));
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitProvinceName") + getValue.apply("useUnitCityName") + getValue.apply("useUnitCountyName") + getValue.apply("useUnitAddress"));
placeholders.put("useUnitLeaderAddress", getValue.apply("useUnitProvinceName") + getValue.apply("useUnitCityName") + getValue.apply("useUnitCountyName") + getValue.apply("streetName") + getValue.apply("useUnitAddress"));
// 生成二维码
String qrCode = ImageUtils.generateQRCode(getValue.apply("applyNo"), 300, 300);
placeholders.put("qrCode", qrCode);
......@@ -273,7 +273,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
JgTransferNotice notice = new JgTransferNotice();
BeanUtils.copyProperties(noticeDto,notice);
boolean submit = submit(notice, op);
boolean submit = submit(notice, op, null);
if(submit) {
// 查询下节点任务
......@@ -537,7 +537,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
return urls;
}
public boolean submit(JgTransferNotice notice, String op) {
public boolean submit(JgTransferNotice notice, String op, String opinion) {
AjaxResult ajaxResult = Workflow.taskClient.getTask(notice.getInstanceId());
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
......@@ -546,9 +546,16 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
dto.setComment("提交流程");
if (!StringUtils.isEmpty(opinion)) {
dto.setComment(opinion);
}
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
if(notice.getNoticeStatus().equals("6614") || notice.getNoticeStatus().equals("6615") ) {
map.put("approvalStatus", "提交");
} else {
map.put("approvalStatus", op);
}
dto.setVariable(map);
//执行流程
AjaxResult ajaxResult1 = null;
......@@ -581,7 +588,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
@Transactional
public void accept(JgTransferNoticeDto dto, String op) {
public void accept(JgTransferNoticeDto dto, String op, String opinion) {
String[] taskName = new String[]{"流程结束"};
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
JgTransferNotice jgTransferNotice = this.jgTransferNoticeMapper.selectById(dto.getSequenceNbr());
......@@ -595,7 +602,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
ArrayList<String> roleList = new ArrayList<>();
boolean submit = submit(jgTransferNotice, op);
boolean submit = submit(jgTransferNotice, op, opinion);
if(submit) {
getNext(roleList, dto.getInstanceId(), taskName);
jgTransferNotice.setPromoter(reginParams.getUserModel().getUserId());
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.biz.utils.RedisUtil;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
@Service
public class StartPlatformTokenService {
@Autowired
RedisUtil redisUtil;
@Autowired
AmosRequestContext amosRequestContext;
public void getToken() {
RequestContext.setProduct(amosRequestContext.getProduct());
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setToken(amosRequestContext.getToken());
}
}
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
*
......@@ -19,4 +21,6 @@ public interface JyjcOpeningApplicationMapper extends BaseMapper<JyjcOpeningAppl
@Param("jyjcOpeningApplicationRequstDto") JyjcOpeningApplicationRequstDto jyjcOpeningApplicationRequstDto, @Param("applyStartTime") String applyStartTime, @Param("applyendTime") String applyendTime);
void updatePromoter(@Param("id") Long id);
List<Long> selectOverdueData();
}
......@@ -56,6 +56,9 @@
order by sequence_nbr desc
</select>
<select id="selectOverdueData" resultType="java.lang.Long">
SELECT sequence_nbr FROM "tz_jyjc_opening_application" WHERE CURDATE() > expiry_date
</select>
<update id="updatePromoter">
UPDATE tz_jyjc_opening_application set promoter = null
......
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
......@@ -9,6 +10,8 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -39,6 +42,7 @@ import java.util.stream.Collectors;
@RestController
@Api(tags = "检验业务申请单api")
@RequestMapping(value = "/jyjc-opening-application")
@EnableScheduling
public class JyjcOpeningApplicationController extends BaseController {
@Autowired
......@@ -278,4 +282,29 @@ public class JyjcOpeningApplicationController extends BaseController {
String remark = (String) params.get("remark");
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.doDiscard(Long.parseLong(sequenceNbr), remark));
}
/**
* 自动作废
*
*
* @param
* @return {@link ResponseModel< List< TzBaseEnterpriseInfo>>}
* @author yangyang
* @throws
* @date 2023/12/22 16:13
*/
@Scheduled(cron = "0 0 0 * * ?")
public void timingDiscard() {
List<Long> longs = jyjcOpeningApplicationServiceImpl.selectOverdueData();
if (CollectionUtils.isNotEmpty(longs)){
for (Long aLong : longs) {
String remark = "到期作废";
jyjcOpeningApplicationServiceImpl.doDiscard(aLong, remark);
}
}
}
}
......@@ -231,7 +231,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
return false;
}
UpdateWrapper<JyjcOpeningApplication> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("status", FlowStatusEnum.TO_BE_DISCARD.getCode()).set("status_name", FlowStatusEnum.TO_BE_DISCARD.getName()).in("SEQUENCE_NBR", ids);
updateWrapper.set("status", FlowStatusEnum.TO_BE_DISCARD.getCode())
.set("status_name", FlowStatusEnum.TO_BE_DISCARD.getName())
.set("remark", "到期作废")
.in("SEQUENCE_NBR", ids);
return this.update(updateWrapper);
}
......@@ -325,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);
......@@ -360,7 +362,10 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 获取检验人员信息
QueryWrapper userInfoQueryWrapper = new QueryWrapper<>();
userInfoQueryWrapper.eq("unit_code", unitCode);
userInfoQueryWrapper.eq("is_delete", false);
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()
......@@ -581,4 +586,9 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 根据开通机构过滤
return tzBaseEnterpriseInfos.stream().filter(o -> StringUtils.isNotBlank(o.getUseCode()) && unitCodes.contains(o.getUseCode())).collect(Collectors.toList());
}
public List<Long> selectOverdueData(){
return jyjcOpeningApplicationMapper.selectOverdueData();
}
}
\ No newline at end of file
spring.application.name=TZS-JYJC-YY
spring.application.name=TZS-JYJC
server.servlet.context-path=/jyjc
server.port=12000
spring.profiles.active=dev
......
......@@ -127,4 +127,10 @@ public class TzsUserInfoVo {
*/
@ApiModelProperty(value = "设备类型")
private JSONArray equipType;
/**
* 内部人员编码
*/
@ApiModelProperty(value = "内部人员编码")
private String innerPersonCode;
}
......@@ -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());
......
......@@ -27,7 +27,7 @@
<springcloud.version>Hoxton.SR8</springcloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<tyboot-version>1.1.23-SNAPSHOT</tyboot-version>
<amos.version>1.8.6</amos.version>
<amos.version>1.10.3</amos.version>
<itext.version>7.1.1</itext.version>
<elasticsearch.version>7.15.2</elasticsearch.version>
</properties>
......
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