修改未符合项字段bug

This commit is contained in:
Wanghong
2021-07-29 16:13:00 +08:00
parent 0779f2c8e9
commit 72d954db68
3 changed files with 74 additions and 38 deletions
@@ -22,7 +22,7 @@ import org.springframework.format.annotation.DateTimeFormat;
/**
* <p>
*
*
* </p>
*
* @author super_liu
@@ -46,6 +46,18 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("STAND_NAME")
private String standName;
@ApiModelProperty(value = "标准编号")
@TableField("STAND_NUMBER")
private String standNumber;
@ApiModelProperty(value = "标准类别")
@TableField("STAND_SORT")
private String standSort;
@ApiModelProperty(value = "标准年份")
@TableField("STAND_YEAR")
private String standYear;
@ExcelProperty("条款号")
@ApiModelProperty(value = "条款号")
@TableField("ITEMS_NUM")
@@ -85,4 +85,13 @@ public class SarStandUnqualifiedPage {
@ApiModelProperty("每页条数")
private Integer size;
@ApiModelProperty(value = "标准编号")
private String standNumber;
@ApiModelProperty(value = "标准类别")
private String standSort;
@ApiModelProperty(value = "标准年份")
private String standYear;
}
@@ -1,13 +1,13 @@
package com.adc.da.slrs.sarStandUnqualified.service.impl;
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;
import com.adc.da.slrs.sarStandUnqualified.entity.StandUnqualifiedExcelVO;
import com.adc.da.slrs.sarStandUnqualified.entity.StandUnqualifiedListVO;
import com.adc.da.slrs.sarStandUnqualified.service.ISarStandUnqualifiedService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -15,9 +15,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@@ -33,16 +33,26 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
@Autowired
private SarStandUnqualifiedDao sarStandUnqualifiedDao;
@Resource
private SarStandardsInfoDao SarStandardsInfoDao;
/**
* 分页查询未符合项
* @param sarStandUnqualifiedPage:筛选、分页信息
* @param sarStandUnqualifiedPage :筛选、分页信息
* @returnIPage<SarStandUnqualified>
*/
@Override
public IPage<SarStandUnqualified> getSarStandUnqualifiedPage(SarStandUnqualifiedPage sarStandUnqualifiedPage) {
public IPage<SarStandUnqualifiedPage> getSarStandUnqualifiedPage(SarStandUnqualifiedPage sarStandUnqualifiedPage) {
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
wrapper.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR");
wrapper.last("INNER JOIN sar_stand_unqualified r ON r.STAND_ID = sar_standards_info.ID WHERE r.STAND_ID ='"+ sarStandUnqualifiedPage.getStandId()+"'");
Page<SarStandardsInfo> page = new Page<>(sarStandUnqualifiedPage.getCurrent(),sarStandUnqualifiedPage.getSize());
IPage<SarStandardsInfo> userIPage = SarStandardsInfoDao.selectPage(page, wrapper);
List<SarStandUnqualifiedPage> list = new ArrayList<>();
List<SarStandardsInfo> list1 = userIPage.getRecords();
QueryWrapper<SarStandUnqualified> sarStandUnqualifiedQueryWrapper=new QueryWrapper<>();
if(sarStandUnqualifiedPage.getStandId()!=null){
sarStandUnqualifiedQueryWrapper.like("stand_id",sarStandUnqualifiedPage.getStandId());
sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId());//查询详情页所需的标准ID
// sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId()).or().like("stand_name","%"+sarStandUnqualifiedPage.getStandId()+"%");
}
if (sarStandUnqualifiedPage.getStandName()!=null){
@@ -62,7 +72,38 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
&& sarStandUnqualifiedPage.getSize()!=null){
standUnqualifiedPage=new Page<>(sarStandUnqualifiedPage.getCurrent(),sarStandUnqualifiedPage.getSize());
}
return sarStandUnqualifiedDao.selectPage(standUnqualifiedPage,sarStandUnqualifiedQueryWrapper);
List<SarStandUnqualified> list2 = sarStandUnqualifiedDao.selectPage(standUnqualifiedPage,sarStandUnqualifiedQueryWrapper).getRecords();
for (SarStandardsInfo s : list1){
SarStandUnqualifiedPage p = new SarStandUnqualifiedPage();
p.setStandNumber(s.getStandNumber());
p.setStandSort(s.getStandSort());
p.setStandYear(s.getStandYear());
for (SarStandUnqualified a : list2){
if (s.getId().equals(a.getStandId())){
p.setCreateDeptId(a.getCreateDeptId());
p.setCreateById(a.getCreateById());
p.setCreateTime((Timestamp)a.getCreateTime());
p.setCloseState(a.getCloseState());
p.setActualCloseTime((Timestamp)a.getActualCloseTime());
p.setPlanCloseTime((Timestamp)a.getPlanCloseTime());
p.setQaEngineer(a.getQaEngineer());
p.setDutyEngineer(a.getDutyEngineer());
p.setResponsibleUnit(a.getResponsibleUnit());
p.setProductName(a.getProductName());
p.setProductLine(a.getProductLine());
p.setProductType(a.getProductType());
p.setItemsName(a.getItemsName());
p.setItemsNum(a.getItemsNum());
p.setStandName(a.getStandName());
p.setStandId(a.getStandId());
p.setId(a.getId());
}
}
list.add(p);
}
IPage<SarStandUnqualifiedPage> userIPage1 = new Page<>();
userIPage1.setRecords(list);
return userIPage1;
}
/**
@@ -128,35 +169,9 @@ 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<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;
List<SarStandUnqualified> stand = sarStandUnqualifiedDao.selectList(sarStandUnqualifiedQueryWrapper);
List<SarStandUnqualified> a = stand;
return a;
}
private boolean closeSarStandUnqualified(String standUnqualifiedId){