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.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -60,7 +61,7 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
@ApiOperation(value = "查询标准信息")
@GetMapping("/selectLawsById")
public ResponseMessage selectLawsById(SarFindDto sarFindDto){
List<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(sarFindDto);
IPage<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(sarFindDto);
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);
//根据标准id查出数据
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);
//根据标准id查出数据
@@ -112,4 +112,7 @@ public class LawsDto {
@ApiModelProperty(value = "1")
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.sarLawsDetailedList.entity.TimeDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletResponse;
@@ -18,7 +19,7 @@ import java.util.Map;
*/
public interface ISarLawsAttrDetailedListService extends IService<SarLawsAttrDetailedList> {
List<LawsDto> selectLaws(SarFindDto sarFindDto);
IPage<LawsDto> selectLaws(SarFindDto sarFindDto);
Boolean insertDetailedList(String id,List<TimeDto> timeDto);
Boolean updateDetailedLaws(String id,List<TimeDto> timeDtos);
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.entity.*;
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.sys.service.IDicTypeEOService;
import com.adc.da.util.UUIDUtils;
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 org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,13 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
//从主表中查询信息
@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());
if (CollectionUtils.isEmpty(lawsIds)){
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
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 {
SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder()
.id(UUIDUtils.randomUUID20())
@@ -248,34 +244,35 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
else list.setFileIds(detailedUpDto.getFileIds());
sarLawsDetailedListDao.updateById(list);
if (null != detailedUpDto.getInforlist()) {
detailedUpDto.setInforlist(detailedUpDto.getInforlist().substring(1, detailedUpDto.getInforlist().length() - 1));
String src = "\"\"";
if (src.equals(detailedUpDto.getInforlist()) || null != detailedUpDto.getInforlist()) {
List<TimeDto> timeDto = new ArrayList<>();
if ("1".equals(detailedUpDto.getSortKey()) && detailedUpDto.getInforlist().contains(",")) {
if ( detailedUpDto.getInforlist().contains(",")) {
String[] id = detailedUpDto.getInforlist().split(",");
String[] putTime = detailedUpDto.getInforlist1().split(",");
String[] zcc = detailedUpDto.getInforlist2().split(",");
String[] xcx = detailedUpDto.getInforlist3().split(",");
for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto();
dto.setStandId(id[a]);
if (putTime[a]==null) {
dto.setPutTime(null);
} else {
dto.setPutTime(putTime[a]);
for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto();
dto.setStandId(id[a]);
if (putTime.length<=a) {
dto.setPutTime(null);
} else {
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 {
TimeDto dto = new TimeDto();
dto.setStandId(detailedUpDto.getInforlist());
@@ -25,7 +25,7 @@ public class GetExcelDto {
@ExcelProperty("章节编号")
private String partCode;
@ExcelProperty("内容")
@ExcelProperty("修改意见内容(包括理由或依据)")
private String content;
@ExcelProperty("提出人")
private String userName;