政策重点认证事业部 风险项入库
This commit is contained in:
@@ -34,7 +34,9 @@ public class PolicyWorkFlowService {
|
||||
.stream()
|
||||
.map(jsonObj -> {
|
||||
BusinessDeptIssue businessDeptIssue = JSONObject.parseObject(jsonObj.toString(), BusinessDeptIssue.class);
|
||||
businessDeptIssue.setLawId(businessDeptIssue.getId());
|
||||
businessDeptIssue.setId(UUIDUtils.randomUUID20());
|
||||
businessDeptIssue.setIsClose("0");
|
||||
return businessDeptIssue;
|
||||
}).collect(Collectors.toList())
|
||||
.stream()
|
||||
|
||||
+13
-2
@@ -28,7 +28,12 @@ public class IssueTrackController {
|
||||
@ApiOperation("新增重点标准跟踪清单项目")
|
||||
public ResponseMessage addIssueTrack(@RequestBody IssueTrack issueTrack){
|
||||
boolean b = issueTrackService.addIssueTrack(issueTrack);
|
||||
return Result.success(b);
|
||||
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +57,12 @@ public class IssueTrackController {
|
||||
@ApiOperation("更新重点标准跟踪清单项目")
|
||||
public ResponseMessage updateIssueTrack(@RequestBody IssueTrack issueTrack){
|
||||
boolean b = issueTrackService.updateIssueTrack(issueTrack);
|
||||
return Result.success(b);
|
||||
// return Result.success("200","数据不能相同",false);
|
||||
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
package com.adc.da.slrs.sarIssueTrack.dao;
|
||||
|
||||
import com.adc.da.slrs.sarIssueTrack.entity.IssueTrack;
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.ProductDeptIssue;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface IssueTrackDao extends BaseMapper<IssueTrack> {
|
||||
|
||||
|
||||
public IPage<IssueTrack> findPage(IPage<IssueTrack> page, @Param(value = "pageVo") IssueTrack pageVo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
@@ -20,7 +21,17 @@ public class IssueTrack {
|
||||
@TableField("law_id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("law_name")
|
||||
@ApiModelProperty("国内标准库 INLAND" +
|
||||
"海外标准库 FOREIGN" +
|
||||
"国内外政策库 FOREIGN_LAWS" +
|
||||
"企业标准库 BUSINESS_STAND")
|
||||
@TableField("data_source")
|
||||
private String dataSource;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String lawCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String lawName;
|
||||
|
||||
@TableField("product_type")
|
||||
|
||||
+26
-25
@@ -25,9 +25,20 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
@Override
|
||||
public boolean addIssueTrack(IssueTrack obj) {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.save(obj);
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0");
|
||||
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.save(obj);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,26 +51,7 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
IPage<IssueTrack> trackPage = new Page<>(objVo.getPage(), objVo.getPageSize());
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
|
||||
if (objVo.getPage()!=null && objVo.getPageSize()!=null){
|
||||
trackPage=new Page<>(objVo.getPage(),objVo.getPageSize());
|
||||
}else {
|
||||
Integer count = issueTrackDao.selectCount(wrapper);
|
||||
trackPage=new Page<>(0,count,false);
|
||||
}
|
||||
|
||||
if (objVo.getLawId()!=null){
|
||||
wrapper.like("law_id",objVo.getLawId());
|
||||
}
|
||||
if (objVo.getLawName()!=null){
|
||||
wrapper.like("law_name",objVo.getLawName());
|
||||
}
|
||||
if (objVo.getProductType()!=null){
|
||||
wrapper.like("product_type",objVo.getProductType());
|
||||
}
|
||||
|
||||
trackPage = issueTrackDao.selectPage(trackPage, wrapper);
|
||||
trackPage = issueTrackDao.findPage(trackPage,objVo);
|
||||
|
||||
|
||||
return trackPage;
|
||||
@@ -67,7 +59,16 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
@Override
|
||||
public boolean updateIssueTrack(IssueTrack obj) {
|
||||
|
||||
return this.updateById(obj);
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.updateById(obj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?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.adc.da.slrs.sarIssueTrack.dao.IssueTrackDao">
|
||||
|
||||
<resultMap id="IssueTrackPage" type="com.adc.da.slrs.sarIssueTrack.entity.IssueTrack">
|
||||
<result property="id" column="ID"/>
|
||||
<result property="lawId" column="law_id"/>
|
||||
<result property="dataSource" column="data_source"/>
|
||||
<result property="lawCode" column="law_code"/>
|
||||
<result property="lawName" column="law_name"/>
|
||||
<result property="productType" column="product_type"/>
|
||||
<result property="implTime" column="impl_time"/>
|
||||
<result property="implRequire" column="impl_require"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="issueColumn">
|
||||
issue.id,data_source,law_id,product_type,impl_time,impl_require
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="IssueTrackPage" parameterType="com.adc.da.slrs.sarIssueTrack.entity.IssueTrackVo">
|
||||
(
|
||||
SELECT
|
||||
CONCAT(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
) AS law_code,
|
||||
sarInfo.STAND_NAME AS law_name,
|
||||
<include refid="issueColumn"/>
|
||||
FROM
|
||||
issue_track AS issue
|
||||
JOIN sar_standards_info AS sarInfo ON sarInfo.ID = issue.law_id
|
||||
|
||||
<where>
|
||||
del_flag=0
|
||||
|
||||
<if test="pageVo.lawCode != null and pageVo.lawCode != ''">
|
||||
trim(replace(CONCAT(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
),' ','')) LIKE trim(replace(CONCAT('%',#{pageVo.lawCode},'%'),' ',''))
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<if test="pageVo.lawName != null and pageVo.lawName != ''">
|
||||
sarInfo.STAND_NAME LIKE CONCAT('%',#{pageVo.lawName},'%')
|
||||
</if>
|
||||
|
||||
|
||||
<if test="pageVo.productType != null and pageVo.productType != ''">
|
||||
issue.product_type LIKE CONCAT('%',#{pageVo.productType},'%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
) UNION ALL (
|
||||
SELECT
|
||||
sarInfo.LAWS_NUMBER AS law_code,
|
||||
sarInfo.LAWS_NAME AS law_name,
|
||||
<include refid="issueColumn"/>
|
||||
FROM
|
||||
issue_track AS issue
|
||||
JOIN sar_laws_stand_info AS sarInfo ON sarInfo.ID = issue.law_id
|
||||
<where>
|
||||
del_flag=0
|
||||
|
||||
<if test="pageVo.lawCode != null and pageVo.lawCode != ''">
|
||||
sarInfo.LAWS_NUMBER LIKE CONCAT('%',#{pageVo.lawCode},'%')
|
||||
</if>
|
||||
|
||||
<if test="pageVo.lawName != null and pageVo.lawName != ''">
|
||||
sarInfo.LAWS_NAME LIKE CONCAT('%',#{pageVo.lawName},'%')
|
||||
</if>
|
||||
|
||||
<if test="pageVo.productType != null and pageVo.productType != ''">
|
||||
issue.product_type LIKE CONCAT('%',#{pageVo.productType},'%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
|
||||
) UNION ALL (
|
||||
SELECT
|
||||
sarInfo.STAND_CODE AS law_code,
|
||||
sarInfo.STAND_NAME AS law_name,
|
||||
<include refid="issueColumn"/>
|
||||
FROM
|
||||
issue_track AS issue
|
||||
JOIN sar_bussioness_stand AS sarInfo ON sarInfo.ID = issue.law_id
|
||||
|
||||
|
||||
<where>
|
||||
del_flag=0
|
||||
|
||||
<if test="pageVo.lawCode != null and pageVo.lawCode != ''">
|
||||
sarInfo.STAND_CODE LIKE CONCAT('%',#{pageVo.lawCode},'%')
|
||||
</if>
|
||||
|
||||
<if test="pageVo.lawName != null and pageVo.lawName != ''">
|
||||
sarInfo.STAND_NAME LIKE CONCAT('%',#{pageVo.lawName},'%')
|
||||
</if>
|
||||
|
||||
<if test="pageVo.productType != null and pageVo.productType != ''">
|
||||
issue.product_type LIKE CONCAT('%',#{pageVo.productType},'%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
|
||||
)
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user