Commit f3dc92b1 authored by LiuLin's avatar LiuLin

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 2229af8f 792c9b7d
...@@ -12,10 +12,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -12,10 +12,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil; import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.*;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -41,10 +38,12 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -41,10 +38,12 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* controller层切面 用于用户数据缓存 供 sql自动填充使用 (使用粒度过大的Aop会创建大量代理对象,影响性能,占用内存,考虑使用 * controller层切面 用于用户数据缓存 供 sql自动填充使用 (使用粒度过大的Aop会创建大量代理对象,影响性能,占用内存,考虑使用
...@@ -283,6 +282,14 @@ public class ControllerAop { ...@@ -283,6 +282,14 @@ public class ControllerAop {
stopWatch5.stop(); stopWatch5.stop();
logger.info("获取用户信息====>{}s", stopWatch5.getTotalTimeSeconds()); logger.info("获取用户信息====>{}s", stopWatch5.getTotalTimeSeconds());
List<String> appCodes = new ArrayList<>();
try {
List<ApplicationModel> applicationModelList = Privilege.agencyUserClient.listApps(userList.get(0).getUserId()).getResult();
appCodes = applicationModelList.stream().map(ApplicationModel::getAppCode).collect(Collectors.toList());
} catch (Exception e) {
throw new RuntimeException("获取listApps失败");
}
userList.get(0).setAppCodes(appCodes);
ReginParams regionParams = new ReginParams(); ReginParams regionParams = new ReginParams();
regionParams.setCompany(company); regionParams.setCompany(company);
regionParams.setRole(role); regionParams.setRole(role);
......
...@@ -186,6 +186,23 @@ public class DataDictionaryController extends BaseController { ...@@ -186,6 +186,23 @@ public class DataDictionaryController extends BaseController {
} }
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<Object> getDataDictionary(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.eq("is_delete", false);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
return ResponseHelper.buildResponse(list);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionaryIdFillMenu", method = RequestMethod.GET) @RequestMapping(value = "/dataDictionaryIdFillMenu", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典,id为SequenceNbr", notes = "根据字典类型查询字典,id为SequenceNbr")
......
...@@ -25,6 +25,7 @@ public class DateUtils { ...@@ -25,6 +25,7 @@ public class DateUtils {
public static final String MINUTE_ONLY_PATTERN = "mm"; public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH"; public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_PATTERN_NUM = "yyyyMMdd"; 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_YEAR = "yyyy年";
public static final String CHN_DATE_PATTERN_MONTH = "MM月"; public static final String CHN_DATE_PATTERN_MONTH = "MM月";
public static final String CHN_DATE_PATTERN = "yyyy年MM月dd日"; public static final String CHN_DATE_PATTERN = "yyyy年MM月dd日";
......
package com.yeejoin.amos.boot.module.jg.api.dto;
import lombok.Getter;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.nio.file.Files;
@Getter
public class ByteArrayMultipartFile implements MultipartFile {
private byte[] bytes;
private String name;
private String originalFilename;
private String contentType;
public ByteArrayMultipartFile() {
}
public ByteArrayMultipartFile(String name, String originalFilename, String contentType, byte[] bytes) {
super();
this.name = name;
this.originalFilename = originalFilename;
this.contentType = contentType;
this.bytes = bytes;
}
@Override
public boolean isEmpty() {
return bytes.length == 0;
}
@Override
public long getSize() {
return bytes.length;
}
@Override
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes);
}
@Override
public void transferTo(File destination) throws IOException {
try (OutputStream outputStream = Files.newOutputStream(destination.toPath())) {
outputStream.write(bytes);
}
}
}
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; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -95,13 +96,13 @@ public class JgInstallationNoticeDto extends BaseDto { ...@@ -95,13 +96,13 @@ public class JgInstallationNoticeDto extends BaseDto {
private String propertyUnitName; private String propertyUnitName;
@ApiModelProperty(value = "使用单位id") @ApiModelProperty(value = "使用单位id")
private String useUnitId; private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位") @ApiModelProperty(value = "使用单位")
private String useUnitName; private String useUnitName;
@ApiModelProperty(value = "接收机构ID") @ApiModelProperty(value = "接收机构ID")
private String receiveOrgId; private String receiveOrgCreditCode;
@ApiModelProperty(value = "接收机构") @ApiModelProperty(value = "接收机构")
private String receiveOrgName; private String receiveOrgName;
...@@ -200,10 +201,16 @@ public class JgInstallationNoticeDto extends BaseDto { ...@@ -200,10 +201,16 @@ public class JgInstallationNoticeDto extends BaseDto {
@ApiModelProperty(value = "告知设备列表") @ApiModelProperty(value = "告知设备列表")
private List<Map<String, Object>> deviceList; private List<Map<String, Object>> deviceList;
@ApiModelProperty(value = "告知单PDF URL")
private String noticeReportUrl;
public String getFullAddress() { public String getFullAddress() {
return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName) return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName)
+ (StringUtils.isEmpty(this.cityName) ? "" : this.cityName) + (StringUtils.isEmpty(this.cityName) ? "" : this.cityName)
+ (StringUtils.isEmpty(this.countyName) ? "" : this.countyName) + (StringUtils.isEmpty(this.countyName) ? "" : this.countyName)
+ (StringUtils.isEmpty(this.address) ? "" : this.address); + (StringUtils.isEmpty(this.address) ? "" : this.address);
} }
@ApiModelProperty(value = "设备注册代码")
private String equRegisterCode;
} }
...@@ -335,4 +335,17 @@ public class JgInstallationNotice extends BaseEntity { ...@@ -335,4 +335,17 @@ public class JgInstallationNotice extends BaseEntity {
@TableField("instance_id") @TableField("instance_id")
private String instanceId; private String instanceId;
/**
* 告知单PDF URL
*/
@TableField("notice_report_url")
private String noticeReportUrl;
/**
* 设备注册编码
*/
@TableField("equ_register_code")
private String equRegisterCode;
} }
...@@ -25,7 +25,12 @@ public enum FlowStatusEnum { ...@@ -25,7 +25,12 @@ public enum FlowStatusEnum {
/** /**
* 已驳回 * 已驳回
*/ */
REJECTED(6614, "已驳回"); REJECTED(6614, "已驳回"),
/**
* 已撤回
*/
ROBACK(6615, "已撤回");
private final int code; private final int code;
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.service; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
...@@ -13,7 +14,7 @@ import java.util.Map; ...@@ -13,7 +14,7 @@ import java.util.Map;
* @author system_generator * @author system_generator
* @date 2023-12-12 * @date 2023-12-12
*/ */
public interface IJgInstallationNoticeService { public interface IJgInstallationNoticeService extends IService<JgInstallationNotice> {
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
...@@ -56,4 +57,12 @@ public interface IJgInstallationNoticeService { ...@@ -56,4 +57,12 @@ public interface IJgInstallationNoticeService {
* @param submitType 保存类型 * @param submitType 保存类型
*/ */
void saveNotice(String submitType, Map<String, JgInstallationNoticeDto> model); void saveNotice(String submitType, Map<String, JgInstallationNoticeDto> model);
/**
* 打印告知单
*
* @param sequenceNbr 主键
* @return pdf文件路径
*/
String generateInstallationNoticeReport(Long sequenceNbr);
} }
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
isn.province_name AS provinceName, isn.province_name AS provinceName,
isn.city_name AS cityName, isn.city_name AS cityName,
isn.county_name AS countyName, isn.county_name AS countyName,
isn.instance_id AS instanceId isn.instance_id AS instanceId,
isn.notice_report_url AS noticeReportUrl
FROM FROM
tzs_jg_installation_notice isn tzs_jg_installation_notice isn
<where> <where>
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
</if> </if>
</if> </if>
<if test="type == 'supervision'"> <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> </if>
</where> </where>
ORDER BY ORDER BY
...@@ -49,10 +50,22 @@ ...@@ -49,10 +50,22 @@
<select id="queryEquipInformation" resultType="java.util.Map"> <select id="queryEquipInformation" resultType="java.util.Map">
select select
isn.sequence_nbr AS sequenceNbr, isn.sequence_nbr AS sequenceNbr,
isn.install_unit_name AS installUnitName,
isn.apply_no AS applyNo,
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.address AS address,
isn.install_start_date AS installStartDate,
isn.install_license_no AS installLicenseNo,
isn.install_license_expiration_date AS installLicenseExpirationDate,
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_list AS equList,
ri.equ_category AS equCategory, ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine, ri.EQU_DEFINE AS equDefine,
-- 产品编号
ri.product_name AS productName, ri.product_name AS productName,
ri.brand_name AS brandName, ri.brand_name AS brandName,
ri.equ_type AS equType, ri.equ_type AS equType,
...@@ -77,7 +90,13 @@ ...@@ -77,7 +90,13 @@
fi.produce_country AS produceCountry, fi.produce_country AS produceCountry,
fi.factory_standard AS factoryStandard, fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve, 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 FROM
tzs_jg_installation_notice isn tzs_jg_installation_notice isn
LEFT JOIN tzs_jg_relation_equip re ON re.business_id = isn.sequence_nbr LEFT JOIN tzs_jg_relation_equip re ON re.business_id = isn.sequence_nbr
...@@ -85,7 +104,9 @@ ...@@ -85,7 +104,9 @@
LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equip_id 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_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_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 WHERE
isn.sequence_nbr = #{sequenceNbr} isn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select> </select>
</mapper> </mapper>
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
<version>1.10.1</version> <version>1.10.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>19.5jdk</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
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.controller; package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import org.omg.PortableInterceptor.SUCCESSFUL;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl; import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -24,8 +18,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -24,8 +18,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
...@@ -41,7 +33,7 @@ import java.util.Objects; ...@@ -41,7 +33,7 @@ import java.util.Objects;
public class JgInstallationNoticeController extends BaseController { public class JgInstallationNoticeController extends BaseController {
@Autowired @Autowired
JgInstallationNoticeServiceImpl jgInstallationNoticeServiceImpl; private IJgInstallationNoticeService iJgInstallationNoticeService;
/** /**
* 新增 * 新增
...@@ -49,12 +41,12 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -49,12 +41,12 @@ public class JgInstallationNoticeController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增安装告知", notes = "新增安装告知") @ApiOperation(httpMethod = "POST", value = "新增安装告知", notes = "新增安装告知")
public ResponseModel<String> save(@RequestParam String submitType,@RequestBody Map<String, JgInstallationNoticeDto> model) { public ResponseModel<String> save(@RequestParam String submitType, @RequestBody Map<String, JgInstallationNoticeDto> model) {
jgInstallationNoticeServiceImpl.saveNotice(submitType, model); iJgInstallationNoticeService.saveNotice(submitType, model);
return ResponseHelper.buildResponse(""); return ResponseHelper.buildResponse("");
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
...@@ -69,7 +61,7 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -69,7 +61,7 @@ public class JgInstallationNoticeController extends BaseController {
if (Objects.isNull(installationInfo)) { if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空"); throw new IllegalArgumentException("参数installationInfo不能为空");
} }
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.updateInstallationNotice(installationInfo, op)); return ResponseHelper.buildResponse(iJgInstallationNoticeService.updateInstallationNotice(installationInfo, op));
} }
/** /**
...@@ -81,7 +73,7 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -81,7 +73,7 @@ public class JgInstallationNoticeController extends BaseController {
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除安装告知", notes = "根据sequenceNbr删除安装告知") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除安装告知", notes = "根据sequenceNbr删除安装告知")
public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbr") Long[] sequenceNbr) { public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbr") Long[] sequenceNbr) {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(iJgInstallationNoticeService.removeById(sequenceNbr));
} }
/** /**
...@@ -94,7 +86,7 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -94,7 +86,7 @@ public class JgInstallationNoticeController extends BaseController {
@ApiOperation(value = "根据sequenceNbr删除维保合同备案", notes = "根据sequenceNbr删除维保合同备案") @ApiOperation(value = "根据sequenceNbr删除维保合同备案", notes = "根据sequenceNbr删除维保合同备案")
public ResponseModel<Boolean> deleteForBatch(@RequestParam("sequenceNbrs") Long[] sequenceNbrs) { public ResponseModel<Boolean> deleteForBatch(@RequestParam("sequenceNbrs") Long[] sequenceNbrs) {
try { try {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.deleteForBatch(sequenceNbrs)); return ResponseHelper.buildResponse(iJgInstallationNoticeService.deleteForBatch(sequenceNbrs));
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage()); return CommonResponseUtil.failure(e.getMessage());
} }
...@@ -110,7 +102,7 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -110,7 +102,7 @@ public class JgInstallationNoticeController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个安装告知", notes = "根据sequenceNbr查询单个安装告知") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个安装告知", notes = "根据sequenceNbr查询单个安装告知")
public ResponseModel<Map<String, public ResponseModel<Map<String,
Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) { Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.queryBySequenceNbr(sequenceNbr)); return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryBySequenceNbr(sequenceNbr));
} }
...@@ -131,18 +123,16 @@ public class JgInstallationNoticeController extends BaseController { ...@@ -131,18 +123,16 @@ public class JgInstallationNoticeController extends BaseController {
@RequestBody(required = false) JgInstallationNoticeDto model @RequestBody(required = false) JgInstallationNoticeDto model
) { ) {
Page<JgInstallationNotice> page = new Page<>(current, size); Page<JgInstallationNotice> page = new Page<>(current, size);
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.queryForJgInstallationNoticePage(page, model, type)); return ResponseHelper.buildResponse(iJgInstallationNoticeService.queryForJgInstallationNoticePage(page, model, type));
} }
/** /**
* 列表全部数据查询 * 生成告知单
*
* @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "安装告知列表全部数据查询", notes = "安装告知列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "安装告知列表全部数据查询", notes = "安装告知列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/generate-report")
public ResponseModel<List<JgInstallationNoticeDto>> selectForList() { public ResponseModel<String> generateReport(@RequestParam("sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jgInstallationNoticeServiceImpl.queryForJgInstallationNoticeList()); return ResponseHelper.buildResponse(iJgInstallationNoticeService.generateInstallationNoticeReport(sequenceNbr));
} }
} }
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);
}
...@@ -12,6 +12,7 @@ import java.awt.*; ...@@ -12,6 +12,7 @@ import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -302,4 +303,35 @@ public class ImageUtils { ...@@ -302,4 +303,35 @@ public class ImageUtils {
} }
} }
/**
* 生成二维码(白色背景),并将其转换成base64
*
* @param text 二维码内容
* @param width 二维码宽度
* @param height 二维码高度
* @return base64
*/
public static String generateQRCode(String text, int width, int height) {
try {
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
BitMatrix bm = multiFormatWriter.encode(text, BarcodeFormat.QR_CODE, width, height, hints);
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
// 二维码颜色:黑色
int QRCOLOR = 0x201f1f;
//二维码背景颜色:白色
int BGWHITE = 0xFFFFFF;
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
image.setRGB(x, y, bm.get(x, y) ? QRCOLOR : BGWHITE);
}
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ImageIO.write(image, "png", outputStream);
return Base64.getEncoder().encodeToString(outputStream.toByteArray());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
} }
package com.yeejoin.amos.boot.module.jg.biz.utils;
import com.aspose.words.Document;
import com.aspose.words.License;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@Slf4j
public class WordTemplateUtils {
public static final String BASE_PACKAGE_PATH = "/templates";
private static WordTemplateUtils wordTemplateUtils;
private final Configuration configuration;
private WordTemplateUtils() {
configuration = new Configuration(Configuration.VERSION_2_3_23);
}
public static synchronized WordTemplateUtils getInstance() {
if (wordTemplateUtils == null) {
wordTemplateUtils = new WordTemplateUtils();
}
return wordTemplateUtils;
}
/**
* 创建doc并写入内容
*
* @param templatePath doc模板文件路径
* @param dataMap 内容
* @param template 模板
* @return doc文件
*/
private File createDoc(String templatePath, Map<String, ?> dataMap, Template template) throws TemplateException, IOException {
// templatePath在后缀之前加上UUID是为了防止并发时多个线程使用同一个模板文件而导致生成的Word文档内容不一致
int i = templatePath.lastIndexOf(".");
templatePath = UUID.randomUUID() + templatePath.substring(i);
if (templatePath.endsWith(".ftl")) {
templatePath = templatePath.replace(".ftl", ".doc");
}
File docFile = new File(templatePath);
try (
// 这个地方不能使用FileWriter因为需要指定编码类型否则生成的Word文档会因为有无法识别的编码而无法打开
Writer writer = new OutputStreamWriter(Files.newOutputStream(docFile.toPath()), StandardCharsets.UTF_8)
) {
template.process(dataMap, writer);
}
return docFile;
}
public File fillAndConvertDocFile(String templatePath, String targetFileName, Map<String, ?> map, int saveFormat) throws Exception {
// 指定模板所在包路径
configuration.setClassForTemplateLoading(this.getClass(), BASE_PACKAGE_PATH);
// 获取模板, 生成Word文档
Template freemarkerTemplate = configuration.getTemplate(templatePath, "UTF-8");
File docFile = createDoc(templatePath, map, freemarkerTemplate);
// 转换Word文档
File converedFile = converDocFile(docFile.getAbsolutePath(), targetFileName, saveFormat);
// 删除临时文件
Files.deleteIfExists(docFile.toPath());
return converedFile;
}
/**
* word转换
*
* @param docPath word文件路径
* @param targetPath 转换后文件路径
* @param saveFormat 目标文件类型 取自 com.aspose.words.SaveFormat
*/
private File converDocFile(String docPath, String targetPath, int saveFormat) throws Exception {
// 验证License 若不验证则转化出的pdf文档会有水印产生
if (!getLicense()) {
throw new RuntimeException("验证License失败");
}
if (StringUtils.isEmpty(docPath)) {
throw new FileNotFoundException("文档文件不存在");
}
try (
InputStream inputStream = Files.newInputStream(Paths.get(docPath));
OutputStream outputStream = Files.newOutputStream(Paths.get(targetPath));
) {
File targetFile = new File(targetPath);
Document doc = new Document(inputStream);
doc.save(outputStream, saveFormat);
return targetFile;
}
}
/**
* 获取License
*
* @return boolean
*/
private boolean getLicense() {
boolean result = false;
try {
String s = "<License><Data><Products><Product>Aspose.Total for Java</Product><Product>Aspose.Words for Java</Product></Products><EditionType>Enterprise</EditionType><SubscriptionExpiry>20991231</SubscriptionExpiry><LicenseExpiry>20991231</LicenseExpiry><SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber></Data><Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature></License>";
ByteArrayInputStream is = new ByteArrayInputStream(s.getBytes());
License license = new License();
license.setLicense(is);
result = true;
} catch (Exception e) {
log.error("获取License失败", e);
}
return result;
}
}
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<logger name="com.yeejoin" level="INFO"/> <logger name="com.yeejoin" level="INFO"/>
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="DEBUG"> <root level="INFO">
<!-- <appender-ref ref="FILE" /> --> <!-- <appender-ref ref="FILE" /> -->
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
<!-- <appender-ref ref="ELK" />--> <!-- <appender-ref ref="ELK" />-->
......
...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.jyjc.api.entity; ...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.jyjc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date; import java.util.Date;
/** /**
...@@ -158,6 +158,9 @@ public class JyjcInspectionApplication extends BaseEntity { ...@@ -158,6 +158,9 @@ public class JyjcInspectionApplication extends BaseEntity {
@TableField("workflow_node") @TableField("workflow_node")
private String workflowNode; private String workflowNode;
/**
* 检验结果方式
*/
@TableField("result_type")
private String resultType;
} }
package com.yeejoin.amos.boot.module.jyjc.api.entity; package com.yeejoin.amos.boot.module.jyjc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date; import java.util.Date;
...@@ -155,4 +154,16 @@ public class JyjcInspectionResult extends BaseEntity { ...@@ -155,4 +154,16 @@ public class JyjcInspectionResult extends BaseEntity {
*/ */
@TableField("inspection_type_name") @TableField("inspection_type_name")
private String inspectionTypeName; private String inspectionTypeName;
/**
* 报检日期
*/
@TableField("application_date")
private Date applicationDate;
/**
* 检验结果方式
*/
@TableField("result_type")
private String resultType;
} }
...@@ -7,6 +7,9 @@ import lombok.Data; ...@@ -7,6 +7,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
/** /**
* *
* *
...@@ -45,4 +48,10 @@ public class JyjcInspectionResultAttachment extends BaseEntity { ...@@ -45,4 +48,10 @@ public class JyjcInspectionResultAttachment extends BaseEntity {
@TableField("remark") @TableField("remark")
private String remark; private String remark;
/**
* 附件地址
*/
@TableField(exist = false)
private List<Object> attachmentUrlList;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -66,6 +67,7 @@ public class JyjcOpeningApplication extends BaseEntity { ...@@ -66,6 +67,7 @@ public class JyjcOpeningApplication extends BaseEntity {
* 有效期至 * 有效期至
*/ */
@TableField("expiry_date") @TableField("expiry_date")
@JsonFormat (pattern = "yyyy-MM-dd")
private Date expiryDate; 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;
}
}
package com.yeejoin.amos.boot.module.jyjc.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.api.enums
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:25
*/
@Getter
@AllArgsConstructor
public enum BizTypeEnum {
SUPERVISE("supervise", "监督检验"),
FIRST_INSPECTION("firstinspect", "定检"),
DETECTION("detection", "检测");
private String code;
private String name;
public static List<String> getEnumNameList() {
List<String> codeList = new ArrayList<String>();
for (BizTypeEnum c : BizTypeEnum.values()) {
codeList.add(c.getCode());
}
return codeList;
}
}
...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper; ...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationAttachment; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationAttachment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
* *
...@@ -13,4 +16,6 @@ public interface JyjcInspectionApplicationAttachmentMapper extends BaseMapper<Jy ...@@ -13,4 +16,6 @@ public interface JyjcInspectionApplicationAttachmentMapper extends BaseMapper<Jy
public void deleteByApplicationSeq(Long applicationSeq); public void deleteByApplicationSeq(Long applicationSeq);
public List<Map<String,Object>> getDataByApplicationSeq(Long applicationSeq);
} }
package com.yeejoin.amos.boot.module.jyjc.api.mapper; package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import org.springframework.data.repository.query.Param;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -14,4 +19,8 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti ...@@ -14,4 +19,8 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
public Page<JyjcInspectionApplication> queryForDataList( Page<JyjcInspectionApplication> page, String applicationNo, String inspectionClassify, String applicationUnitCode,String applicationUnitName, String equipClassify, String inspectionUnitCode,String inspectionUnitName, String applicationDate, String acceptDate, String inspectionChargePerson, String status , String bizType); public Page<JyjcInspectionApplication> queryForDataList( Page<JyjcInspectionApplication> page, String applicationNo, String inspectionClassify, String applicationUnitCode,String applicationUnitName, String equipClassify, String inspectionUnitCode,String inspectionUnitName, String applicationDate, String acceptDate, String inspectionChargePerson, String status , String bizType);
Page<JyjcInspectionApplicationEquipModel> listByCategory(Page<JyjcInspectionApplicationEquipModel> page,@Param("equipClassify") String equipClassify);
JyjcInspectionApplicationModel selectDataBySeq(Long sequenceNbr);
} }
...@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface JyjcInspectionApplicationPushLogMapper extends BaseMapper<JyjcInspectionApplicationPushLog> { public interface JyjcInspectionApplicationPushLogMapper extends BaseMapper<JyjcInspectionApplicationPushLog> {
void deleteByApplicationSeq(Long seq);
} }
...@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface JyjcInspectionEquipStatisticsMapper extends BaseMapper<JyjcInspectionEquipStatistics> { public interface JyjcInspectionEquipStatisticsMapper extends BaseMapper<JyjcInspectionEquipStatistics> {
void deleteByApplicationSeq(Long seq);
} }
...@@ -2,22 +2,22 @@ package com.yeejoin.amos.boot.module.jyjc.api.model; ...@@ -2,22 +2,22 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
/** /**
*
*
* @author system_generator * @author system_generator
* @date 2023-12-14 * @date 2023-12-14
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="JyjcInspectionApplicationEquipModel", description="") @ApiModel(value = "JyjcInspectionApplicationEquipModel", description = "")
public class JyjcInspectionApplicationEquipModel extends BaseModel { public class JyjcInspectionApplicationEquipModel extends BaseModel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "报检申请表主键") @ApiModelProperty(value = "报检申请表主键")
...@@ -29,4 +29,60 @@ public class JyjcInspectionApplicationEquipModel extends BaseModel { ...@@ -29,4 +29,60 @@ public class JyjcInspectionApplicationEquipModel extends BaseModel {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "业务类型(与菜单对应拆表使用)")
private String bizType;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备类别名称")
private String equCategoryName;
@ApiModelProperty(value = "检验检测类型编码")
private String inspectionType;
@ApiModelProperty(value = "检验检测类型名称(冗余)")
private String inspectionTypeName;
@ApiModelProperty(value = "报检日期")
private Date applicationDate;
@ApiModelProperty("检验结果方式")
private String resultType;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备种类名称")
private String equListName;
@ApiModelProperty(value = "使用登记证编号")
private String useOrgCode;
@ApiModelProperty(value = "单位内部编号")
private String useInnerCode;
@ApiModelProperty(value = "注册代码")
private String equCode;
@ApiModelProperty(value = "设备使用地点省")
private String provinceName;
@ApiModelProperty(value = "设备使用地点市")
private String cityName;
@ApiModelProperty(value = "设备使用地点区")
private String countyName;
@ApiModelProperty(value = "设备使用地点街道")
private String streetName;
@ApiModelProperty(value = "设备使用地点详细")
private String address;
@ApiModelProperty(value = "使用单位")
private String useUnitName;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useUnitCreditCode;
} }
...@@ -2,25 +2,24 @@ package com.yeejoin.amos.boot.module.jyjc.api.model; ...@@ -2,25 +2,24 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
*
*
* @author system_generator * @author system_generator
* @date 2023-12-14 * @date 2023-12-14
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="JyjcInspectionApplicationModel", description="") @ApiModel(value = "JyjcInspectionApplicationModel", description = "")
public class JyjcInspectionApplicationModel extends BaseModel { public class JyjcInspectionApplicationModel extends BaseModel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "检验检测单位编码") @ApiModelProperty(value = "检验检测单位编码")
...@@ -67,6 +66,12 @@ public class JyjcInspectionApplicationModel extends BaseModel { ...@@ -67,6 +66,12 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "报检单位编号") @ApiModelProperty(value = "报检单位编号")
private String applicationUnitCode; private String applicationUnitCode;
@ApiModelProperty(value = "报检单位名称")
private String applicationUnitName;
@ApiModelProperty(value = "报检单位地址")
private String address;
@ApiModelProperty(value = "监管单位名称")
private String superviseOrgName;
@ApiModelProperty(value = "包含设备数量(冗余)") @ApiModelProperty(value = "包含设备数量(冗余)")
private Integer numberOfEquip; private Integer numberOfEquip;
...@@ -77,7 +82,7 @@ public class JyjcInspectionApplicationModel extends BaseModel { ...@@ -77,7 +82,7 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "工作流实例ID") @ApiModelProperty(value = "工作流实例ID")
private String processInstanceId; private String processInstanceId;
@ApiModelProperty(value = "工作流key") @ApiModelProperty(value = "工作流key")
private String processKey; private String processKey;
@ApiModelProperty(value = "申请单二维码") @ApiModelProperty(value = "申请单二维码")
...@@ -98,20 +103,43 @@ public class JyjcInspectionApplicationModel extends BaseModel { ...@@ -98,20 +103,43 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存") @ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存")
private String workflowNode; private String workflowNode;
@ApiModelProperty(value = "告知书") @ApiModelProperty(value = "告知书")
private List<Map<String,Object>> gzs; private List<Map<String,Object>> gzs;
@ApiModelProperty(value = "产品质量证明书") @ApiModelProperty(value = "产品质量证明书")
private List<Map<String,Object>> cpzl; private List<Map<String,Object>> cpzl;
@ApiModelProperty(value = "施工自行检查报告") @ApiModelProperty(value = "施工自行检查报告")
private List<Map<String,Object>> sgzx ; private List<Map<String,Object>> sgzx ;
@ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存") @ApiModelProperty(value = "施工合同或证明")
private List<Map<String,Object>> sght; private List<Map<String,Object>> sght;
@ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存") @ApiModelProperty(value = "施工方案/施工设计文件")
private List<Map<String,Object>> sgfa; private List<Map<String,Object>> sgfa;
@ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存") @ApiModelProperty(value = "施工单位许可证书")
private List<Map<String,Object>> sgdwxk; private List<Map<String,Object>> sgdwxk;
@ApiModelProperty(value = "型式试验证书")
private List<Map<String,Object>> xssy;
@ApiModelProperty(value = "限速器和渐进式安全钳的调试证书")
private List<Map<String,Object>> xsqts;
@ApiModelProperty(value = "土建声明")
private List<Map<String,Object>> tjsm;
@ApiModelProperty(value = "质量保证手册和程序文件")
private List<Map<String,Object>> zlbz;
@ApiModelProperty(value = "施工作业文件")
private List<Map<String,Object>> sgzy;
@ApiModelProperty(value = "施工人员、质量保证体系责任人、专业技术人员身份证、技术工人的身份证及资质证书")
private List<Map<String,Object>> sgry;
@ApiModelProperty(value = "产品技术文件")
private List<Map<String,Object>> cpjs;
@ApiModelProperty(value = "施工设计文件")
private List<Map<String,Object>> sgsj;
@ApiModelProperty(value = "施工分包方目录")
private List<Map<String,Object>> sgfb;
@ApiModelProperty(value = "分包方评价资料")
private List<Map<String,Object>> fbspj;
@ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存") @ApiModelProperty(value = "操作类型 0 新增 2 编辑 1 暂存")
private List<Map<String,Object>> equip; private List<Map<String,Object>> equip;
@ApiModelProperty("检验结果方式")
private String resultType;
} }
...@@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode; ...@@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel; import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 业务开通申请表 * 业务开通申请表
...@@ -31,6 +33,7 @@ public class JyjcInspectionResultModel extends BaseModel { ...@@ -31,6 +33,7 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "报检单位编号") @ApiModelProperty(value = "报检单位编号")
private String applicationUnitCode; private String applicationUnitCode;
//监管码
@ApiModelProperty(value = "设备唯一标识") @ApiModelProperty(value = "设备唯一标识")
private String equipUnicode; private String equipUnicode;
...@@ -91,12 +94,15 @@ public class JyjcInspectionResultModel extends BaseModel { ...@@ -91,12 +94,15 @@ public class JyjcInspectionResultModel extends BaseModel {
@ApiModelProperty(value = "检验检测类型名称(冗余)") @ApiModelProperty(value = "检验检测类型名称(冗余)")
private String inspectionTypeName; private String inspectionTypeName;
@ApiModelProperty(value = "报检日期")
private Date applicationDate;
@ApiModelProperty("检验结果方式")
private String resultType;
@ApiModelProperty(value = "设备种类") @ApiModelProperty(value = "设备种类")
private String equList; private String equList;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "使用登记证编号") @ApiModelProperty(value = "使用登记证编号")
private String useOrgCode; private String useOrgCode;
...@@ -120,8 +126,8 @@ public class JyjcInspectionResultModel extends BaseModel { ...@@ -120,8 +126,8 @@ public class JyjcInspectionResultModel extends BaseModel {
private String useUnitCreditCode; private String useUnitCreditCode;
@ApiModelProperty(value = "检验结果技术参数") @ApiModelProperty(value = "检验结果技术参数")
private JyjcInspectionResultParamModel resultParamModel; private Map<String,Object> resultParamModelMap;
@ApiModelProperty(value = "检验结果附件") @ApiModelProperty(value = "附件类型(特种设备检验报告:1,监检证书:2)")
private JyjcInspectionResultAttachmentModel resultAttachmentModel; private String attachmentType;
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.model; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.model;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; 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.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseUnitLicenceDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
...@@ -44,6 +45,7 @@ public class JyjcOpeningApplicationModel extends BaseModel { ...@@ -44,6 +45,7 @@ public class JyjcOpeningApplicationModel extends BaseModel {
private String resultType; private String resultType;
@ApiModelProperty (value = "有效期至") @ApiModelProperty (value = "有效期至")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date expiryDate; private Date expiryDate;
@ApiModelProperty (value = "受理日期(接收日期)") @ApiModelProperty (value = "受理日期(接收日期)")
......
package com.yeejoin.amos.boot.module.jyjc.api.service;
import java.util.Map;
/**
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.api.service
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 15:55
*/
public interface IJyjcInspectionApplicationHandlerService {
String type();
boolean notifyInspectionUnit(Map<String, Object> params);
}
package com.yeejoin.amos.boot.module.jyjc.api.service; package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import java.util.List;
/** /**
* 接口类 * 接口类
* *
* @author system_generator * @author system_generator
* @date 2023-12-14 * @date 2023-12-14
*/ */
public interface IJyjcInspectionApplicationService {} public interface IJyjcInspectionApplicationService {
void deleteBatchData(List<Long> sequenceNbr);
}
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 检验结果技术参数表接口类 * 检验结果技术参数表接口类
...@@ -17,4 +18,11 @@ public interface IJyjcInspectionResultParamService { ...@@ -17,4 +18,11 @@ public interface IJyjcInspectionResultParamService {
* @return * @return
*/ */
List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr); List<JyjcInspectionResultParam> getParamByResultSeq(Long sequenceNbr);
/**
* 根据设备code获取技术参数字段
* @param equipTypeCode 设备code
* @return 字段列表
*/
List<Map<String,Object>> getParamByEquipTypeCode(String equipTypeCode);
} }
package com.yeejoin.amos.boot.module.jyjc.api.service; package com.yeejoin.amos.boot.module.jyjc.api.service;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -18,4 +21,12 @@ public interface IJyjcInspectionResultService { ...@@ -18,4 +21,12 @@ public interface IJyjcInspectionResultService {
* @return 检验结果实体 * @return 检验结果实体
*/ */
Map<String, Object> queryDetailBySeq(Long sequenceNbr); Map<String, Object> queryDetailBySeq(Long sequenceNbr);
/**
* 获取设备种类
* @param type 获取的类型
* @param notNode 不需要节点
* @return 列表
*/
List<Map<String,Object>> equipList(String type, String notNode);
} }
...@@ -8,8 +8,16 @@ ...@@ -8,8 +8,16 @@
from from
tz_jyjc_inspection_application_attachment tz_jyjc_inspection_application_attachment
where where
application_seq = #{applicationSeq} application_seq =
#{applicationSeq}
</delete> </delete>
<select id="getDataByApplicationSeq" resultType="map">
select *
from tz_jyjc_inspection_application_attachment
where application_seq = #{applicationSeq}
</select>
</mapper> </mapper>
...@@ -5,26 +5,27 @@ ...@@ -5,26 +5,27 @@
<select id="queryForDataList" <select id="queryForDataList"
resultType="com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication"> resultType="com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication">
select select
tzjia.applicationNo, tzjia.application_no,
tzjia.inspectionType, tzjia.inspection_type,
tzjia.inspectionUnitName, (select name from cb_data_dictionary where cb_data_dictionary.code = tzjia.inspection_classify and cb_data_dictionary.type = 'JYJCLB') as inspectionClassify,
tzjia.equipClassify, tzjia.inspection_unit_code,
tzjia.numberOfEquip, (select name from cb_data_dictionary where cb_data_dictionary.code = tzjia.equip_classify and cb_data_dictionary.type = 'BJSBZL') as equipClassify,
tzjia.inspectionUnitName, tzjia.number_of_equip,
tzjia.applicationDate, tzjia.inspection_unit_code,
tzjia.acceptDate, tzjia.application_date,
tzjia.inspectionChargePerson, tzjia.accept_date,
tzjia.inspectionChargePhone, tzjia.inspection_charge_phone,
tzjia.inspection_charge_person,
tzjia.status tzjia.status
from from
tz_jyjc_inspection_application as tzjia tz_jyjc_inspection_application as tzjia
where <where>
tzjia.is_delete = 0
<if test=" applicationNo != null and applicationNo != ''"> <if test=" applicationNo != null and applicationNo != ''">
and applicationNo like concat('%',#{applicationNo}.'%') and application_no like concat('%',#{applicationNo}.'%')
</if> </if>
<if test="inspectionType != null and inspectionType != ''"> <if test="inspectionClassify != null and inspectionClassify != ''">
and inspectionType = #{inspectionType} and inspection_classify = #{inspectionClassify}
</if> </if>
<if test="inspectionUnitName != null and inspectionUnitName != ''"> <if test="inspectionUnitName != null and inspectionUnitName != ''">
and inspection_unit_code in (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{inspectionUnitName},'%')) and inspection_unit_code in (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{inspectionUnitName},'%'))
...@@ -39,22 +40,16 @@ ...@@ -39,22 +40,16 @@
and application_unit_code in (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{inspectionUnitName},'%')) and application_unit_code in (select use_code from tz_base_enterprise_info where use_unit like concat('%',#{inspectionUnitName},'%'))
</if> </if>
<if test="equipClassify != null and equipClassify != ''"> <if test="equipClassify != null and equipClassify != ''">
and equipClassify = #{equipClassify} and equip_classify = #{equipClassify}
</if>
<if test="numberOfEquip != null and numberOfEquip != ''">
and numberOfEquip = #{numberOfEquip}
</if> </if>
<if test="applicationDate != null and applicationDate != ''"> <if test="applicationDate != null and applicationDate != ''">
and applicationDate = #{applicationDate} and application_date = #{applicationDate}
</if> </if>
<if test="acceptDate != null and acceptDate != ''"> <if test="acceptDate != null and acceptDate != ''">
and acceptDate = #{acceptDate} and accept_date = #{acceptDate}
</if> </if>
<if test="inspectionChargePerson != null and inspectionChargePerson != ''"> <if test="inspectionChargePerson != null and inspectionChargePerson != ''">
and inspectionChargePerson like concat('%',#{inspectionChargePerson}.'%') and inspection_charge_person like concat('%',#{inspectionChargePerson}.'%')
</if>
<if test="inspectionChargePhone != null and inspectionChargePhone != ''">
and inspectionChargePhone like concat('%',#{inspectionChargePhone}.'%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and status = #{status} and status = #{status}
...@@ -62,5 +57,48 @@ ...@@ -62,5 +57,48 @@
<if test="bizType != null and bizType != ''"> <if test="bizType != null and bizType != ''">
and biz_type = #{bizType} and biz_type = #{bizType}
</if> </if>
</where>
</select>
<select id="listByCategory"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel">
select
use_unit_name,
use_unit_credit_code,
province_name,
city_name,
county_name,
street_name,
address,
use_inner_code,
equ_list,
tec1.name equ_list_name,
equ_category,
tec.name equ_category_name,
use_org_code,
equ_code,
supervisory_code
from
idx_biz_jg_use_info ibjui
left join idx_biz_jg_register_info ibjri on ibjui.record = ibjri.record
left join idx_biz_jg_other_info ibjoi on ibjui.record = ibjoi.record
left join amos_tzs_biz.tz_equipment_category tec on ibjri.equ_category = tec.code
left join amos_tzs_biz.tz_equipment_category tec1 on ibjri.equ_list = tec1.code
<where>
<if test="equipClassify != null and equipClassify != ''">
and equ_list = #{equipClassify}
</if>
</where>
</select>
<select id="selectDataBySeq" resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel">
SELECT
tzjia.*,
tbei.supervise_org_name AS superviseOrgName,
tbei.use_unit AS applicationUnitName,
tbei.address AS address
FROM
tz_jyjc_inspection_application AS tzjia
LEFT JOIN tz_base_enterprise_info tbei ON tzjia.application_unit_code = tbei.use_code
WHERE
tzjia.sequence_nbr = #{sequenceNbr}
</select> </select>
</mapper> </mapper>
...@@ -2,4 +2,12 @@ ...@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.jyjc.api.mapper.JyjcInspectionApplicationPushLogMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationPushLogMapper">
<delete id="deleteByApplicationSeq">
delete
*
from
tz_jyjc_inspection_application_push_log
where
application_seq = #{applicationSeq}
</delete>
</mapper> </mapper>
...@@ -2,4 +2,12 @@ ...@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.jyjc.api.mapper.JyjcInspectionEquipStatisticsMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionEquipStatisticsMapper">
<delete id="deleteByApplicationSeq">
delete
*
from
tz_jyjc_inspection_equip_statistics
where
application_seq = #{applicationSeq}
</delete>
</mapper> </mapper>
...@@ -4,22 +4,54 @@ ...@@ -4,22 +4,54 @@
<select id="selectJyjcInspectionResultpPage" <select id="selectJyjcInspectionResultpPage"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel"> resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
SELECT sequence_nbr, inspection_unit_code, application_no, application_unit_code, equip_unicode, result_status, select res.sequence_nbr, res.inspection_unit_code, res.application_no, res.application_unit_code,
license_number, result_no, inspector, inner_person_code, inspection_conclusion, inspection_date, res.equip_unicode, res.result_status, res.license_number, res.result_no, res.inspector, res.inner_person_code,
next_inspection_date, inspection_start_date, inspection_end_date, inspection_result_summary, non_conformance, res.inspection_conclusion, res.inspection_date, res.next_inspection_date, res.inspection_start_date,
rectification, remark, rec_user_id, rec_date, biz_type res.inspection_end_date, res.inspection_result_summary, res.non_conformance, res.rectification, res.remark,
FROM tz_jyjc_inspection_result res.rec_user_id, res.rec_date, res.biz_type,res.equ_category, res.inspection_type, res.inspection_type_name,
res.application_date,use_unit_name, use_unit_credit_code, province_name, city_name, county_name, street_name,
address, equ_code, use_inner_code, equ_list, tec1.name equ_list_name, ibjri.equ_category, tec.name
equ_category_name, use_org_code
from tz_jyjc_inspection_result res
left join idx_biz_jg_other_info ibjoi on res.equip_unicode = ibjoi.supervisory_code
left join idx_biz_jg_use_info ibjui on ibjui.record = ibjoi.record
left join idx_biz_jg_register_info ibjri on ibjui.record = ibjri.record
left join tz_equipment_category tec on ibjri.equ_category = tec.code
left join tz_equipment_category tec1 on ibjri.equ_list = tec1.code
<where> <where>
<if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null"> <if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null">
and application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%') and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%')
</if> </if>
<if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null"> <if test="jyjcInspectionResultModel.inspectionUnitCode != '' and jyjcInspectionResultModel.inspectionUnitCode != null">
and inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode} and res.inspection_unit_code = #{jyjcInspectionResultModel.inspectionUnitCode}
</if> </if>
<if test="jyjcInspectionResultModel.applicationUnitCode != '' and jyjcInspectionResultModel.applicationUnitCode != null"> <if test="jyjcInspectionResultModel.applicationUnitCode != '' and jyjcInspectionResultModel.applicationUnitCode != null">
and application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode} and res.application_unit_code = #{jyjcInspectionResultModel.applicationUnitCode}
</if>
<if test="jyjcInspectionResultModel.useUnitCreditCode != '' and jyjcInspectionResultModel.useUnitCreditCode != null">
and use_unit_credit_code like concat('%',#{jyjcInspectionResultModel.useUnitCreditCode},'%')
</if>
<if test="jyjcInspectionResultModel.useInnerCode != '' and jyjcInspectionResultModel.useInnerCode != null">
and use_inner_code like concat('%',#{jyjcInspectionResultModel.useInnerCode},'%')
</if>
<if test="jyjcInspectionResultModel.equCode != '' and jyjcInspectionResultModel.equCode != null">
and equ_code like concat('%',#{jyjcInspectionResultModel.equCode},'%')
</if>
<if test="jyjcInspectionResultModel.useOrgCode != '' and jyjcInspectionResultModel.useOrgCode != null">
and use_org_code like concat('%',#{jyjcInspectionResultModel.useOrgCode},'%')
</if>
<if test="jyjcInspectionResultModel.equipUnicode != '' and jyjcInspectionResultModel.equipUnicode != null">
and res.equip_unicode like concat('%',#{jyjcInspectionResultModel.equipUnicode},'%')
</if>
<if test="jyjcInspectionResultModel.equCategory != '' and jyjcInspectionResultModel.equCategory != null">
and ibjri.equ_category = #{jyjcInspectionResultModel.equCategory}
</if>
<if test="jyjcInspectionResultModel.inspectionType != '' and jyjcInspectionResultModel.inspectionType != null">
and res.inspection_type = #{jyjcInspectionResultModel.inspectionType}
</if>
<if test="jyjcInspectionResultModel.applicationDate!=null">
AND TO_DAYS(res.application_date) = TO_DAYS(#{jyjcInspectionResultModel.applicationDate})
</if> </if>
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
workflow_prostance_id, workflow_prostance_id,
workflow_role, workflow_role,
unit_code_name, unit_code_name,
status, status_name,
status_name workflow_active_key
from tz_jyjc_opening_application from tz_jyjc_opening_application
<where> <where>
<if test="jyjcOpeningApplicationRequstDto.applicationSeq != '' and jyjcOpeningApplicationRequstDto.applicationSeq != null"> <if test="jyjcOpeningApplicationRequstDto.applicationSeq != '' and jyjcOpeningApplicationRequstDto.applicationSeq != null">
......
package com.yeejoin.amos.boot.module.jyjc.biz.config; package com.yeejoin.amos.boot.module.jyjc.biz.config;
import com.yeejoin.amos.boot.module.ymt.api.enums.BaseExceptionEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.BaseExceptionEnum;
/** /**
......
package com.yeejoin.amos.boot.module.jyjc.biz.config; package com.yeejoin.amos.boot.module.jyjc.biz.config;
import com.yeejoin.amos.boot.module.ymt.api.common.BaseException;
import com.yeejoin.amos.boot.module.ymt.api.enums.CommonErrorEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.CommonErrorEnum;
/** /**
......
package com.yeejoin.amos.boot.module.jyjc.biz.controller; package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonserviceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.CommonserviceImpl;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcOpeningApplicationServiceImpl; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
*
* @author system_generator * @author system_generator
* @date 2023-12-13 * @date 2023-12-13
*/ */
...@@ -39,9 +24,8 @@ import java.util.stream.Collectors; ...@@ -39,9 +24,8 @@ import java.util.stream.Collectors;
@RequestMapping(value = "/common") @RequestMapping(value = "/common")
public class CommonController extends BaseController { public class CommonController extends BaseController {
@Autowired @Autowired
CommonserviceImpl commonserviceImpl; CommonserviceImpl commonserviceImpl;
/** /**
* 新增 * 新增
...@@ -49,10 +33,21 @@ public class CommonController extends BaseController { ...@@ -49,10 +33,21 @@ public class CommonController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getJyjcPersonByUnitCode") @PostMapping(value = "/getJyjcPersonByUnitCode")
@ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验人员列表", notes = "根据公司的unitCode获取检测检验人员列表") @ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验人员列表", notes = "根据公司的unitCode获取检测检验人员列表")
public ResponseModel<List<TzsUserInfo>> getUserInfosByUnitCode(@RequestParam String unitCode) { public ResponseModel<List<TzsUserInfo>> getUserInfosByUnitCode(@RequestParam String unitCode) {
return ResponseHelper.buildResponse(commonserviceImpl.getUserInfosByUnitCode(unitCode)); return ResponseHelper.buildResponse(commonserviceImpl.getUserInfosByUnitCode(unitCode));
} }
/**
* 查询检验检测机构列表(基本信息及联系人)
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getInspectionUnitList")
@ApiOperation(httpMethod = "GET", value = "查询检验检测机构列表(基本信息及联系人)", notes = "查询检验检测机构列表(基本信息及联系人)")
public ResponseModel<List<TzBaseEnterpriseInfo>> getInspectionUnitList() {
return ResponseHelper.buildResponse(commonserviceImpl.getInspectionUnitList());
}
} }
...@@ -18,8 +18,6 @@ import java.util.List; ...@@ -18,8 +18,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
*
*
* @author system_generator * @author system_generator
* @date 2023-12-14 * @date 2023-12-14
*/ */
...@@ -37,28 +35,28 @@ public class JyjcInspectionResultController extends BaseController { ...@@ -37,28 +35,28 @@ public class JyjcInspectionResultController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<JyjcInspectionResultModel> save(@RequestBody JyjcInspectionResultModel model) { public ResponseModel<JyjcInspectionResultModel> save(@RequestBody JyjcInspectionResultModel model) {
model = jyjcInspectionResultServiceImpl.createWithModel(model); model = jyjcInspectionResultServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<JyjcInspectionResultModel> updateBySequenceNbrJyjcInspectionResult(@RequestBody JyjcInspectionResultModel model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<JyjcInspectionResultModel> updateBySequenceNbrJyjcInspectionResult(@RequestBody JyjcInspectionResultModel model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateWithModel(model));
} }
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
...@@ -67,75 +65,76 @@ public class JyjcInspectionResultController extends BaseController { ...@@ -67,75 +65,76 @@ public class JyjcInspectionResultController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.removeById(sequenceNbr));
} }
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<Map<String, Object>> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<Map<String, Object>> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryDetailBySeq(sequenceNbr)); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryDetailBySeq(sequenceNbr));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<JyjcInspectionResultModel>> selectForList() { public ResponseModel<List<JyjcInspectionResultModel>> selectForList() {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultList()); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultList());
} }
/** /**
* 列表页面(报检单位) * 列表页面(报检单位)
* *
* @param current 当前页 * @param current 当前页
* @param size 当前页大小 * @param size 当前页大小
* @param model 查询参数 * @param model 查询参数
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/applicationUnitPage") @PostMapping(value = "/applicationUnitPage")
@ApiOperation(httpMethod = "GET", value = "列表页面(报检单位)", notes = "列表页面(报检单位)") @ApiOperation(httpMethod = "Post", value = "列表页面(报检单位)", notes = "列表页面(报检单位)")
public ResponseModel<Page<JyjcInspectionResultModel>> applicationUnitQueryForPage( public ResponseModel<Page<JyjcInspectionResultModel>> applicationUnitQueryForPage(
@RequestParam(value = "current") int current, @RequestParam int current, @RequestParam int size,
@RequestParam(value = "size") int size, JyjcInspectionResultModel model) { @RequestBody JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>(); Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, false)); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, false));
} }
/**
* 列表页面(检验检测单位)
*
* @param current 当前页
* @param size 当前页大小
* @param model 查询参数
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/inspectionUnitPage")
@ApiOperation(httpMethod = "POST", value = "列表页面(检验检测单位)", notes = "列表页面(检验检测单位)")
public ResponseModel<Page<JyjcInspectionResultModel>> inspectionUnitQueryForPage(
@RequestParam int current, @RequestParam int size,
@RequestBody JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, true));
}
/**
* 列表页面(检验检测单位)
*
* @param current 当前页
* @param size 当前页大小
* @param model 查询参数
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/inspectionUnitPage")
@ApiOperation(httpMethod = "GET", value = "列表页面(检验检测单位)", notes = "列表页面(检验检测单位)")
public ResponseModel<Page<JyjcInspectionResultModel>> inspectionUnitQueryForPage(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, JyjcInspectionResultModel model) {
Page<JyjcInspectionResultModel> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.queryForJyjcInspectionResultPage(page, model, true));
}
/** /**
* 检验结果-上传结果和编辑结果 * 检验结果-上传结果和编辑结果
...@@ -145,7 +144,21 @@ public class JyjcInspectionResultController extends BaseController { ...@@ -145,7 +144,21 @@ public class JyjcInspectionResultController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateResult") @PutMapping(value = "/updateResult")
@ApiOperation(httpMethod = "PUT", value = "检验结果-上传结果和编辑结果", notes = "检验结果-上传结果和编辑结果") @ApiOperation(httpMethod = "PUT", value = "检验结果-上传结果和编辑结果", notes = "检验结果-上传结果和编辑结果")
public ResponseModel<JyjcInspectionResultModel> updateJyjcInspectionResult(@RequestBody JyjcInspectionResultModel model) { public ResponseModel<JyjcInspectionResultModel> updateJyjcInspectionResult(@RequestBody Map<String, Map<String, Object>> model) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateJyjcInspectionResult(model)); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.updateJyjcInspectionResult(model));
} }
/**
* 获取设备种类列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取设备种类列表", notes = "获取设备种类列表")
@GetMapping(value = "/equipTypeList")
public ResponseModel<List<Map<String, Object>>> equipTypeList(@RequestParam(required = false) String type, @RequestParam(required = false) String notNode) {
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.equipList(type, notNode));
}
} }
...@@ -6,6 +6,8 @@ import io.swagger.annotations.Api; ...@@ -6,6 +6,8 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultParamServiceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionResultParamServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -113,4 +115,16 @@ public class JyjcInspectionResultParamController extends BaseController { ...@@ -113,4 +115,16 @@ public class JyjcInspectionResultParamController extends BaseController {
public ResponseModel<List<JyjcInspectionResultParamModel>> selectForList() { public ResponseModel<List<JyjcInspectionResultParamModel>> selectForList() {
return ResponseHelper.buildResponse(jyjcInspectionResultParamServiceImpl.queryForJyjcInspectionResultParamList()); return ResponseHelper.buildResponse(jyjcInspectionResultParamServiceImpl.queryForJyjcInspectionResultParamList());
} }
/**
* 获取某一类设备的技术参数
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "获取某一类设备的技术参数", notes = "获取某一类设备的技术参数")
@GetMapping(value = "/getParamByEquipTypeCode")
public ResponseModel<List<Map<String,Object>>> getParamByEquipTypeCode(@RequestParam String equipTypeCode) {
return ResponseHelper.buildResponse(jyjcInspectionResultParamServiceImpl.getParamByEquipTypeCode(equipTypeCode));
}
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jyjc.biz.controller;
import cn.hutool.core.map.MapBuilder; import cn.hutool.core.map.MapBuilder;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication;
import com.yeejoin.amos.boot.module.jyjc.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationRequstDto;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException; import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
...@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcOpeningApplicationServiceImpl; import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcOpeningApplicationServiceImpl;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,10 +27,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel; ...@@ -25,10 +27,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcOpeningApplicationModel;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.Collection; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -97,6 +96,11 @@ public class JyjcOpeningApplicationController extends BaseController { ...@@ -97,6 +96,11 @@ public class JyjcOpeningApplicationController extends BaseController {
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
JyjcOpeningApplication jyjcOpeningApplication = jyjcOpeningApplicationServiceImpl.getById(sequenceNbr);
List<String> status = Arrays.asList(String.valueOf(FlowStatusEnum.ROLLBACK.getCode()),String.valueOf(FlowStatusEnum.REJECTED.getCode()));
if(status.contains(jyjcOpeningApplication.getStatus())){
throw new BadRequest("除撤回跟驳回的流程之外其余流程不可删除!");
}
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.removeById(sequenceNbr));
} }
...@@ -110,7 +114,7 @@ public class JyjcOpeningApplicationController extends BaseController { ...@@ -110,7 +114,7 @@ public class JyjcOpeningApplicationController extends BaseController {
@DeleteMapping(value = "batchDelete") @DeleteMapping(value = "batchDelete")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbrList") List<Long> sequenceNbrList){ public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbrList") List<Long> sequenceNbrList){
return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.deleteBatchSeq(sequenceNbrList)); return ResponseHelper.buildResponse(jyjcOpeningApplicationServiceImpl.deleteBatchByIds(sequenceNbrList));
} }
/** /**
...@@ -201,8 +205,8 @@ public class JyjcOpeningApplicationController extends BaseController { ...@@ -201,8 +205,8 @@ public class JyjcOpeningApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "撤回业务开通申请", notes = "撤回业务开通申请") @ApiOperation(httpMethod = "GET",value = "撤回业务开通申请", notes = "撤回业务开通申请")
@GetMapping(value = "/rollBackFlow") @GetMapping(value = "/rollBackFlow")
public void overflow( @RequestParam("instanceId") String instanceId) { public void overflow( @RequestParam("sequenceNbr") String sequenceNbr) {
jyjcOpeningApplicationServiceImpl.stopFlow(instanceId); jyjcOpeningApplicationServiceImpl.stopFlow(sequenceNbr);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -26,6 +27,10 @@ public class CommonserviceImpl { ...@@ -26,6 +27,10 @@ public class CommonserviceImpl {
@Autowired @Autowired
TzsUserInfoMapper userInfoMapper; TzsUserInfoMapper userInfoMapper;
@Autowired
TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
public static final String UNIT_TYPE = "检验检测机构";
/** /**
* @return ReginParams * @return ReginParams
...@@ -43,4 +48,8 @@ public class CommonserviceImpl { ...@@ -43,4 +48,8 @@ public class CommonserviceImpl {
List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper); List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper);
return userInfos; return userInfos;
} }
public List<TzBaseEnterpriseInfo> getInspectionUnitList() {
return enterpriseInfoMapper.getInspectionUnitList(UNIT_TYPE);
}
} }
...@@ -4,9 +4,13 @@ import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEqu ...@@ -4,9 +4,13 @@ import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEqu
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationEquipMapper; import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationEquipMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationEquipService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationEquipService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Collections;
import java.util.List; import java.util.List;
/** /**
...@@ -30,4 +34,13 @@ public class JyjcInspectionApplicationEquipServiceImpl extends BaseService<JyjcI ...@@ -30,4 +34,13 @@ public class JyjcInspectionApplicationEquipServiceImpl extends BaseService<JyjcI
public List<JyjcInspectionApplicationEquipModel> queryForJyjcInspectionApplicationEquipList() { public List<JyjcInspectionApplicationEquipModel> queryForJyjcInspectionApplicationEquipList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
public List<JyjcInspectionApplicationEquipModel> listApplicationEquipByApplicationSeq(Long applicationSeq) {
// this.queryForList 尽量不要重载方法
List<JyjcInspectionApplicationEquip> entitys = this.lambdaQuery().eq(JyjcInspectionApplicationEquip::getApplicationSeq, applicationSeq).list();
if (ValidationUtil.isEmpty(entitys)) {
return Collections.EMPTY_LIST;
}
return Bean.toModels(entitys, JyjcInspectionApplicationEquipModel.class);
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationPushLog; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationPushLog;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationPushLogMapper; import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionApplicationPushLogMapper;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEquipModel;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationPushLogService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationPushLogService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationPushLogModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationPushLogModel;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 服务实现类 * 服务实现类
...@@ -30,4 +34,26 @@ public class JyjcInspectionApplicationPushLogServiceImpl extends BaseService<Jyj ...@@ -30,4 +34,26 @@ public class JyjcInspectionApplicationPushLogServiceImpl extends BaseService<Jyj
public List<JyjcInspectionApplicationPushLogModel> queryForJyjcInspectionApplicationPushLogList() { public List<JyjcInspectionApplicationPushLogModel> queryForJyjcInspectionApplicationPushLogList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
/**
* 记录日志
*
*
* @param params params
* @return {@link boolean}
* @author yangyang
* @throws
* @date 2023/12/15 15:53
*/
public boolean saveInspectionApplicationPushLog(Map<String, Object> params) {
JyjcInspectionApplicationModel inspectionApplicationModel = (JyjcInspectionApplicationModel) params.get("inspectionApplication");
List<JyjcInspectionApplicationEquipModel> applicationEquipModels = (List<JyjcInspectionApplicationEquipModel>) params.get("applicationEquips");
JyjcInspectionApplicationPushLog logEntity = new JyjcInspectionApplicationPushLog();
logEntity.setApplicationSeq(inspectionApplicationModel.getSequenceNbr());
logEntity.setInspectionUnitCode(inspectionApplicationModel.getInspectionUnitCode());
logEntity.setPushData(JSON.toJSONString(applicationEquipModels));
logEntity.setPushStatus("0");
return this.save(logEntity);
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper; import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionResultParamMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultParamModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultParamModel;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 检验结果技术参数表服务实现类 * 检验结果技术参数表服务实现类
...@@ -18,6 +26,10 @@ import java.util.List; ...@@ -18,6 +26,10 @@ import java.util.List;
*/ */
@Service @Service
public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspectionResultParamModel,JyjcInspectionResultParam,JyjcInspectionResultParamMapper> implements IJyjcInspectionResultParamService { public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspectionResultParamModel,JyjcInspectionResultParam,JyjcInspectionResultParamMapper> implements IJyjcInspectionResultParamService {
@Value("classpath:/json/equipParam.json")
private Resource equipParam;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -38,4 +50,14 @@ public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspec ...@@ -38,4 +50,14 @@ public class JyjcInspectionResultParamServiceImpl extends BaseService<JyjcInspec
wrapper.eq(JyjcInspectionResultParam::getResultSeq, sequenceNbr); wrapper.eq(JyjcInspectionResultParam::getResultSeq, sequenceNbr);
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
@Override
public List<Map<String, Object>> getParamByEquipTypeCode(String equipTypeCode) {
List<Map<String, Object>> paramList = new ArrayList<>();
Map<String, List<Map<String, Object>>> paramJson = JsonUtils.getResourceJson(equipParam);
if (StringUtil.isNotEmpty(equipTypeCode)) {
paramList = ObjectUtils.isEmpty(paramJson.get(equipTypeCode)) ? new ArrayList<>() : paramJson.get(equipTypeCode);
}
return paramList;
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultAttachment;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResultParam;
...@@ -16,16 +17,22 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel; ...@@ -16,16 +17,22 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -44,6 +51,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -44,6 +51,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
private IJyjcInspectionResultParamService iJyjcInspectionResultParamService; private IJyjcInspectionResultParamService iJyjcInspectionResultParamService;
@Autowired @Autowired
EquipmentCategoryMapper equipmentCategoryMapper;
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
JyjcInspectionResultMapper resultMapper; JyjcInspectionResultMapper resultMapper;
@Autowired @Autowired
...@@ -59,6 +72,9 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -59,6 +72,9 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
public Page<JyjcInspectionResultModel> queryForJyjcInspectionResultPage(Page<JyjcInspectionResultModel> page, JyjcInspectionResultModel model, boolean type) { public Page<JyjcInspectionResultModel> queryForJyjcInspectionResultPage(Page<JyjcInspectionResultModel> page, JyjcInspectionResultModel model, boolean type) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),
RequestContext.getToken())).toString(), ReginParams.class); RequestContext.getToken())).toString(), ReginParams.class);
if (ObjectUtils.isEmpty(model)) {
model = new JyjcInspectionResultModel();
}
if (type) { if (type) {
//检验检测单位分页查询 //检验检测单位分页查询
model.setInspectionUnitCode(reginParams.getCompany().getCompanyCode()); model.setInspectionUnitCode(reginParams.getCompany().getCompanyCode());
...@@ -77,12 +93,32 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -77,12 +93,32 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
} }
public JyjcInspectionResultModel updateJyjcInspectionResult(JyjcInspectionResultModel model) { public JyjcInspectionResultModel updateJyjcInspectionResult(Map<String, Map<String, Object>> tableModel) {
Map<String, Object> map = tableModel.get("inspectResult");
JyjcInspectionResultModel model = BeanUtil.mapToBean(map, JyjcInspectionResultModel.class, true);
updateWithModel(model); updateWithModel(model);
if (ObjectUtil.isNotEmpty(model.getResultAttachmentModel()))
attachmentService.createWithModel(model.getResultAttachmentModel()); List<JyjcInspectionResultAttachment> attachmentList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(model.getResultParamModel())) map.forEach((k, v) -> {
resultParamService.createWithModel(model.getResultParamModel()); if (k.contains("JYJC_") && !ObjectUtils.isEmpty(map.get(k))) {
JyjcInspectionResultAttachment attachment = new JyjcInspectionResultAttachment();
attachment.setResultSeq(model.getSequenceNbr());
attachment.setAttachmentUrl(JSON.toJSONString(map.get(k)));
attachment.setAttachmentType(k);
attachmentList.add(attachment);
}
});
if (!CollectionUtils.isEmpty(attachmentList)) {
attachmentService.saveBatch(attachmentList);
}
if (!CollectionUtils.isEmpty(model.getResultParamModelMap())){
JyjcInspectionResultParam resultParam = new JyjcInspectionResultParam();
resultParam.setResultSeq(model.getSequenceNbr());
resultParam.setParamJson(JSON.toJSONString(model.getResultParamModelMap()));
resultParamService.save(resultParam);
}
return model; return model;
} }
...@@ -105,7 +141,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -105,7 +141,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
// 获取附件 // 获取附件
List<JyjcInspectionResultAttachment> attachmentList = iJyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr); List<JyjcInspectionResultAttachment> attachmentList = iJyjcInspectionResultAttachmentService.getObjByResultSeq(sequenceNbr);
if (!CollectionUtils.isEmpty(attachmentList)) { if (!CollectionUtils.isEmpty(attachmentList)) {
Map<String, Object> attachmentMap = attachmentList.stream().collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrl)); Map<String, Object> attachmentMap = attachmentList.stream().map(obj -> {
if (StringUtil.isNotEmpty(obj.getAttachmentUrl())) {
obj.setAttachmentUrlList(JSONArray.parseArray(obj.getAttachmentUrl()));
}
return obj;
}).collect(Collectors.toMap(JyjcInspectionResultAttachment::getAttachmentType, JyjcInspectionResultAttachment::getAttachmentUrlList));
map.putAll(attachmentMap); map.putAll(attachmentMap);
} }
...@@ -121,6 +162,36 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -121,6 +162,36 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
map.put("paramJson", mapParam); map.put("paramJson", mapParam);
} }
} }
return map; Map<String, Object> resultMap = new HashMap<>();
resultMap.put("inspectResult", map);
return resultMap;
}
@Override
public List<Map<String, Object>> equipList(String type, String notNode) {
List<Map<String, Object>> menus = new ArrayList<>();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList;
if (ValidationUtil.isEmpty(type)) {
mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
} else {
mapList = resourceJson.get(type);
}
mapList.stream().filter(map -> {
if (!ObjectUtils.isEmpty(notNode)) {
String[] code = notNode.split(",");
List<String> codeList = Arrays.asList(code);
return !codeList.contains(map.get("code"));
}
return true;
}).forEach(obj -> {
Map<String, Object> resultMap = new HashMap<>(2);
resultMap.put("instanceName", obj.get("name"));
resultMap.put("instanceId", obj.get("code"));
menus.add(resultMap);
});
return menus;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jyjc.biz.feign.WorkflowFeignClient;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.LinkedHashMap;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 15:46
*/
@Component
@Slf4j
public class WorkflowHelper {
@Autowired
private WorkflowFeignClient workflowFeignClient;
/**
* 获取工作流
*
*
* @param instanceId instanceId
* @return {@link JSONObject}
* @author yangyang
* @throws
* @date 2023/12/15 16:17
*/
public JSONObject getTask(String instanceId) {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");// 工作流ID
FeignClientResult<JSONObject> nodeInfo = workflowFeignClient.getNodeInfotoken(RequestContext.getAppKey(), RequestContext.getProduct(), RequestContext.getToken(), taskId);
dataObject.put("nodeInfo", nodeInfo.getResult());
return dataObject;
}
public String getWorkflowStatus(JSONObject dataObject) {
return !ValidationUtil.isEmpty(dataObject) && !ValidationUtil.isEmpty(dataObject.get("status")) ? String.valueOf(dataObject.get("status")) : "";
}
public String getWorkflowRoleGroups(JSONObject dataObject) {
JSONArray executorArray = dataObject.getJSONObject("nodeInfo").getJSONArray("executor");
if(!ValidationUtil.isEmpty(executorArray)) {
return executorArray.stream().map(json -> Optional.ofNullable(((LinkedHashMap) json).get("groupId")).orElse("").toString()).collect(Collectors.joining(","));
}
return null;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationHandlerService;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationPushLogServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:12
*/
@Component
public class AbstractJyjcInspectionApplicationHandlerServiceImpl implements IJyjcInspectionApplicationHandlerService {
@Autowired
private JyjcInspectionApplicationPushLogServiceImpl applicationPushLogService;
@Override
public String type() {
return "default";
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
// push日志
applicationPushLogService.saveInspectionApplicationPushLog(params);
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 检测
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class DetectionInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.DETECTION.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 定检
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class FirstInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.FIRST_INSPECTION.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionApplicationHandlerService;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* @author yangyang
* @version v1.0
* @date 2023/11/8 15:10
*/
@Service
public class JyjcInspectionApplicationHandlerFactory implements ApplicationContextAware {
private static final Map<String, IJyjcInspectionApplicationHandlerService> SERVICE_POOL = new HashMap<>(12);
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
applicationContext.getBeansOfType(IJyjcInspectionApplicationHandlerService.class).forEach((beanName, bean) -> SERVICE_POOL.put(bean.type(), bean));
}
public static IJyjcInspectionApplicationHandlerService apply(String type) {
IJyjcInspectionApplicationHandlerService objectSceneService = SERVICE_POOL.get(type);
if (Objects.isNull(objectSceneService)) {
throw new IllegalArgumentException("SERVICE_POOL type: " + type + " is not found !");
}
return objectSceneService;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 监督检验
*
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.biz.service.impl.handler
*
* @author yangyang
* @version v1.0
* @date 2023/12/15 16:32
*/
@Component
public class SuperviseInspectionApplicationHandlerServiceImpl extends AbstractJyjcInspectionApplicationHandlerServiceImpl {
@Override
public String type() {
return BizTypeEnum.SUPERVISE.getCode();
}
@Override
public boolean notifyInspectionUnit(Map<String, Object> params) {
super.notifyInspectionUnit(params);
// todo
return true;
}
}
package com.yeejoin.amos.boot.module.jyjc.biz.utils;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Map;
public class JsonUtils {
//将json文件转化为Map<list<Map<>>>
public static Map getResourceJson(Resource resource) {
String json = null;
try {
json = IOUtils.toString(resource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(resource + "json文件转化失败");
}
return JSONObject.parseObject(json, Map.class);
}
}
{
"eightCategory": [
{
"name": "电梯",
"code": "3000",
"image": "upload/tzs/common/image/总览电梯.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "elevator"
},
{
"name": "起重机械",
"code": "4000",
"image": "upload/tzs/common/image/总览起重机械.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "lifting"
},
{
"name": "场内机动车辆",
"code": "5000",
"image": "upload/tzs/common/image/总览厂车.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "vehicle"
},
{
"name": "锅炉",
"code": "1000",
"image": "upload/tzs/common/image/总览锅炉.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "boiler"
},
{
"name": "压力容器",
"code": "2000",
"image": "upload/tzs/common/image/总览压力容器.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "vessel"
},
{
"name": "压力管道",
"code": "8000",
"image": "upload/tzs/common/image/总览压力管道.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "pipeline"
},
{
"name": "大型游乐设施",
"code": "6000",
"image": "upload/tzs/common/image/总览游乐设施.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "rides"
},
{
"name": "客运索道",
"code": "9000",
"image": "upload/tzs/common/image/总览索道.png",
"waitClaim": "0",
"alreadyClaim": "0",
"refuseClaim": "0",
"sum": "0",
"type": "ropeway"
}
],
"other": [
{
"name": "电梯",
"code": "3000"
},
{
"name": "起重机械",
"code": "4000"
},
{
"name": "场内机动车辆",
"code": "5000"
},
{
"name": "锅炉",
"code": "1000"
},
{
"name": "压力容器",
"code": "2000"
},
{
"name": "压力管道",
"code": "8000"
},
{
"name": "大型游乐设施",
"code": "6000"
},
{
"name": "客运索道",
"code": "9000"
}
]
}
\ No newline at end of file
{
"3000": [
{
"label": "使用年限",
"key": "synx",
"type": "input"
},
{
"label": "控制方式",
"key": "kzfs",
"type": "select",
"data": [
{
"name": "选项1",
"value": "1"
},
{
"name": "选项1",
"value": "1"
}
]
}
],
"4000": [
{
"label": "使用年限4000",
"key": "synx",
"type": "input"
}
]
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.tcm.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@AllArgsConstructor
@Getter
public enum PersonManageRoleEnum {
/**
* 人员管理角色枚举
*/
code("人员管理角色字典code", 6616L),
use("使用单位", 1735591519093547010L),
agw("安装改造维修单位", 1735591458058035201L),
jyjc("检验检测机构", 1735590873120399362L);
String name;
Long id;
public static Map<Long, String> getName = new HashMap<>();
public static Map<String, Long> getId = new HashMap<>();
static {
for (PersonManageRoleEnum e : PersonManageRoleEnum.values()) {
getName.put(e.id, e.name);
getId.put(e.name, e.id);
}
}
}
...@@ -31,4 +31,8 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { ...@@ -31,4 +31,8 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
List<GroupAndPersonInfoDto> getUnitInfoByUserId(Long groupId); List<GroupAndPersonInfoDto> getUnitInfoByUserId(Long groupId);
String selectPostNameByUserId(String userId); String selectPostNameByUserId(String userId);
List<Map<String, Object>> getUserTypeList(@Param(value = "typeList") List<String> typeList);
String selectCompanyTypeById(Long companySeq);
} }
...@@ -211,4 +211,21 @@ ...@@ -211,4 +211,21 @@
<select id="selectPostNameByUserId" resultType="java.lang.String"> <select id="selectPostNameByUserId" resultType="java.lang.String">
SELECT post_name FROM "tzs_user_info" WHERE amos_user_id = #{userId} SELECT post_name FROM "tzs_user_info" WHERE amos_user_id = #{userId}
</select> </select>
<select id="getUserTypeList" resultType="java.util.Map">
SELECT
*
FROM
"cb_data_dictionary"
WHERE
type in
<foreach collection="typeList" separator="," item="type" open="(" close=")">
#{type}
</foreach>
</select>
<select id="selectCompanyTypeById" resultType="java.lang.String">
select company_type from privilege_company where sequence_nbr = #{companySeq}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...@@ -82,7 +83,7 @@ public class TzsUserInfoController extends BaseController { ...@@ -82,7 +83,7 @@ public class TzsUserInfoController extends BaseController {
if (ObjectUtils.isEmpty(reginParams)) { if (ObjectUtils.isEmpty(reginParams)) {
return null; return null;
} }
CompanyModel companyModel = reginParams.getUserModel().getCompanys().get(0); CompanyBo companyModel = reginParams.getCompany();
if(ObjectUtils.isEmpty(companyModel)){ if(ObjectUtils.isEmpty(companyModel)){
throw new BadRequest("未指定人员归属单位信息"); throw new BadRequest("未指定人员归属单位信息");
} }
...@@ -218,11 +219,11 @@ public class TzsUserInfoController extends BaseController { ...@@ -218,11 +219,11 @@ public class TzsUserInfoController extends BaseController {
if (ObjectUtils.isEmpty(reginParams)) { if (ObjectUtils.isEmpty(reginParams)) {
return null; return null;
} }
CompanyModel companyModel = reginParams.getUserModel().getCompanys().get(0); CompanyBo company = reginParams.getCompany();
if(ObjectUtils.isEmpty(companyModel)){ if(ObjectUtils.isEmpty(company)){
throw new BadRequest("未指定人员归属单位信息"); throw new BadRequest("未指定人员归属单位信息");
} }
dto.setUnitCode(companyModel.getCompanyCode()); dto.setUnitCode(company.getCompanyCode());
Page<TzsUserInfoDto> page = new Page<>(); Page<TzsUserInfoDto> page = new Page<>();
page.setCurrent(Long.parseLong(current)); page.setCurrent(Long.parseLong(current));
page.setSize(Long.parseLong(size)); page.setSize(Long.parseLong(size));
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
...@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; ...@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.*; import com.yeejoin.amos.boot.module.tcm.api.entity.*;
import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.PersonManageRoleEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.TwoStipulateGroupEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.TwoStipulateGroupEnum;
import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserEquipMapper;
...@@ -262,6 +264,22 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -262,6 +264,22 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
} }
}); });
//添加人员管理角色
TzsUserInfo tzsUserInfo = tzsUserInfoMapper.selectById(sequenceNbr);
String post = tzsUserInfo.getPost();
if(post.contains(PersonManageRoleEnum.code.getId().toString())){
String companyType = tzsUserInfoMapper.selectCompanyTypeById(companySeq);
if(companyType.contains(PersonManageRoleEnum.jyjc.getName())){
roleIds.add(PersonManageRoleEnum.jyjc.getId());
}
if(companyType.contains(PersonManageRoleEnum.use.getName())){
roleIds.add(PersonManageRoleEnum.use.getId());
}
if(companyType.contains(PersonManageRoleEnum.agw.getName())){
roleIds.add(PersonManageRoleEnum.agw.getId());
}
}
Map<Long, List<Long>> roleSeqMap = new HashMap<>(); Map<Long, List<Long>> roleSeqMap = new HashMap<>();
Map<Long, List<RoleModel>> orgRoles = new HashMap<>(); Map<Long, List<RoleModel>> orgRoles = new HashMap<>();
roleSeqMap.put(companySeq, roleIds); roleSeqMap.put(companySeq, roleIds);
...@@ -271,7 +289,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -271,7 +289,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
agencyUserModel.setOrgRoleSeqs(roleSeqMap); agencyUserModel.setOrgRoleSeqs(roleSeqMap);
userResult = Privilege.agencyUserClient.create(agencyUserModel); userResult = Privilege.agencyUserClient.create(agencyUserModel);
if (userResult.getStatus() == 200) { if (userResult.getStatus() == 200) {
TzsUserInfo tzsUserInfo = tzsUserInfoMapper.selectById(sequenceNbr);
tzsUserInfo.setAmosUserId(userResult.getResult().getUserId()); tzsUserInfo.setAmosUserId(userResult.getResult().getUserId());
tzsUserInfo.setAmosUserName(userResult.getResult().getUserName()); tzsUserInfo.setAmosUserName(userResult.getResult().getUserName());
tzsUserInfo.setLockStatus(status); tzsUserInfo.setLockStatus(status);
...@@ -284,7 +302,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -284,7 +302,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds); Privilege.groupUserClient.create(Long.valueOf(roleGroup.getExtend()), userIds);
} }
//绑定两个规定用户组 //绑定两个规定用户组
String post = tzsUserInfo.getPost();
post = post.replace("[", "").replace("]", "").replace("\"", ""); post = post.replace("[", "").replace("]", "").replace("\"", "");
for (String code : post.split(",")) { for (String code : post.split(",")) {
DataDictionary groupId = iDataDictionaryService DataDictionary groupId = iDataDictionaryService
...@@ -366,6 +383,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -366,6 +383,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
boolean productCompany = false; boolean productCompany = false;
boolean useCompany = false; boolean useCompany = false;
boolean installCompany = false; boolean installCompany = false;
boolean inspectionCompany = false;
for (CompanyModel companyModel : companyModels) { for (CompanyModel companyModel : companyModels) {
String companyType = companyModel.getCompanyType(); String companyType = companyModel.getCompanyType();
if (companyType.contains("使用单位") || companyType.contains("个人主体")) { if (companyType.contains("使用单位") || companyType.contains("个人主体")) {
...@@ -377,19 +395,23 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -377,19 +395,23 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (companyType.contains("安装改造维修单位")){ if (companyType.contains("安装改造维修单位")){
installCompany = true; installCompany = true;
} }
if (companyType.contains("检验检测机构")){
inspectionCompany = true;
}
} }
String companyType = null; StringBuilder companyType = new StringBuilder();
if (useCompany) { if (useCompany) {
companyType = "use"; companyType.append("use-");
} }
if (productCompany) { if (productCompany) {
companyType = "pro"; companyType.append("pro-");
}
if (useCompany && productCompany) {
companyType = "useAndPro";
} }
if (installCompany) { if (installCompany) {
companyType = companyType + "AndInstall"; companyType.append("install-");
}
if (inspectionCompany) {
companyType.append("inspection");
} }
result.put("companyType", companyType); result.put("companyType", companyType);
return result; return result;
...@@ -526,18 +548,21 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -526,18 +548,21 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override @Override
public List<Map<String, Object>> getUserType(String unitType) { public List<Map<String, Object>> getUserType(String unitType) {
if (unitType.equals("pro")) { List<String> type = new ArrayList<>();
return tzsUserInfoMapper.getUserType("QYRYGW-SCDW", null); type.add("QYRYGW");
} else if (unitType.equals("use")) { if (unitType.contains("use")) {
return tzsUserInfoMapper.getUserType("QYRYGW-SYDW", null); type.add("QYRYGW-SYDW");
} else if (unitType.equals("useAndInstall")){
return tzsUserInfoMapper.getUserType("QYRYGW-SYDW", "QYRYGW-INSTALL");
} else if (unitType.equals("proAndInstall")){
return tzsUserInfoMapper.getUserType("QYRYGW-SCDW", "QYRYGW-INSTALL");
}else {
return tzsUserInfoMapper.getUserType(null, null);
} }
if (unitType.contains("pro")) {
type.add("QYRYGW-SCDW");
}
if (unitType.contains("install")) {
type.add("QYRYGW-INSTALL");
}
if (unitType.contains("inspection")) {
type.add("QYRYGW-INSPECTION");
}
return tzsUserInfoMapper.getUserTypeList(type);
} }
public List<LinkedHashMap> screenData(List<LinkedHashMap> result, List<LinkedHashMap> data, String id) { public List<LinkedHashMap> screenData(List<LinkedHashMap> result, List<LinkedHashMap> data, String id) {
......
...@@ -16,6 +16,7 @@ public enum ApplicationFormTypeEnum { ...@@ -16,6 +16,7 @@ public enum ApplicationFormTypeEnum {
*/ */
GZ("GZ"), GZ("GZ"),
JY("JY"), JY("JY"),
JG("JG"),// 检验结果
WB("WB"), WB("WB"),
SY("SY"); SY("SY");
......
package com.yeejoin.amos.boot.module.ymt.api.mapper; package com.yeejoin.amos.boot.module.ymt.api.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import org.springframework.data.repository.query.Param;
import java.util.List;
/** /**
* 企业数据信息 Mapper 接口 * 企业数据信息 Mapper 接口
...@@ -44,4 +45,11 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI ...@@ -44,4 +45,11 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto); IPage<TzBaseEnterpriseInfoDto> page(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto);
IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, List orgCodeList); IPage<TzBaseEnterpriseInfoDto> pageList(Page<TzBaseEnterpriseInfoDto> page, TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto, List orgCodeList);
/**
* 查找企业关联设备详情列表
*
*/
List<TzBaseEnterpriseInfo> getInspectionUnitList(@Param("unitType") String unitType);
} }
...@@ -85,7 +85,12 @@ ...@@ -85,7 +85,12 @@
USE_PLACE, USE_PLACE,
ADDRESS, ADDRESS,
EQU_STATE, EQU_STATE,
STATUS STATUS,
USE_INNER_CODE,
FACTORY_NUM,
PRODUCE_UNIT_NAME,
INSPECT_REPORT,
NEXT_INSPECT_DATE
from idx_biz_view_jg_all from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id} WHERE SEQUENCE_NBR = #{id}
</select> </select>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.useUnit!=null and tzBaseEnterpriseInfoDto.useUnit!='' "> test="tzBaseEnterpriseInfoDto.useUnit!=null and tzBaseEnterpriseInfoDto.useUnit!='' ">
AND use_unit LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useUnit},'%') AND use_unit LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useUnit},'%')
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.useUnitCertificate!=null and tzBaseEnterpriseInfoDto.useUnitCertificate!='' "> test="tzBaseEnterpriseInfoDto.useUnitCertificate!=null and tzBaseEnterpriseInfoDto.useUnitCertificate!='' ">
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.useCode!=null and tzBaseEnterpriseInfoDto.useCode!='' "> test="tzBaseEnterpriseInfoDto.useCode!=null and tzBaseEnterpriseInfoDto.useCode!='' ">
AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%') AND use_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useCode},'%')
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' "> test="tzBaseEnterpriseInfoDto.region!=null and tzBaseEnterpriseInfoDto.region!='' ">
...@@ -65,11 +65,11 @@ ...@@ -65,11 +65,11 @@
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' "> test="tzBaseEnterpriseInfoDto.legalPerson!=null and tzBaseEnterpriseInfoDto.legalPerson!='' ">
AND legal_person LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPerson},'%') AND legal_person LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPerson},'%')
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.legalPhone!=null and tzBaseEnterpriseInfoDto.legalPhone!='' "> test="tzBaseEnterpriseInfoDto.legalPhone!=null and tzBaseEnterpriseInfoDto.legalPhone!='' ">
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%') AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if> </if>
<if <if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' "> test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
...@@ -154,5 +154,10 @@ ...@@ -154,5 +154,10 @@
<select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo"> <select id="selectByUseUnit" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where use_unit = #{useUnit} select * from tz_base_enterprise_info where use_unit = #{useUnit}
</select> </select>
<select id="getInspectionUnitList" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo">
select sequence_nbr,use_code,use_unit,use_contact,contact_phone
from tz_base_enterprise_info
where unit_type LIKE CONCAT('%',#{unitType},'%')
</select>
</mapper> </mapper>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<springcloud.version>Hoxton.SR8</springcloud.version> <springcloud.version>Hoxton.SR8</springcloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<tyboot-version>1.1.23-SNAPSHOT</tyboot-version> <tyboot-version>1.1.23-SNAPSHOT</tyboot-version>
<amos.version>1.7.10-SNAPSHOT</amos.version> <amos.version>1.8.6</amos.version>
<itext.version>7.1.1</itext.version> <itext.version>7.1.1</itext.version>
<elasticsearch.version>7.15.2</elasticsearch.version> <elasticsearch.version>7.15.2</elasticsearch.version>
</properties> </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