Merge remote-tracking branch 'origin/develop_1' into develop_master

This commit is contained in:
yuezhihang
2021-07-29 15:22:23 +08:00
12 changed files with 155 additions and 50 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;
@@ -37,7 +38,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;
@@ -169,7 +176,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;
}
//向清单表和主表中的关联表插入信息
@@ -0,0 +1,21 @@
package com.adc.da.slrs.sarLawsDetailedList.entity;
import com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* //TODO 添加类、接口描述
*
* @author ZhangZhiYuan
* @date 2021-07-29
*/
@Data
public class ExcelDto extends SarStandUnqualified {
@ExcelProperty("创建时间")
private String createTime1;
@ExcelProperty("计划关闭时间")
private String planCloseTime1;
}
@@ -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;
@@ -81,7 +81,7 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("CREATE_BY_ID")
private String createById;
@ExcelProperty(value = "创建时间",converter = TimestampConverter.class)
@ExcelIgnore
@ApiModelProperty(value = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -100,7 +100,7 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("ACTUAL_CLOSE_TIME")
private Date actualCloseTime;
@ExcelProperty(value = "计划关闭时间",converter = TimestampConverter.class)
@ExcelIgnore
@ApiModelProperty(value = "计划关闭时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -126,8 +126,6 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("DUTY_ENGINEER")
private String dutyEngineer;
@ExcelProperty(value = "产品类型",converter = ProductTypeConverter.class)
@ApiModelProperty(value = "产品类型(research为在研产品,product为在产产品)")
@TableField("PRODUCT_TYPE")
@@ -138,7 +136,6 @@ public class SarStandUnqualified extends BaseEntity {
@TableId(type = IdType.UUID)
private String id;
@ApiModelProperty(value = "质量工程师")
@TableField(exist=false)
private String qaEngineerName;
@@ -1,6 +1,7 @@
package com.adc.da.slrs.sarStandUnqualified.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.slrs.sarLawsDetailedList.Util.BeanConverUtil;
import com.adc.da.slrs.sarLawsDetailedList.entity.ExcelDto;
import com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified;
import com.adc.da.slrs.sarStandUnqualified.dao.SarStandUnqualifiedDao;
import com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualifiedPage;
@@ -11,13 +12,12 @@ 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;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@@ -128,9 +128,35 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
if(standUnqualifiedExcelVO.getIds()!=null && standUnqualifiedExcelVO.getIds().size()>0){
sarStandUnqualifiedQueryWrapper.in("id",standUnqualifiedExcelVO.getIds());
}
List<SarStandUnqualified> stand = sarStandUnqualifiedDao.selectList(sarStandUnqualifiedQueryWrapper);
List<SarStandUnqualified> a = stand;
return a;
List<SarStandUnqualified> stand = sarStandUnqualifiedDao.selectList(sarStandUnqualifiedQueryWrapper);
List<ExcelDto> list = new ArrayList<>();
list = BeanConverUtil.converList(stand,ExcelDto.class);
for (int a=0;a<stand.size();a++){
Date date = null;
String str;
try {
if (stand.get(a).getCreateTime() != null) {
String dateStr = stand.get(a).getCreateTime().toString();
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
date = sdf.parse(dateStr);
SimpleDateFormat sdf1=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
String sDate=sdf1.format(date);
list.get(a).setCreateTime1(sDate);
}
if (stand.get(a).getActualCloseTime() != null) {
String dateStr = stand.get(a).getActualCloseTime().toString();
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
date = sdf.parse(dateStr);
SimpleDateFormat sdf1=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
String sDate=sdf1.format(date);
date=sdf1.parse(sDate);
list.get(a).setActualCloseTime(date);
}
} catch(ParseException e){
e.printStackTrace();
}
}
return stand;
}
private boolean closeSarStandUnqualified(String standUnqualifiedId){