update:修改清单信息

This commit is contained in:
zzy
2021-07-29 11:14:47 +08:00
parent cacc66d5e7
commit 80226d5cfb
9 changed files with 99 additions and 38 deletions
@@ -11,6 +11,7 @@ import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListS
import com.adc.da.sys.service.IDicTypeEOService; import com.adc.da.sys.service.IDicTypeEOService;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -60,7 +61,7 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
@ApiOperation(value = "查询标准信息") @ApiOperation(value = "查询标准信息")
@GetMapping("/selectLawsById") @GetMapping("/selectLawsById")
public ResponseMessage selectLawsById(SarFindDto sarFindDto){ public ResponseMessage selectLawsById(SarFindDto sarFindDto){
List<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(sarFindDto); IPage<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(sarFindDto);
return Result.success("200",laws); return Result.success("200",laws);
} }
@@ -25,6 +25,8 @@ public interface SarLawsAttrDetailedListDao extends BaseMapper<SarLawsAttrDetail
List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size); List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size);
//根据标准id查出数据 //根据标准id查出数据
List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto); List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto);
//根据标准id查出数据用于清单查询
List<LawsDto> selectLawsByIdList(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto);
//用于导出 //用于导出
List<LawsDto> selectLawsByIdE(@Param("param1") List<String> LawsIds); List<LawsDto> selectLawsByIdE(@Param("param1") List<String> LawsIds);
//根据标准id查出数据 //根据标准id查出数据
@@ -112,4 +112,7 @@ public class LawsDto {
@ApiModelProperty(value = "1") @ApiModelProperty(value = "1")
private String standType; private String standType;
@ApiModelProperty(value = "文本状态")
private String textStatus;
} }
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarLawsAttrDetailedList.service;
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*; import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto; import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -18,7 +19,7 @@ import java.util.Map;
*/ */
public interface ISarLawsAttrDetailedListService extends IService<SarLawsAttrDetailedList> { public interface ISarLawsAttrDetailedListService extends IService<SarLawsAttrDetailedList> {
List<LawsDto> selectLaws(SarFindDto sarFindDto); IPage<LawsDto> selectLaws(SarFindDto sarFindDto);
Boolean insertDetailedList(String id,List<TimeDto> timeDto); Boolean insertDetailedList(String id,List<TimeDto> timeDto);
Boolean updateDetailedLaws(String id,List<TimeDto> timeDtos); Boolean updateDetailedLaws(String id,List<TimeDto> timeDtos);
void exportExcel(HttpServletResponse response, StandExcelVo standExcelVo); void exportExcel(HttpServletResponse response, StandExcelVo standExcelVo);
@@ -3,11 +3,12 @@ package com.adc.da.slrs.sarLawsAttrDetailedList.service.impl;
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao; import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*; import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService; import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService;
import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto; import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
import com.adc.da.sys.service.IDicTypeEOService; import com.adc.da.sys.service.IDicTypeEOService;
import com.adc.da.util.UUIDUtils; import com.adc.da.util.UUIDUtils;
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.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,13 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
//从主表中查询信息 //从主表中查询信息
@Override @Override
public List<LawsDto> selectLaws(SarFindDto sarFindDto) { public IPage<LawsDto> selectLaws(SarFindDto sarFindDto) {
//获取封装信息
IPage<SarLawsAttrDetailedList> pageRes = new Page<>(sarFindDto.getPage(), sarFindDto.getSize());
QueryWrapper<SarLawsAttrDetailedList> wrapper = new QueryWrapper<>();
wrapper.eq("detailed_list_id", sarFindDto.getId());
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper);
//查询标准id
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize()); List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize());
if (CollectionUtils.isEmpty(lawsIds)){ if (CollectionUtils.isEmpty(lawsIds)){
return null; return null;
@@ -168,7 +175,14 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
} }
} }
} }
return list;
IPage<LawsDto> list1 = new Page<>();
list1.setRecords(list);
list1.setCurrent(selectPage.getCurrent());
list1.setTotal(selectPage.getTotal());
list1.setSize(selectPage.getSize());
list1.setPages(selectPage.getPages());
return list1;
} }
//向清单表和主表中的关联表插入信息 //向清单表和主表中的关联表插入信息
@@ -60,10 +60,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
@Override @Override
public String add(AddDetailedDto addDetailedDto) { public String add(AddDetailedDto addDetailedDto) {
addDetailedDto.setInforlist(addDetailedDto.getInforlist().substring(1, addDetailedDto.getInforlist().length() -1));
addDetailedDto.setInforlist1(addDetailedDto.getInforlist1().substring(1, addDetailedDto.getInforlist1().length() -1));
addDetailedDto.setInforlist2(addDetailedDto.getInforlist2().substring(1, addDetailedDto.getInforlist2().length() -1));
addDetailedDto.setInforlist3(addDetailedDto.getInforlist3().substring(1, addDetailedDto.getInforlist3().length() -1));
try { try {
SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder() SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder()
.id(UUIDUtils.randomUUID20()) .id(UUIDUtils.randomUUID20())
@@ -248,34 +244,35 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
else list.setFileIds(detailedUpDto.getFileIds()); else list.setFileIds(detailedUpDto.getFileIds());
sarLawsDetailedListDao.updateById(list); sarLawsDetailedListDao.updateById(list);
if (null != detailedUpDto.getInforlist()) { String src = "\"\"";
detailedUpDto.setInforlist(detailedUpDto.getInforlist().substring(1, detailedUpDto.getInforlist().length() - 1)); if (src.equals(detailedUpDto.getInforlist()) || null != detailedUpDto.getInforlist()) {
List<TimeDto> timeDto = new ArrayList<>(); List<TimeDto> timeDto = new ArrayList<>();
if ("1".equals(detailedUpDto.getSortKey()) && detailedUpDto.getInforlist().contains(",")) { if ( detailedUpDto.getInforlist().contains(",")) {
String[] id = detailedUpDto.getInforlist().split(","); String[] id = detailedUpDto.getInforlist().split(",");
String[] putTime = detailedUpDto.getInforlist1().split(","); String[] putTime = detailedUpDto.getInforlist1().split(",");
String[] zcc = detailedUpDto.getInforlist2().split(","); String[] zcc = detailedUpDto.getInforlist2().split(",");
String[] xcx = detailedUpDto.getInforlist3().split(","); String[] xcx = detailedUpDto.getInforlist3().split(",");
for (int a = 0; a < id.length; a++) { for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(id[a]); dto.setStandId(id[a]);
if (putTime[a]==null) { if (putTime.length<=a) {
dto.setPutTime(null); dto.setPutTime(null);
} else { } else {
dto.setPutTime(putTime[a]); dto.setPutTime(putTime[a]);
}
if (putTime.length<=a) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (putTime.length<=a) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
} }
if (putTime[a]==null) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (putTime[a]==null) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
}
} else { } else {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(detailedUpDto.getInforlist()); dto.setStandId(detailedUpDto.getInforlist());
@@ -25,7 +25,7 @@ public class GetExcelDto {
@ExcelProperty("章节编号") @ExcelProperty("章节编号")
private String partCode; private String partCode;
@ExcelProperty("内容") @ExcelProperty("修改意见内容(包括理由或依据)")
private String content; private String content;
@ExcelProperty("提出人") @ExcelProperty("提出人")
private String userName; private String userName;
@@ -646,7 +646,6 @@
select ID,STAND_ID,ITEMS_NUM,ITEMS_NAME,RESPONSIBLE_UNIT,SVPPS,APPLY_ARCTIC,CLAIM_TYPE,BUS_STAND_COVER,DUTY_ENGINEER as responsibleEngineer select ID,STAND_ID,ITEMS_NUM,ITEMS_NAME,RESPONSIBLE_UNIT,SVPPS,APPLY_ARCTIC,CLAIM_TYPE,BUS_STAND_COVER,DUTY_ENGINEER as responsibleEngineer
from SAR_STAND_ITEMS from SAR_STAND_ITEMS
where FILE_TYPE=#{type} where FILE_TYPE=#{type}
<if test="ids != null"> <if test="ids != null">
and STAND_ID in and STAND_ID in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
@@ -5,7 +5,7 @@
<select id="selectLawsById" parameterType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarFindDto" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto"> <select id="selectLawsById" parameterType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarFindDto" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ, SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,dicstandSort.DIC_TYPE_NAME as standSortShow, b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,dicstandSort.DIC_TYPE_NAME as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = a.stand_sort and a.ID = b.STAND_ID left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = a.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null) dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
@@ -43,13 +43,12 @@
#{item} #{item}
</foreach> </foreach>
</where> </where>
</select> </select>
<select id="selectLawsByIdE" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto"> <select id="selectLawsByIdE" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ, SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,dicstandSort.DIC_TYPE_NAME as standSortShow, b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,dicstandSort.DIC_TYPE_NAME as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = a.stand_sort and a.ID = b.STAND_ID left join TS_DICTYPE dicstandSort on (dicstandSort.dic_type_code = a.stand_sort and
dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null) dicstandSort.dic_id is not null and dicstandSort.valid_flag = 0 and dicstandSort.PARENT_ID is null)
@@ -84,8 +83,9 @@
order by number order by number
</select> </select>
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto"> <select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ, SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID a.ID = b.STAND_ID
<where> <where>
@@ -118,6 +118,50 @@
AND (a.putTime is not NULL AND (a.putTime is not NULL
AND a.xcxssrq is not NULL AND a.xcxssrq is not NULL
AND a.zccssrq is not NULL) AND a.zccssrq is not NULL)
</select>
<select id="selectLawsByIdList" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.TEXT_STATUS as textStatus,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
<where>
<if test="sarFindDto.standName != null">
(a.STAND_NUMBER LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%')
or a.STAND_YEAR LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%')
or dicstandSort.DIC_TYPE_NAME LIKE concat ('%',#{sarFindDto.standName,jdbcType=VARCHAR},'%')
)
and
</if>
<if test="sarFindDto.standEnName != null">
a.STAND_EN_NAME LIKE concat ('%',#{sarFindDto.standEnName,jdbcType=VARCHAR},'%')
and
</if>
<if test="sarFindDto.typeApplicable != null">
b.CLLX LIKE concat ('%',#{sarFindDto.typeApplicable,jdbcType=VARCHAR},'%')
and
</if>
<if test="sarFindDto.NYLX != null">
b.NYLX LIKE concat ('%',#{sarFindDto.NYLX,jdbcType=VARCHAR},'%')
and
</if>
<if test="sarFindDto.ZRBM != null">
b.ZRBM LIKE concat ('%',#{sarFindDto.ZRBM,jdbcType=VARCHAR},'%')
and
</if>
<if test="sarFindDto.SYCPX != null">
b.SYCPX LIKE concat ('%',#{sarFindDto.SYCPX,jdbcType=VARCHAR},'%')
and
</if>
a.ID IN
<foreach collection="param1" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
</select> </select>
<insert id="insertList"> <insert id="insertList">