Commit 1b68637d authored by 刘林's avatar 刘林

fix(JG):使用登记按单位办理代码提交

parent bb4dc1de
......@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
......@@ -112,4 +111,9 @@ public class JgUseRegistrationDto extends BaseDto {
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
/**
* 办理类型,unit(单位) set(台套)
*/
@ApiModelProperty(value = "办理类型")
private String manageType;
}
......@@ -193,10 +193,15 @@ public class JgUseRegistration extends BaseEntity {
@TableField(value = "transfer_to_user_ids")
private String transferToUserIds;
/**
* 其他附件
*/
@TableField(value = "other_accessories")
private String otherAccessories;
/**
* 办理类型,unit(单位) set(台套)
*/
@TableField(value = "manage_type")
private String manageType;
}
......@@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -46,4 +46,6 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Page<JSONObject> queryForUnitPipelineEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
@MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id")Long id);
}
......@@ -11,18 +11,9 @@
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.EQU_CATEGORY as equCategoryCode,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
jri.EQU_LIST as equList,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equListName,
use.USE_INNER_CODE as innerCode,
ur.use_address as place,
ur.instance_id as instanceId,
re.equ_id as equipId,
ur.apply_no as applyNo,
ur.next_execute_ids as nextExecuteIds,
ur.promoter,
......@@ -33,7 +24,17 @@
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId,
ur.rec_date as recDate
ur.rec_date as recDate,
GROUP_CONCAT(DISTINCT other.CODE96333) AS code96333,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY)) as equCategory,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME) AS productName,
GROUP_CONCAT(DISTINCT jri.EQU_CATEGORY) AS equCategoryCode,
GROUP_CONCAT(DISTINCT jri.EQU_CODE) AS equCode,
GROUP_CONCAT(DISTINCT jri.EQU_LIST) AS equList,
GROUP_CONCAT(DISTINCT (SELECT name from tz_equipment_category where code = jri.EQU_LIST)) AS equListName,
GROUP_CONCAT(DISTINCT use.USE_INNER_CODE) AS innerCode,
GROUP_CONCAT(DISTINCT re.equ_id) AS equipId
from tzs_jg_use_registration ur
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
......@@ -41,7 +42,6 @@
LEFT JOIN idx_biz_jg_other_info other on re.equ_id = other.RECORD
</sql>
<select id="getListPage" resultType="java.util.Map">
select
*
......@@ -76,6 +76,7 @@
<if test="dto.dataType == 'company' ">
and ur.use_unit_credit_code = #{dto.unitCode}
</if>
GROUP BY re.equip_transfer_id
</where>
union
<include refid="page-list"/>
......@@ -97,8 +98,9 @@
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
GROUP BY re.equip_transfer_id
</where>)
order by regDate desc, recDate desc
order by regDate desc, recDate desc
</select>
<select id="getDetail" resultType="java.util.Map">
SELECT
......@@ -223,33 +225,32 @@
ur.audit_status as auditStatus,
date_format(reg_date, '%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.status,
other.CODE96333 code96333,
ur.status as status,
GROUP_CONCAT(DISTINCT other.CODE96333) as 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,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
-- concat(use.PROVINCE_NAME, use.CITY_NAME, use.COUNTY_NAME) as place,
GROUP_CONCAT(DISTINCT(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY)) as equCategory,
GROUP_CONCAT(DISTINCT jri.PRODUCT_NAME) as productName,
GROUP_CONCAT(DISTINCT jri.EQU_CODE) as equCode,
GROUP_CONCAT(DISTINCT use.USE_INNER_CODE) as innerCode,
ur.use_address as place,
ur.instance_id as instanceId,
re.equ_id as equipId,
GROUP_CONCAT(DISTINCT re.equ_id) as equipId,
ur.apply_no as applyNo,
ur.next_execute_ids as nextExecuteIds,
ur.promoter,
ur.promoter as promoter,
ur.supervisory_code as supervisoryCode,
ur.use_registration_code as useRegistrationCode,
date_format(ur.audit_pass_date, '%Y-%m-%d') as auditPassDate,
ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.is_xixian as isXixian
ur.is_xixian as isXixian
from tzs_jg_use_registration ur
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 ur.sequence_nbr = #{id}
GROUP BY re.equip_transfer_id
</select>
<select id="getEquType" resultType="java.lang.String">
SELECT ec.name
......@@ -314,7 +315,26 @@
ORDER BY tjmce."rec_date" desc
LIMIT 1
</select>
<select id="selectEquipList" resultType="java.util.Map">
select jui.RECORD as SEQUENCE_NBR,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as EQU_LIST,
jfi.PRODUCE_UNIT_NAME,
jui.USE_INNER_CODE,
jfi.FACTORY_NUM,
jui.ADDRESS as ADDRESS,
jui.RECORD record,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as EQU_DEFINE,
jri.PRODUCT_NAME,
jri.EQU_CODE,
other.SUPERVISORY_CODE,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as EQU_CATEGORY
from tzs_jg_use_registration_eq tjure
LEFT JOIN idx_biz_jg_use_info jui on tjure.equ_id = jui.RECORD
LEFT JOIN idx_biz_jg_factory_info jfi on tjure.equ_id = jfi.RECORD
left JOIN idx_biz_jg_register_info jri on tjure.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_other_info other on other.RECORD = jui.RECORD
WHERE tjure.equip_transfer_id = #{id}
</select>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ui."USE_UNIT_NAME" useUnitName,
......
......@@ -176,13 +176,14 @@ public class JgTransferNoticeController extends BaseController {
public void generateCertificateReport(HttpServletResponse response) {
Map<String, Object> map = new HashMap<>();
// 组装模板变量
map.put("useRegistrationCode", "202301256456"); // 编号
map.put("manageType", "unit"); // 编号
map.put("useRegistrationCode", "容3T陕A0001"); // 编号
map.put("useUnitName", "西安市高科物业服务有限公司"); // 使用单位名称
map.put("fullAddress", "西安市曲江新区春临东街南湖意境1单元2号楼"); // 设备使用地点
map.put("equList", "电梯"); // 设备种类
map.put("equDefine", "曳引驱动电梯啊啊啊啊啊啊啊啊啊啊啊啊啊"); // 设备品种
map.put("equipCode", ""); // 设备代码
map.put("equCategory", "曳引电梯噜啦噜啦嘞绿绿绿绿绿绿绿"); // 设备类别
map.put("equCategory", "压力管道"); // 设备类别
map.put("useInnerCode", "KY-9527555555555555"); // 单位内编号
map.put("factoryNum", "FUCK-G600010000056"); // 产品编号
map.put("receiveOrgName", "西安市曲江新区质检院"); // 登记机关
......
......@@ -54,6 +54,7 @@ public class JgUseRegistrationController extends BaseController {
String.valueOf(map.get("operate")),
String.valueOf(map.get("comment")),
String.valueOf(map.getOrDefault("carNumber","")),
String.valueOf(map.getOrDefault("manageType","")),
String.valueOf(map.get("nextTaskId")));
return ResponseHelper.buildResponse("ok");
}
......@@ -63,7 +64,8 @@ public class JgUseRegistrationController extends BaseController {
@PostMapping(value = "/withdraw")
@ApiOperation(httpMethod = "POST", value = "撤回", notes = "撤回")
public ResponseModel<Object> withdraw(@RequestBody JSONObject map) {
jgUseRegistrationServiceImpl.withdraw(String.valueOf(map.get("instanceId")), String.valueOf(map.get("nextTaskId")) );
jgUseRegistrationServiceImpl.withdraw(String.valueOf(map.get("instanceId")), String.valueOf(map.get("nextTaskId")),
String.valueOf(map.getOrDefault("manageType","unit")));
return ResponseHelper.buildResponse("ok");
}
......@@ -122,7 +124,8 @@ public class JgUseRegistrationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "详情", notes = "详情")
@GetMapping(value = "/getDetail")
public ResponseModel<Map<String, Object>> getDetail(@RequestParam("record") String record, @RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
public ResponseModel<Map<String, Object>> getDetail(@RequestParam(value = "record", required = false) String record,
@RequestParam(value = "sequenceNbr", required = false) Long sequenceNbr) {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDetail(record, sequenceNbr));
}
......@@ -162,8 +165,9 @@ public class JgUseRegistrationController extends BaseController {
@GetMapping(value = "/export")
@ApiOperation(httpMethod = "GET", value = "导出使用登记证", notes = "导出使用登记证")
public void exportImageZip(HttpServletResponse response, @RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam(value = "printType", defaultValue = "0") String printType) {
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType);
@RequestParam(value = "printType", defaultValue = "0") String printType,
@RequestParam(value = "manageType", defaultValue = "") String manageType) {
jgUseRegistrationServiceImpl.exportUseRegistrationCertificate(sequenceNbr, response, printType, manageType);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.jg.biz.service;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import java.util.List;
/**
* 安全追溯-检验检测信息表接口类
*
......@@ -13,4 +13,6 @@ public interface IIdxBizJgInspectionDetectionInfoService {
boolean saveOrUpdateData(IdxBizJgInspectionDetectionInfo inspectionDetectionInfo);
IdxBizJgInspectionDetectionInfo queryNewestDetailByRecord(String record);
List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records);
}
......@@ -707,6 +707,8 @@ public class CommonServiceImpl implements ICommonService {
if (CollectionUtils.isEmpty(map)) {
throw new IllegalArgumentException("参数不能为空");
}
String wordPath = "equipment-registration-certificate-report.ftl";
wordPath = "unit".equals(map.get("manageType")) ? "unit-registration-certificate-report.ftl" : wordPath;
// 组装模板变量
map.put("useRegistrationCode", Optional.ofNullable(map.get("useRegistrationCode")).orElse("").toString()); // 编号
map.put("useUnitName", Optional.ofNullable(map.get("useUnitName")).orElse("").toString()); // 使用单位名称
......@@ -731,7 +733,7 @@ public class CommonServiceImpl implements ICommonService {
// word转pdf
File pdfFile;
try {
pdfFile = this.wordToPdf("特种设备使用登记证_", "equipment-registration-certificate-report.ftl", map);
pdfFile = this.wordToPdf("特种设备使用登记证_", wordPath, map);
} catch (Exception e) {
throw new RuntimeException(e);
}
......@@ -816,7 +818,7 @@ public class CommonServiceImpl implements ICommonService {
// 设置文本域的字体为中文字体
acroFields.setFieldProperty(param.getKey(), "textfont", font, null);
// 设置字体大小
acroFields.setFieldProperty(param.getKey(), "textsize", 9.0f, null);
acroFields.setFieldProperty(param.getKey(), "textsize", 12.0f, null);
// 将 map 中的值写到 pdf 模板对应的文本域中
acroFields.setField(param.getKey(), param.getValue() + "");
}
......
......@@ -37,4 +37,11 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
return result;
}
@Override
public List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records) {
IdxBizJgInspectionDetectionInfo result = new IdxBizJgInspectionDetectionInfo();
QueryWrapper<IdxBizJgInspectionDetectionInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(IdxBizJgInspectionDetectionInfo::getRecord, records).orderByDesc(IdxBizJgInspectionDetectionInfo::getInspectDate);
return list(queryWrapper);
}
}
\ No newline at end of file
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