Commit 07a7fe18 authored by yangyang's avatar yangyang

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

# Conflicts: # amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
parents ce5e4aab 5ae257af
......@@ -155,4 +155,7 @@ public class JgUseRegistration extends BaseEntity {
@TableField("inspect_unit_credit_code")
private String inspectUnitCreditCode;
@TableField("instance_status")
private String instanceStatus;
}
package com.yeejoin.amos.boot.module.jg.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
* 使用登记状态西悉尼
*/
@Getter
@AllArgsConstructor
public enum UseStatusEnum {
SUBMIT("使用单位提交", "submit", "使用单位待提交"),
RECEIVE("一级受理", "receive", "一级受理待受理"),
PRELIMINARY("二级受理", "preliminary", "二级受理待受理"),
REEXAMINE("三级受理", "reexamine", "三级受理待受理");
private final String name;
private final String code;
private final String pass;
public static UseStatusEnum getMessage(String name){
for (UseStatusEnum constants : values()) {
if (constants.getName().equals(name)) {
return constants;
}
}
return null;
}
}
......@@ -14,9 +14,9 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
//@FeignClient(value = "AMOS-API-WORKFLOW", configuration = {FeignConfiguration.class})
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = {MultipartSupportConfig.class})
public interface WorkFlowFeginService {
public interface WorkFlowFeignService {
/***
* 根据task_id 获取节点信息
......@@ -64,5 +64,9 @@ public interface WorkFlowFeginService {
@PathVariable(value = "processInstanceId") String processInstanceId);
@RequestMapping(value = "/v2/task/rollBack/{processInstanceId}", method = RequestMethod.POST)
JSONObject rollBack(@PathVariable(value = "processInstanceId") String processInstanceId);
}
......@@ -14,7 +14,10 @@
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place
concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place,
ur.instance_id as instanceId,
re.equip_id as equipId,
ur.apply_no as applyNo
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_relation_equip re on ur.sequence_nbr = re.business_id
LEFT JOIN idx_biz_jg_register_info jri on re.equip_id = jri.RECORD
......@@ -35,12 +38,16 @@
and ur.use_unit_name like concat('%',#{dto.useUnitName},'%')
</if>
</where>
order by ur.rec_date desc
</select>
<select id="getDetail" resultType="java.util.Map">
SELECT jri.EQU_CODE as equCode,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
-- (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
-- (SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
-- (SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.EQU_CATEGORY as equCategory,
jri.EQU_LIST as equList,
jri.EQU_DEFINE as equDefine,
jri.PRODUCT_NAME as productName,
jri.EQU_TYPE as equType,
jri.PRODUCT_PHOTO as proDuctPhoto,
......@@ -84,7 +91,8 @@
ADDRESS as address,
PROVINCE as province,
CITY as city,
COUNTY as county
COUNTY as county,
USE_INNER_CODE as useInnerCode
FROM "idx_biz_jg_use_info" where RECORD = #{id}
</select>
<select id="getEquipListPage" resultType="java.util.Map">
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.workflow.Workflow;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.AjaxResult;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -48,6 +45,22 @@ public class JgUseRegistrationController extends BaseController {
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/flowExecute")
@ApiOperation(httpMethod = "POST", value = "执行流程", notes = "执行流程")
public ResponseModel<Object> flowExecute(@RequestBody JSONObject map) {
jgUseRegistrationServiceImpl.flowExecute(String.valueOf(map.get("instanceId")), String.valueOf(map.get("operate")), String.valueOf(map.get("comment")), true);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/withdraw")
@ApiOperation(httpMethod = "POST", value = "撤回", notes = "撤回")
public ResponseModel<Object> withdraw(@RequestBody JSONObject map) {
jgUseRegistrationServiceImpl.withdraw(String.valueOf(map.get("instanceId")));
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/deleteBatch")
......@@ -98,61 +111,16 @@ public class JgUseRegistrationController extends BaseController {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.getDetail(id));
}
@Autowired
WorkFlowFeginService workFlowFeginService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test")
@ApiOperation(httpMethod = "GET", value = "", notes = "")
public ResponseModel test(@RequestParam("op") String op) {
String instanceId = "";
//启动流程
try {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("useRegistration");
dto.setBusinessKey("1");
AjaxResult ajaxResult = Workflow.taskClient.startByVariable(dto);
instanceId = ((Map) ajaxResult.get("data")).get("id").toString();
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(instanceId);
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getMessage")
public ResponseModel<Map<String, Object>> getMessage() {
ReginParams selectedOrgInfo = getSelectedOrgInfo();
HashMap<String, Object> map = new HashMap<>();
map.put("useUnitCreditCode", selectedOrgInfo.getCompany().getCompanyCode());
map.put("useUnitName", selectedOrgInfo.getCompany().getCompanyName());
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test1")
@ApiOperation(httpMethod = "GET", value = "", notes = "")
public void overProjectFlowExecute(@RequestParam("op") String op, @RequestParam("instanceId") String instanceId) {
try {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");
// JSONObject taskNoAuth = workFlowFeginService.getTaskNoAuth(instanceId);
// FeignClientResult<JSONObject> nodeInfo = workFlowFeginService.getNodeInfo(taskId);
//组装信息
TaskResultDTO dto = new TaskResultDTO();
// dto.setResult(op);
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
dto.setComment("啦啦啦啦!!!!!");
HashMap<String, Object> map = new HashMap<>();
map.put("approvalStatus", op);
dto.setVariable(map);
// FeignClientResult reject = Workflow.taskV2Client.reject(taskId, dto);
//执行流程
AjaxResult ajaxResult1 = Workflow.taskClient.completeByTask(taskId, dto);
if (ObjectUtils.isEmpty(ajaxResult1)) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.yeejoin.amos.boot.module.jyjc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 设备检验检测统计表
*
* @author system_generator
* @date 2023-12-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tz_jyjc_inspection_equip_statistics")
public class JyjcInspectionEquipStatistics extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 设备唯一标识
*/
@TableField("equip_unicode")
private String equipUnicode;
/**
* 检验日期
*/
@TableField("last_inspection_date")
private Date lastInspectionDate;
/**
* 下次检验日期
*/
@TableField("next_inspection_date")
private Date nextInspectionDate;
/**
* 最近检验检测结果主键
*/
@TableField("last_inspection_result_seq")
private Long lastInspectionResultSeq;
/**
* 备注(无用预留)
*/
@TableField("remark")
private String remark;
/**
* 设备状态(正常、临期、超期)
*/
@TableField("status")
private String status;
}
package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionEquipStatistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 设备检验检测统计表 Mapper 接口
*
* @author system_generator
* @date 2023-12-14
*/
public interface JyjcInspectionEquipStatisticsMapper extends BaseMapper<JyjcInspectionEquipStatistics> {
void deleteByApplicationSeq(Long seq);
}
package com.yeejoin.amos.boot.module.jyjc.api.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 设备检验检测统计表
*
* @author system_generator
* @date 2023-12-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="JyjcInspectionEquipStatisticsModel", description="设备检验检测统计表")
public class JyjcInspectionEquipStatisticsModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "设备唯一标识")
private String equipUnicode;
@ApiModelProperty(value = "检验日期")
private Date lastInspectionDate;
@ApiModelProperty(value = "下次检验日期")
private Date nextInspectionDate;
@ApiModelProperty(value = "最近检验检测结果主键")
private Long lastInspectionResultSeq;
@ApiModelProperty(value = "备注(无用预留)")
private String remark;
@ApiModelProperty(value = " 设备状态(正常、临期、超期)")
private String status;
}
package com.yeejoin.amos.boot.module.jyjc.api.service;
/**
* 设备检验检测统计表接口类
*
* @author system_generator
* @date 2023-12-14
*/
public interface IJyjcInspectionEquipStatisticsService {}
......@@ -76,7 +76,11 @@
tec.name equ_category_name,
use_org_code,
equ_code,
supervisory_code
supervisory_code,
ibjri.BRAND_NAME,
ibjri.PRODUCT_NAME,
ibjoi.SUPERVISORY_CODE,
from
idx_biz_jg_use_info ibjui
left join idx_biz_jg_register_info ibjri on ibjui.record = ibjri.record
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionEquipStatisticsMapper">
<delete id="deleteByApplicationSeq">
delete
*
from
tz_jyjc_inspection_equip_statistics
where
application_seq = #{applicationSeq}
</delete>
</mapper>
package com.yeejoin.amos.boot.module.jyjc.biz.controller;
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.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionEquipStatisticsServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionEquipStatisticsModel;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
*
*
* @author system_generator
* @date 2023-12-14
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/jyjc-inspection-equip-statistics")
public class JyjcInspectionEquipStatisticsController extends BaseController {
@Autowired
JyjcInspectionEquipStatisticsServiceImpl jyjcInspectionEquipStatisticsServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<JyjcInspectionEquipStatisticsModel> save(@RequestBody JyjcInspectionEquipStatisticsModel model) {
model = jyjcInspectionEquipStatisticsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<JyjcInspectionEquipStatisticsModel> updateBySequenceNbrJyjcInspectionEquipStatistics(@RequestBody JyjcInspectionEquipStatisticsModel model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jyjcInspectionEquipStatisticsServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jyjcInspectionEquipStatisticsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<JyjcInspectionEquipStatisticsModel> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jyjcInspectionEquipStatisticsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<JyjcInspectionEquipStatisticsModel>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JyjcInspectionEquipStatisticsModel> page = new Page<JyjcInspectionEquipStatisticsModel>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jyjcInspectionEquipStatisticsServiceImpl.queryForJyjcInspectionEquipStatisticsPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JyjcInspectionEquipStatisticsModel>> selectForList() {
return ResponseHelper.buildResponse(jyjcInspectionEquipStatisticsServiceImpl.queryForJyjcInspectionEquipStatisticsList());
}
}
......@@ -5,7 +5,6 @@ import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.enums.WorkFlowEnum;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
......@@ -71,8 +70,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
JyjcInspectionApplicationEquipServiceImpl jyjcInspectionApplicationEquipService;
@Autowired
JyjcInspectionApplicationPushLogServiceImpl jyjcInspectionApplicationPushLogService;
@Autowired
JyjcInspectionEquipStatisticsServiceImpl jyjcInspectionEquipStatisticsService;
@Autowired
WorkflowFeignService workflowFeignService;
......@@ -97,7 +95,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
model.setApplicationDate(new Date());
model = this.createWithModel(model);
//保存报检装备监管码
if (null != model.getEquip()&&model.getEquip().size() > 0) {
if (null != model.getEquip() && model.getEquip().size() > 0) {
List<Map<String, Object>> equip = model.getEquip();
List<String> jgm = equip.stream().map(e -> e.get("equipUnicode").toString()).collect(Collectors.toList());
for (String s : jgm) {
......@@ -173,14 +171,13 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
jyjcInspectionApplicationEquipService.getBaseMapper().deleteByApplicationSeq(seq);
jyjcInspectionApplicationAttachmentService.getBaseMapper().deleteByApplicationSeq(seq);
jyjcInspectionApplicationPushLogService.getBaseMapper().deleteByApplicationSeq(seq);
jyjcInspectionEquipStatisticsService.getBaseMapper().deleteByApplicationSeq(seq);
}
}
public Page<JyjcInspectionApplicationEquipModel> listByCategory(Page<JyjcInspectionApplicationEquipModel> page,String equipClassify) {
return getBaseMapper().listByCategory(page,equipClassify);
public Page<JyjcInspectionApplicationEquipModel> listByCategory(Page<JyjcInspectionApplicationEquipModel> page, String equipClassify) {
return getBaseMapper().listByCategory(page, equipClassify);
}
......@@ -208,30 +205,28 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return this.queryForList("", false);
}
public Map<String,Object> selectBySeq(Long sequenceNbr) {
public Map<String, Object> selectBySeq(Long sequenceNbr) {
JyjcInspectionApplicationModel model = this.getBaseMapper().selectDataBySeq(sequenceNbr);
JyjcInspectionApplicationModel model = this.getBaseMapper().selectDataBySeq(sequenceNbr);
Map<String, Object> map = BeanUtil.beanToMap(model);
List<Map<String, Object>> dataByApplicationSeq = jyjcInspectionApplicationAttachmentService.getBaseMapper().getDataByApplicationSeq(sequenceNbr);
Map<String, Object> attMap = new HashMap<>();
for (Map<String, Object> maps : dataByApplicationSeq) {
List<AttachmentDto> data = JSONArray.parseArray(maps.get("attachment_url").toString(), AttachmentDto.class);
attMap.put(maps.get("attachment_type").toString(),data);
attMap.put(maps.get("attachment_type").toString(), data);
}
map.putAll(attMap);
return map;
return map;
}
/**
* 接收
*
*
* @param params params
* @return {@link }
* @author yangyang
* @throws
* @author yangyang
* @date 2023/12/15 15:14
*/
public void doReceive(Map<String, Object> params) {
......@@ -269,11 +264,10 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
/**
* 退回
*
*
* @param params params
* @return {@link }
* @author yangyang
* @throws
* @author yangyang
* @date 2023/12/15 15:14
*/
public void doReject(Map<String, Object> params) {
......@@ -289,7 +283,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
public void execueFlow(Map<String, Object> params) {
String op = params.get("op").toString();
String instanceId = params.get("instanceId").toString();
String comments= params.get("comments").toString();
String comments = params.get("comments").toString();
try {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
......@@ -298,8 +292,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
TaskResultDTO dto = new TaskResultDTO();
dto.setResultCode("approvalStatus");
dto.setTaskId(taskId);
HashMap<String,Object> varibalble = new HashMap<>();
varibalble.put("approvalStatus",op);
HashMap<String, Object> varibalble = new HashMap<>();
varibalble.put("approvalStatus", op);
dto.setVariable(varibalble);
dto.setComment(comments);
// 执行流程
......
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionEquipStatistics;
import com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcInspectionEquipStatisticsMapper;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionEquipStatisticsService;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionEquipStatisticsModel;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 设备检验检测统计表服务实现类
*
* @author system_generator
* @date 2023-12-14
*/
@Service
public class JyjcInspectionEquipStatisticsServiceImpl extends BaseService<JyjcInspectionEquipStatisticsModel,JyjcInspectionEquipStatistics,JyjcInspectionEquipStatisticsMapper> implements IJyjcInspectionEquipStatisticsService {
/**
* 分页查询
*/
public Page<JyjcInspectionEquipStatisticsModel> queryForJyjcInspectionEquipStatisticsPage(Page<JyjcInspectionEquipStatisticsModel> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JyjcInspectionEquipStatisticsModel> queryForJyjcInspectionEquipStatisticsList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -18,9 +20,12 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttach
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.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -68,8 +73,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper;
// @Autowired
// InspectionDetectionInfoServiceImpl inspectionDetectionInfoService;
@Autowired
InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
@Autowired
private Sequence sequence;
/**
* 检验检测单位分页查询
*/
......@@ -117,43 +126,48 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
attachmentService.saveBatch(attachmentList);
}
if (!CollectionUtils.isEmpty(model.getResultParamModelMap())){
if (!CollectionUtils.isEmpty(model.getResultParamModelMap())) {
JyjcInspectionResultParam resultParam = new JyjcInspectionResultParam();
resultParam.setResultSeq(model.getSequenceNbr());
resultParam.setParamJson(JSON.toJSONString(model.getResultParamModelMap()));
resultParamService.save(resultParam);
}
// InspectionDetectionInfo info = new InspectionDetectionInfo();
// QueryWrapper<InspectionDetectionInfo> wrapper = new QueryWrapper<>();
// wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo,model.getResultNo());
// List<InspectionDetectionInfo> list = inspectionDetectionInfoService.list(wrapper);
// if(CollectionUtils.isEmpty(list)){
// QueryWrapper<CategoryOtherInfo> queryWrapper = new QueryWrapper<>();
// queryWrapper.lambda().eq(CategoryOtherInfo::getSupervisoryCode,model.getEquipUnicode());
// List<CategoryOtherInfo> otherInfos = categoryOtherInfoMapper.selectList(queryWrapper);
// if(!CollectionUtils.isEmpty(otherInfos)){
// info.setRecord(otherInfos.get(0).getRecord());
// }
// }else{
// info = list.get(0);
// }
// extracted(model, info);
// inspectionDetectionInfoService.save(info);
//插入操作历史记录
InspectionDetectionInfo info = new InspectionDetectionInfo();
QueryWrapper<InspectionDetectionInfo> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo, model.getResultNo());
List<InspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
QueryWrapper<CategoryOtherInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CategoryOtherInfo::getSupervisoryCode, model.getEquipUnicode());
List<CategoryOtherInfo> otherInfos = categoryOtherInfoMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(otherInfos)) {
info.setRecord(otherInfos.get(0).getRecord());
}
extracted(model, info);
info.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfoMapper.insert(info);
} else {
info = list.get(0);
extracted(model, info);
inspectionDetectionInfoMapper.updateById(info);
}
return model;
}
// private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info) {
// info.setInspectType(model.getInspectionType());
// info.setInspectOrgName(model.getInspectionUnitCode());
//// info.setInspectReport(JSON.toJSONString(model.getResultAttachmentModelList()));
// info.setInspectDate(model.getInspectionDate());
// info.setInspectConclusion(model.getInspectionConclusion());
// info.setProblemRemark(model.getNonConformance());
// info.setNextInspectDate(model.getNextInspectionDate());
// info.setSequenceCode(model.getEquipUnicode());
// info.setInspectOrgCode(model.getUseUnitCreditCode());
// info.setInspectReportNo(model.getResultNo());
// }
private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info) {
info.setInspectType(model.getInspectionType());
info.setInspectOrgName(model.getInspectionUnitCode());
// info.setInspectReport(JSON.toJSONString(model.getResultAttachmentModelList()));
info.setInspectDate(model.getInspectionDate());
info.setInspectConclusion(model.getInspectionConclusion());
info.setProblemRemark(model.getNonConformance());
info.setNextInspectDate(model.getNextInspectionDate());
info.setSequenceCode(model.getEquipUnicode());
info.setInspectOrgCode(model.getUseUnitCreditCode());
info.setInspectReportNo(model.getResultNo());
}
/**
* 列表查询 示例
*/
......
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 安全追溯-检验检测信息表
......@@ -44,4 +45,13 @@ public class InspectionDetectionInfoModel extends BaseDto {
private String sequenceCode;
private String superviseCode;
@ApiModelProperty(value = "监管码")
private String record;
@ApiModelProperty(value = "检验机构统一信用代码")
private String inspectOrgCode;
@ApiModelProperty(value = "检验报告编号")
private String inspectReportNo;
}
......@@ -2,12 +2,12 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 安全追溯-检验检测信息表
*
......@@ -94,5 +94,14 @@ public class InspectionDetectionInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"SEQUENCE_CODE\"")
private String sequenceCode;
/**
* 检验机构统一信用代码
*/
@TableField(value ="\"INSPECT_ORG_CODE\"")
private String inspectOrgCode;
/**
* 检验报告编号
*/
@TableField(value ="\"INSPECT_REPORT_NO\"")
private String inspectReportNo;
}
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