Commit 63dfffad 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 338a2beb a87a0278
......@@ -25,6 +25,7 @@ public class DateUtils {
public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_PATTERN_NUM = "yyyyMMdd";
public static final String DATE_PATTERN_MM = "yyyyMM";
public static final String CHN_DATE_PATTERN_YEAR = "yyyy年";
public static final String CHN_DATE_PATTERN_MONTH = "MM月";
public static final String CHN_DATE_PATTERN = "yyyy年MM月dd日";
......
package com.yeejoin.amos.boot.module.jg.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "JgInstallationAccDto", description = "")
public class JgInstallationAccDto {
String opinion;
JgInstallationNoticeDto model;
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -95,13 +96,13 @@ public class JgInstallationNoticeDto extends BaseDto {
private String propertyUnitName;
@ApiModelProperty(value = "使用单位id")
private String useUnitId;
private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位")
private String useUnitName;
@ApiModelProperty(value = "接收机构ID")
private String receiveOrgId;
private String receiveOrgCreditCode;
@ApiModelProperty(value = "接收机构")
private String receiveOrgName;
......@@ -209,4 +210,7 @@ public class JgInstallationNoticeDto extends BaseDto {
+ (StringUtils.isEmpty(this.countyName) ? "" : this.countyName)
+ (StringUtils.isEmpty(this.address) ? "" : this.address);
}
@ApiModelProperty(value = "设备注册代码")
private String equRegisterCode;
}
......@@ -341,4 +341,11 @@ public class JgInstallationNotice extends BaseEntity {
@TableField("notice_report_url")
private String noticeReportUrl;
/**
* 设备注册编码
*/
@TableField("equ_register_code")
private String equRegisterCode;
}
......@@ -25,7 +25,12 @@ public enum FlowStatusEnum {
/**
* 已驳回
*/
REJECTED(6614, "已驳回");
REJECTED(6614, "已驳回"),
/**
* 已撤回
*/
ROBACK(6615, "已撤回");
private final int code;
......
......@@ -16,7 +16,8 @@
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.instance_id AS instanceId
isn.instance_id AS instanceId,
isn.notice_report_url AS noticeReportUrl
FROM
tzs_jg_installation_notice isn
<where>
......@@ -39,7 +40,7 @@
</if>
</if>
<if test="type == 'supervision'">
AND isn.notice_status in ('6612', '6613', '6614')
AND (isn.notice_status in ('6612', '6613', '6614') or isn.status in('6614') )
</if>
</where>
ORDER BY
......@@ -61,10 +62,10 @@
isn.install_leader_name AS installLeaderName,
isn.install_leader_phone AS installLeaderPhone,
isn.use_unit_name AS useUnitName,
isn.equ_register_code AS equRegisterCode,
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,
......@@ -89,7 +90,13 @@
fi.produce_country AS produceCountry,
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress
FROM
tzs_jg_installation_notice isn
LEFT JOIN tzs_jg_relation_equip re ON re.business_id = isn.sequence_nbr
......@@ -97,7 +104,9 @@
LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equip_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equip_id
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equip_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equip_id
WHERE
isn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
</mapper>
package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationAccDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* 安装告知
*
* @author system_generator
* @date 2023-12-12
*/
@RestController
@Api(tags = "安装告知工作流相关Api")
@RequestMapping(value = "/jg-installation-workflow")
public class JgInstallationByWorkFlowController {
@Autowired
JgInstallationNoticeServiceImpl jgInstallationNoticeServiceImpl;
/**
* 提交
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/submit")
@ApiOperation(httpMethod = "POST", value = "安装告知提交", notes = "安装告知提交")
public ResponseModel<JgInstallationNoticeDto> submit(@RequestBody JgInstallationNoticeDto model, String op) {
// TODO 发起安装告知流程
// jgInstallationNoticeServiceImpl.submit(model, op);
return ResponseHelper.buildResponse(model);
}
/**
* 撤销
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/cancel")
@ApiOperation(httpMethod = "POST", value = "安装告知撤销", notes = "安装告知撤销")
public ResponseModel<JgInstallationNoticeDto> cancel(@RequestBody Map<String, Object> model) {
JgInstallationNoticeDto installationInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("installationInfo")), JgInstallationNoticeDto.class, true);
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空");
}
jgInstallationNoticeServiceImpl.cancel(installationInfo);
return ResponseHelper.buildResponse(installationInfo);
}
/**
* 受理
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/accept")
@ApiOperation(httpMethod = "POST", value = "安装告知受理", notes = "安装告知受理")
public ResponseModel<JgInstallationNoticeDto> accept(@RequestBody Map<String, Object> model, String op) {
// TODO 受理安装告知流程
LinkedHashMap model1 = (LinkedHashMap)model.get("model");
LinkedHashMap form = (LinkedHashMap)model1.get("form");
LinkedHashMap installationInfo = (LinkedHashMap)form.get("installationInfo");
JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgInstallationNoticeDto.class);
jgInstallationNoticeServiceImpl.accept(jgInstallationNoticeDto,op);
return ResponseHelper.buildResponse(null);
}
}
package com.yeejoin.amos.boot.module.jg.biz.feign;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
@FeignClient(name = "TZS-YMT-LL", url = "172.16.3.155:11000", path = "/ymt", configuration =
{FeignConfiguration.class})
public interface TzsServiceFeignClient {
/**
* 创建监管码及96333
*
* @param map 请求体
* @return
*/
@RequestMapping(value = "/equipment-category/createSupervisorCode", method = RequestMethod.POST)
ResponseModel<Map<String, Object>> createCode(@RequestBody Map<String, Object> map);
}
......@@ -431,31 +431,36 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
// 默认条件【STATUS===""】
// 默认条件【STATUS==="" || null
BoolQueryBuilder meBuilder = QueryBuilders.boolQuery();
meBuilder.must(QueryBuilders.matchQuery("STATUS", "null"));
meBuilder.must(QueryBuilders.boolQuery()
.should(QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery("STATUS")))
.should(QueryBuilders.boolQuery().must(QueryBuilders.matchPhraseQuery("STATUS",""))));
boolMust.must(meBuilder);
String queryType = map.getString("QUERY_TYPE");
// //查询 安装告知【可告知设备列表】【EQU_STATE===""
// //查询 安装告知【可告知设备列表】【EQU_STATE=== null
if (!ObjectUtils.isEmpty(queryType) && ValidationUtil.equals(queryType, "AZ")) {
BoolQueryBuilder azBuilder = QueryBuilders.boolQuery();
azBuilder.must(QueryBuilders.matchQuery("EQU_STATE", 9999));
azBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
boolMust.must(azBuilder);
}
//查询 维保备案【可绑定设备列表】【EQU_STATE==="" && INSPECT_REPORT!==9999(默认占位值)】
//查询 维保备案【可绑定设备列表】【(EQU_STATE=== null) && (INSPECT_REPORT!=="" && !null)】
if (!ObjectUtils.isEmpty(queryType) && ValidationUtil.equals(queryType, "WB")) {
BoolQueryBuilder wbBuilder = QueryBuilders.boolQuery();
wbBuilder.must(QueryBuilders.matchQuery("EQU_STATE", 9999));
wbBuilder.mustNot(QueryBuilders.existsQuery("INSPECT_REPORT"));
wbBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
wbBuilder.must(QueryBuilders.existsQuery("INSPECT_REPORT"));
wbBuilder.mustNot(QueryBuilders.matchPhraseQuery("INSPECT_REPORT",""));
boolMust.must(wbBuilder);
}
//查询 使用登记【可选设备列表】【EQU_STATUS==="" && INSPECT_REPORT!==9999(默认占位值) && USE_ORG_CODE!==""
//查询 使用登记【可选设备列表】【EQU_STATUS=== null && (INSPECT_REPORT!=="" && !null) && (USE_ORG_CODE!=="" && !null)
if (!ObjectUtils.isEmpty(queryType) && ValidationUtil.equals(queryType, "SY")) {
BoolQueryBuilder syBuilder = QueryBuilders.boolQuery();
syBuilder.must(QueryBuilders.matchQuery("EQU_STATE", 9999));
syBuilder.mustNot(QueryBuilders.existsQuery("INSPECT_REPORT"));
syBuilder.mustNot(QueryBuilders.existsQuery("USE_ORG_CODE"));
syBuilder.mustNot(QueryBuilders.existsQuery("EQU_STATE"));
syBuilder.must(QueryBuilders.existsQuery("INSPECT_REPORT"));
syBuilder.mustNot(QueryBuilders.matchPhraseQuery("INSPECT_REPORT",""));
syBuilder.must(QueryBuilders.existsQuery("USE_ORG_CODE"));
syBuilder.mustNot(QueryBuilders.matchPhraseQuery("USE_ORG_CODE",""));
boolMust.must(syBuilder);
}
......@@ -638,9 +643,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Map<String, Object> map = categoryOtherInfoMapper.selectDataById(id);
categoryOtherInfoMapper.updateEsStatus(id);
ESEquipmentCategoryDto dto = JSON.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
// 默认赋值占位,方便es条件搜索时使用
dto.setSTATUS("null");
dto.setEQU_STATE(9999);
Optional<ESEquipmentCategoryDto> data = esEquipmentCategory.findById(id);
if (!ObjectUtils.isEmpty(data)) {
esEquipmentCategory.deleteById(id);
......
......@@ -66,7 +66,6 @@ public class WordTemplateUtils {
// 获取模板, 生成Word文档
Template freemarkerTemplate = configuration.getTemplate(templatePath, "UTF-8");
map = new HashMap<>(map);
File docFile = createDoc(templatePath, map, freemarkerTemplate);
// 转换Word文档
......
......@@ -50,7 +50,7 @@
<logger name="com.yeejoin" level="INFO"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<root level="INFO">
<!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="ELK" />-->
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -66,6 +67,7 @@ public class JyjcOpeningApplication extends BaseEntity {
* 有效期至
*/
@TableField("expiry_date")
@JsonFormat (pattern = "yyyy-MM-dd")
private Date expiryDate;
/**
......
package com.yeejoin.amos.boot.module.jyjc.api.enums;
public enum AttachmentTypeEnum {
SPECIAL_EQUIPMENT_REPORT("特种设备检验报告","1"),
INSPECTION_CERTIFICATE("监检证书","2");
private String name;
private String code;
public String getName() {
return name;
}
AttachmentTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 业务开通申请表
......@@ -124,8 +126,11 @@ public class JyjcInspectionResultModel extends BaseModel {
private String useUnitCreditCode;
@ApiModelProperty(value = "检验结果技术参数")
private JyjcInspectionResultParamModel resultParamModel;
private Map<String,Object> resultParamModelMap;
@ApiModelProperty(value = "检验结果附件")
private JyjcInspectionResultAttachmentModel resultAttachmentModel;
private List<Map<String,Object>> resultAttachmentModelList;
@ApiModelProperty(value = "附件类型(特种设备检验报告:1,监检证书:2)")
private String attachmentType;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
......@@ -44,6 +45,7 @@ public class JyjcOpeningApplicationModel extends BaseModel {
private String resultType;
@ApiModelProperty (value = "有效期至")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date expiryDate;
@ApiModelProperty (value = "受理日期(接收日期)")
......
......@@ -144,9 +144,8 @@ public class JyjcInspectionResultController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateResult")
@ApiOperation(httpMethod = "PUT", value = "检验结果-上传结果和编辑结果", notes = "检验结果-上传结果和编辑结果")
public ResponseModel<JyjcInspectionResultModel> updateJyjcInspectionResult(@RequestBody Map<String, JyjcInspectionResultModel> model) {
JyjcInspectionResultModel inspectResult = model.get("inspectResult");
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateJyjcInspectionResult(inspectResult));
public ResponseModel<JyjcInspectionResultModel> updateJyjcInspectionResult(@RequestBody JyjcInspectionResultModel model) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateJyjcInspectionResult(model));
}
/**
......
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -20,18 +19,15 @@ import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
......@@ -95,10 +91,19 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
public JyjcInspectionResultModel updateJyjcInspectionResult(JyjcInspectionResultModel model) {
updateWithModel(model);
if (ObjectUtil.isNotEmpty(model.getResultAttachmentModel()))
attachmentService.createWithModel(model.getResultAttachmentModel());
if (ObjectUtil.isNotEmpty(model.getResultParamModel()))
resultParamService.createWithModel(model.getResultParamModel());
if (!CollectionUtils.isEmpty(model.getResultAttachmentModelList())){
JyjcInspectionResultAttachment attachment = new JyjcInspectionResultAttachment();
attachment.setResultSeq(model.getSequenceNbr());
attachment.setAttachmentUrl(JSON.toJSONString(model.getResultAttachmentModelList()));
attachment.setAttachmentType(model.getAttachmentType());
attachmentService.save(attachment);
}
if (!CollectionUtils.isEmpty(model.getResultParamModelMap())){
JyjcInspectionResultParam resultParam = new JyjcInspectionResultParam();
resultParam.setResultSeq(model.getSequenceNbr());
resultParam.setParamJson(JSON.toJSONString(model.getResultParamModelMap()));
resultParamService.save(resultParam);
}
return model;
}
......
......@@ -124,7 +124,8 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
CompanyBo companyBo = commonserviceImpl.getReginParamsOfCurrentUser().getCompany();
model.setUnitCode(companyBo.getCompanyCode());
model.setUnitCodeName(companyBo.getCompanyName());
model.setApplicationSeq(createCodeService.createDeviceRegistrationCode(ApplicationFormTypeEnum.JY.getCode()));
List<String> codes = createCodeService.createApplicationFormCode(ApplicationFormTypeEnum.JY.getCode(), 1);
model.setApplicationSeq(codes.get(0));
return this.createWithModel(model);
} else {
return this.updateWithModel(model);
......@@ -220,13 +221,15 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if (ValidationUtil.isEmpty(reginParams.getCompany())) {
throw new RuntimeException("未指定人员归属单位信息");
}
String unitCode;
JyjcOpeningApplicationModel jyjcOpeningApplicationModel;
if (null != sequenceNbr) {
jyjcOpeningApplicationModel = this.queryBySeq(sequenceNbr);
unitCode = jyjcOpeningApplicationModel.getUnitCode();
} else {
jyjcOpeningApplicationModel = new JyjcOpeningApplicationModel();
unitCode = reginParams.getCompany().getCompanyCode();
}
String unitCode = reginParams.getCompany().getCompanyCode();
// unitCode = "91611103MAC4Q1EG7B"; // 测试用,之后务必删除!!!
QueryWrapper enterpriseInfoQueryWrapper = new QueryWrapper<>();
enterpriseInfoQueryWrapper.eq("use_code", unitCode);
......
......@@ -65,7 +65,12 @@
USE_PLACE,
ADDRESS,
EQU_STATE,
STATUS
STATUS,
USE_INNER_CODE,
FACTORY_NUM,
PRODUCE_UNIT_NAME,
INSPECT_REPORT,
NEXT_INSPECT_DATE
from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id}
</select>
......
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