Merge remote-tracking branch 'origin/develop_master' into develop_1
This commit is contained in:
@@ -3,28 +3,35 @@ package com.adc.da.scheduled;
|
||||
import com.adc.da.scheduled.dao.SarStandardInfoDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardItemDao;
|
||||
import com.adc.da.scheduled.dao.SarStandardWarningDao;
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@@ -55,13 +62,15 @@ public class ScheduledJob {
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoDao; //属性字段表
|
||||
|
||||
@Autowired
|
||||
private IWarningDateService iWarningDateService;// 预警日期
|
||||
|
||||
|
||||
// @PostConstruct //程序启动时执行一次
|
||||
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
|
||||
// @Scheduled(cron="*/5 * * * * ?")
|
||||
@Async
|
||||
public void WarningSchedulingTasks() {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(ScheduledJob.class);
|
||||
|
||||
/**
|
||||
* 1.查询标准属性字段表(sar_stand_attr_info) XCXSSEQ ZCCSSRQ ZRGCS
|
||||
@@ -78,98 +87,44 @@ public class ScheduledJob {
|
||||
4:在产车标准预警
|
||||
1:新车条款预警
|
||||
2:在产车条款预警
|
||||
|
||||
2021/12/1 日需求修改
|
||||
分为标准预警与条款预警
|
||||
mark:标识预警的种类 stand 标准 item 条款
|
||||
*/
|
||||
|
||||
//删除不在预警范围的标准
|
||||
QueryWrapper<EarlyWarningEO> earlyWarningEOQW = new QueryWrapper<>();
|
||||
earlyWarningEOQW.lt("PUT_TIME",LocalDate.now());
|
||||
int remove = sarStandardWarningDao.delete(earlyWarningEOQW);
|
||||
System.out.println(remove);
|
||||
int remove = sarStandardWarningDao.autoCancelWarning();
|
||||
|
||||
logger.info("==========================================================================");
|
||||
logger.info("取消"+remove+"条预警");
|
||||
logger.info("开始执行预警!!!");
|
||||
logger.info("==========================================================================");
|
||||
|
||||
System.out.println("开始执行预警!!!");
|
||||
TermDTO term = new TermDTO(); //预警期限(当前日期至3个月后)
|
||||
|
||||
DataDTO term = new DataDTO(); //预警期限(当前日期至3个月后)
|
||||
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term); //查询符合预警期限的标准 多个
|
||||
|
||||
LinkedList<WarningEO> warningList = new LinkedList<>();//需预警的标准和条款列表集合
|
||||
//分解单(条款) 新车型 mark=1
|
||||
List<WarningEO> itemForXCXSSRQ = sarStandardItemDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : itemForXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
.setMark("1")
|
||||
.setPutTime(warningEO.getXCXSSRQ())
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
}
|
||||
warningList.addAll(itemForXCXSSRQ);
|
||||
|
||||
//分解单(条款) 在产车型 mark=2
|
||||
List<WarningEO> itemForZCCSSRQ = sarStandardItemDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : itemForZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
.setPower("1")
|
||||
.setMark("2")
|
||||
.setPutTime(warningEO.getZCCSSRQ())
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
}
|
||||
warningList.addAll(itemForZCCSSRQ);
|
||||
|
||||
//标准 新车型 预警 mark=3
|
||||
List<WarningEO> standInfoXCXSSRQ = sarStandardInfoDao.selectWithinTerm(term, "XCXSSRQ");
|
||||
for (WarningEO warningEO : standInfoXCXSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
/**
|
||||
* //如果插入的值均为NULL,则根据索引的原理,
|
||||
* 全NULL值不被记录在索引上,所以插入全NULL值时,可以有重复的
|
||||
* 则此处设为 '-1'
|
||||
*/
|
||||
.setItemsId("-1")
|
||||
.setPower("1")
|
||||
.setMark("3")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
|
||||
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getXCXSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getXCXSSRQ());
|
||||
|
||||
}
|
||||
warningList.addAll(standInfoXCXSSRQ);
|
||||
|
||||
|
||||
//标准 在产车型 mark=4
|
||||
List<WarningEO> standInfoZCCSSRQ = sarStandardInfoDao.selectWithinTerm(term, "ZCCSSRQ");
|
||||
for (WarningEO warningEO : standInfoZCCSSRQ) {
|
||||
warningEO.setId(UUIDUtils.randomUUID20())
|
||||
/**
|
||||
* 同上
|
||||
*/
|
||||
.setItemsId("-1")
|
||||
.setPower("1")
|
||||
.setMark("4")
|
||||
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
|
||||
//实施日期达到预警时间,但在产车实施日期不在时间内
|
||||
/**
|
||||
* 2021/9/9取消限制
|
||||
*/
|
||||
// if (term.isTerm(warningEO.getZCCSSRQ())){
|
||||
// warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
// }
|
||||
warningEO.setPutTime(warningEO.getZCCSSRQ());
|
||||
}
|
||||
warningList.addAll(standInfoZCCSSRQ);
|
||||
warningDateList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
iWarningDateService.remove(null); //清空标准的日期子表
|
||||
iWarningDateService.saveBatch(warningDateList); // 保存进入标准的日期子表 保存标准的实施日期 新车型实施日期 在产车实施日期 多个
|
||||
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term); //联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
|
||||
|
||||
warningList.forEach(item->{
|
||||
item.setId(UUIDUtils.randomUUID20());
|
||||
});
|
||||
//持久化至预警表 忽略标准id和标志位都一样的数据
|
||||
if (warningList.size()!=0){
|
||||
//此表的STAND_ID和MARK字段以及ITEMS_ID字段需个建立唯一性约束
|
||||
int count = sarStandardWarningDao.ignoreInsert(warningList);
|
||||
System.out.println("已预警 " + count + " 条标准或条款!!");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("已预警"+ count+"条标准或条款!!");
|
||||
logger.info("==================================预警结束======================================");
|
||||
logger.info("==================================预警结束======================================");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +145,7 @@ public class ScheduledJob {
|
||||
public void TextStatusSchedulingTasks() {
|
||||
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
|
||||
|
||||
DataDTO data = new DataDTO(LocalDate.now(), LocalDate.now());
|
||||
TermDTO data = new TermDTO(LocalDate.now(), LocalDate.now());
|
||||
|
||||
/**
|
||||
*实施日期是当前系统时间的标准文本状态变为'现行有效'
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
@@ -12,7 +11,7 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardInfoDao{
|
||||
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
public List<String> selectWithinTerm(TermDTO date, String str);
|
||||
|
||||
public int updateStandardInfo(@Param("id")String id, @Param("textStatus") String textStatus);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
@@ -11,6 +11,6 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface SarStandardItemDao extends BaseMapper{
|
||||
|
||||
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
|
||||
public List<WarningEO> selectWithinTerm(TermDTO date, String str);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
package com.adc.da.scheduled.dao;
|
||||
|
||||
import com.adc.da.scheduled.entity.WarningEO;
|
||||
import com.adc.da.scheduled.entity.TermDTO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
public int ignoreInsert(@Param(value = "warningEOS") LinkedList<WarningEO> warningEOS);
|
||||
public int ignoreInsert(@Param(value = "warningEOS") List<EarlyWarningEO> warningEOS);
|
||||
|
||||
|
||||
public int autoCancelWarning();
|
||||
|
||||
public List<EarlyWarningEO> getWarningId(TermDTO term);
|
||||
|
||||
public List<WarningDate> getWarningDate(TermDTO term);
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class DataDTO {
|
||||
public class TermDTO {
|
||||
/**
|
||||
* 预警的期限为系统日期的次日至3个月后
|
||||
*/
|
||||
@@ -28,14 +28,14 @@ public class DataDTO {
|
||||
|
||||
// private String str;
|
||||
|
||||
public DataDTO() {
|
||||
public TermDTO() {
|
||||
LocalDate starDate = LocalDate.now();//系统当前日期
|
||||
LocalDate endDate = LocalDate.now().plusMonths(3);//系统当前日期3个月后
|
||||
|
||||
convertToStr(starDate,endDate);
|
||||
}
|
||||
|
||||
public DataDTO(LocalDate startDate,LocalDate endDate){
|
||||
public TermDTO(LocalDate startDate, LocalDate endDate){
|
||||
convertToStr(startDate,endDate);
|
||||
}
|
||||
|
||||
@@ -31,5 +31,6 @@ public class WarningEO extends EarlyWarningEO {
|
||||
|
||||
private String standYear;
|
||||
|
||||
private String issueTime;
|
||||
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.ActivityDatas.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.ActivityDatas.entity.receiveData;
|
||||
import com.adc.da.slrs.ActivityDatas.service.ActivityDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@Api(description = "|EsRevisePlan|")
|
||||
@RequestMapping("api/activityData")
|
||||
public class ActivityDataController {
|
||||
|
||||
@Autowired
|
||||
ActivityDataService activityDataService;
|
||||
|
||||
@ApiOperation(value = "返回拼接的数据")
|
||||
@PostMapping("/backData")
|
||||
public ResponseMessage<Object> queryAllPlans(receiveData receiveData){
|
||||
return Result.success(activityDataService.dealWithDatas(receiveData.getJson()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.adc.da.slrs.ActivityDatas.controller.tools;
|
||||
|
||||
import net.sf.json.JsonConfig;
|
||||
import net.sf.json.processors.JsonValueProcessor;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class JsonDateValueProcessor implements JsonValueProcessor {
|
||||
|
||||
private String datePattern = "yyyy-MM-dd HH:mm:ss";//默认样式,可以在构造方法中修改
|
||||
public JsonDateValueProcessor() {
|
||||
super();
|
||||
}
|
||||
public JsonDateValueProcessor(String datePattern) {
|
||||
super();
|
||||
this.datePattern = datePattern;
|
||||
}
|
||||
public Object processArrayValue(Object value, JsonConfig jsonConfig) {
|
||||
try {
|
||||
if(value instanceof Date){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
|
||||
Date date = (Date)value;
|
||||
return sdf.format(date);
|
||||
}
|
||||
return value == null ? null : value.toString();
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public Object processObjectValue(String key, Object value, JsonConfig jsonConfig) {
|
||||
return processArrayValue(value, jsonConfig);
|
||||
}
|
||||
public String getDatePattern() {
|
||||
return datePattern;
|
||||
}
|
||||
public void setDatePattern(String datePattern) {
|
||||
this.datePattern = datePattern;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class BreakdownList {
|
||||
|
||||
private String id;
|
||||
private String svpps;
|
||||
private String standId;
|
||||
private String itemsNum;
|
||||
private String claimType;
|
||||
private String itemsName;
|
||||
private String applyArctic;
|
||||
private String busStandCover;
|
||||
private String responsibleUnit;
|
||||
private String responsibleEngineer;
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
private String xcxssrq;
|
||||
private String zccssrq;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSvpps(String svpps) {
|
||||
this.svpps = svpps;
|
||||
}
|
||||
public String getSvpps() {
|
||||
return svpps;
|
||||
}
|
||||
|
||||
public void setStandId(String standId) {
|
||||
this.standId = standId;
|
||||
}
|
||||
public String getStandId() {
|
||||
return standId;
|
||||
}
|
||||
|
||||
public void setItemsNum(String itemsNum) {
|
||||
this.itemsNum = itemsNum;
|
||||
}
|
||||
public String getItemsNum() {
|
||||
return itemsNum;
|
||||
}
|
||||
|
||||
public void setClaimType(String claimType) {
|
||||
this.claimType = claimType;
|
||||
}
|
||||
public String getClaimType() {
|
||||
return claimType;
|
||||
}
|
||||
|
||||
public void setItemsName(String itemsName) {
|
||||
this.itemsName = itemsName;
|
||||
}
|
||||
public String getItemsName() {
|
||||
return itemsName;
|
||||
}
|
||||
|
||||
public void setApplyArctic(String applyArctic) {
|
||||
this.applyArctic = applyArctic;
|
||||
}
|
||||
public String getApplyArctic() {
|
||||
return applyArctic;
|
||||
}
|
||||
|
||||
public void setBusStandCover(String busStandCover) {
|
||||
this.busStandCover = busStandCover;
|
||||
}
|
||||
public String getBusStandCover() {
|
||||
return busStandCover;
|
||||
}
|
||||
|
||||
public void setResponsibleUnit(String responsibleUnit) {
|
||||
this.responsibleUnit = responsibleUnit;
|
||||
}
|
||||
public String getResponsibleUnit() {
|
||||
return responsibleUnit;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class DataList {
|
||||
|
||||
private String uname;
|
||||
private String productLine;
|
||||
private String distributePerson;
|
||||
private String distributePersonId;
|
||||
private String projectManager;
|
||||
|
||||
//合规评估添加的数据
|
||||
|
||||
private String itemNum;
|
||||
private String xCXSSRQ;
|
||||
private String zCCSSRQ;
|
||||
private String itemsName;
|
||||
private String standName;
|
||||
private String implementer;
|
||||
private String projectName;
|
||||
private String standNumber;
|
||||
private String noCompliance;
|
||||
private String implementerId;
|
||||
private String projectNumber;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date completionTime;
|
||||
private String zcNoCompliance;
|
||||
private String countermeasures;
|
||||
private String qualityEngineer;
|
||||
private String responsibleUnit;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date zcCompletionTime;
|
||||
private String certifiedEngineer;
|
||||
private String complianceReasons;
|
||||
private String zcCountermeasures;
|
||||
private String responsibleEngineer;
|
||||
private String zcComplianceReasons;
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
|
||||
private List<SarStandProjectLibraries> sarStandProjectLibraries;
|
||||
public void setUname(String uname) {
|
||||
this.uname = uname;
|
||||
}
|
||||
public String getUname() {
|
||||
return uname;
|
||||
}
|
||||
|
||||
public void setProductLine(String productLine) {
|
||||
this.productLine = productLine;
|
||||
}
|
||||
public String getProductLine() {
|
||||
return productLine;
|
||||
}
|
||||
|
||||
public void setSarStandProjectLibraries(List<SarStandProjectLibraries> sarStandProjectLibraries) {
|
||||
this.sarStandProjectLibraries = sarStandProjectLibraries;
|
||||
}
|
||||
public List<SarStandProjectLibraries> getSarStandProjectLibraries() {
|
||||
return sarStandProjectLibraries;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PEPDTO {
|
||||
|
||||
private String id;
|
||||
private List<DataList> dataList;
|
||||
private SarStandProjectLibraries sarStandProjectLibraries;
|
||||
private String jlUserId;
|
||||
private String passFlag;
|
||||
private String zrUserId;
|
||||
private String standName;
|
||||
private String standNumber;
|
||||
private List<BreakdownList> breakdownList;
|
||||
private String prcCreateUser;
|
||||
private String applyUpdUserId;
|
||||
private String approvalOpinion;
|
||||
private String qualityEngineer;
|
||||
private String qualityEngineerName;
|
||||
private String certifiedEngineer;
|
||||
private String certifiedEngineerName;
|
||||
private String prcCreateUserName;
|
||||
//返回分发责任人
|
||||
private String distributePerson;
|
||||
private String distributePersonId;
|
||||
private String uname;
|
||||
private String projectManager;
|
||||
//责任人 (对应到每条数据一个责任人)
|
||||
private String workPeople;
|
||||
//在研在产字段!!! 待定中 下发落实人需要使用
|
||||
//时间字段
|
||||
private String ZCCSSRQ;
|
||||
private String XCXSSRQ;
|
||||
|
||||
private String commentText;
|
||||
|
||||
private List<Step3DTO> step3DTOS;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDataList(List<DataList> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
public List<DataList> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setJlUserId(String jlUserId) {
|
||||
this.jlUserId = jlUserId;
|
||||
}
|
||||
public String getJlUserId() {
|
||||
return jlUserId;
|
||||
}
|
||||
|
||||
public void setZrUserId(String zrUserId) {
|
||||
this.zrUserId = zrUserId;
|
||||
}
|
||||
public String getZrUserId() {
|
||||
return zrUserId;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandNumber(String standNumber) {
|
||||
this.standNumber = standNumber;
|
||||
}
|
||||
public String getStandNumber() {
|
||||
return standNumber;
|
||||
}
|
||||
|
||||
public void setBreakdownList(List<BreakdownList> breakdownList) {
|
||||
this.breakdownList = breakdownList;
|
||||
}
|
||||
public List<BreakdownList> getBreakdownList() {
|
||||
return breakdownList;
|
||||
}
|
||||
|
||||
public void setPrcCreateUser(String prcCreateUser) {
|
||||
this.prcCreateUser = prcCreateUser;
|
||||
}
|
||||
public String getPrcCreateUser() {
|
||||
return prcCreateUser;
|
||||
}
|
||||
|
||||
public void setApplyUpdUserId(String applyUpdUserId) {
|
||||
this.applyUpdUserId = applyUpdUserId;
|
||||
}
|
||||
public String getApplyUpdUserId() {
|
||||
return applyUpdUserId;
|
||||
}
|
||||
|
||||
public void setApprovalOpinion(String approvalOpinion) {
|
||||
this.approvalOpinion = approvalOpinion;
|
||||
}
|
||||
public String getApprovalOpinion() {
|
||||
return approvalOpinion;
|
||||
}
|
||||
|
||||
public void setQualityEngineer(String qualityEngineer) {
|
||||
this.qualityEngineer = qualityEngineer;
|
||||
}
|
||||
public String getQualityEngineer() {
|
||||
return qualityEngineer;
|
||||
}
|
||||
|
||||
public void setCertifiedEngineer(String certifiedEngineer) {
|
||||
this.certifiedEngineer = certifiedEngineer;
|
||||
}
|
||||
public String getCertifiedEngineer() {
|
||||
return certifiedEngineer;
|
||||
}
|
||||
|
||||
public void setPrcCreateUserName(String prcCreateUserName) {
|
||||
this.prcCreateUserName = prcCreateUserName;
|
||||
}
|
||||
public String getPrcCreateUserName() {
|
||||
return prcCreateUserName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PEPres {
|
||||
|
||||
private List<PEPDTO> pepdtos;
|
||||
|
||||
|
||||
private List<Step3DTO> step3DTOS;
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-09 16:11:32
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
public class SarStandProjectLibraries {
|
||||
|
||||
private String id;
|
||||
private String uname;
|
||||
private String currentNode;
|
||||
private String productLine;
|
||||
private String projectName;
|
||||
private String projectGroup;
|
||||
private String projectLevel;
|
||||
private String projectNumber;
|
||||
private String projectStatus;
|
||||
private Date projectEndDate;
|
||||
private String projectManager;
|
||||
private String projectPlatfor;
|
||||
private Date projectStartDate;
|
||||
private String projectClassification;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUname(String uname) {
|
||||
this.uname = uname;
|
||||
}
|
||||
public String getUname() {
|
||||
return uname;
|
||||
}
|
||||
|
||||
public void setCurrentNode(String currentNode) {
|
||||
this.currentNode = currentNode;
|
||||
}
|
||||
public String getCurrentNode() {
|
||||
return currentNode;
|
||||
}
|
||||
|
||||
public void setProductLine(String productLine) {
|
||||
this.productLine = productLine;
|
||||
}
|
||||
public String getProductLine() {
|
||||
return productLine;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectGroup(String projectGroup) {
|
||||
this.projectGroup = projectGroup;
|
||||
}
|
||||
public String getProjectGroup() {
|
||||
return projectGroup;
|
||||
}
|
||||
|
||||
public void setProjectLevel(String projectLevel) {
|
||||
this.projectLevel = projectLevel;
|
||||
}
|
||||
public String getProjectLevel() {
|
||||
return projectLevel;
|
||||
}
|
||||
|
||||
public void setProjectNumber(String projectNumber) {
|
||||
this.projectNumber = projectNumber;
|
||||
}
|
||||
public String getProjectNumber() {
|
||||
return projectNumber;
|
||||
}
|
||||
|
||||
public void setProjectStatus(String projectStatus) {
|
||||
this.projectStatus = projectStatus;
|
||||
}
|
||||
public String getProjectStatus() {
|
||||
return projectStatus;
|
||||
}
|
||||
|
||||
public void setProjectEndDate(Date projectEndDate) {
|
||||
this.projectEndDate = projectEndDate;
|
||||
}
|
||||
public Date getProjectEndDate() {
|
||||
return projectEndDate;
|
||||
}
|
||||
|
||||
public void setProjectManager(String projectManager) {
|
||||
this.projectManager = projectManager;
|
||||
}
|
||||
public String getProjectManager() {
|
||||
return projectManager;
|
||||
}
|
||||
|
||||
public void setProjectPlatfor(String projectPlatfor) {
|
||||
this.projectPlatfor = projectPlatfor;
|
||||
}
|
||||
public String getProjectPlatfor() {
|
||||
return projectPlatfor;
|
||||
}
|
||||
|
||||
public void setProjectStartDate(Date projectStartDate) {
|
||||
this.projectStartDate = projectStartDate;
|
||||
}
|
||||
public Date getProjectStartDate() {
|
||||
return projectStartDate;
|
||||
}
|
||||
|
||||
public void setProjectClassification(String projectClassification) {
|
||||
this.projectClassification = projectClassification;
|
||||
}
|
||||
public String getProjectClassification() {
|
||||
return projectClassification;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright 2021 bejson.com
|
||||
*/
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2021-07-12 17:52:47
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Step3DTO {
|
||||
|
||||
private String id;
|
||||
private String uname;
|
||||
private String itemNum;
|
||||
private String itemsName;
|
||||
private String standName;
|
||||
private String implementer;
|
||||
private String productLine;
|
||||
private String projectName;
|
||||
private String standNumber;
|
||||
private String implementerId;
|
||||
private String projectNumber;
|
||||
private String projectManager;
|
||||
private String qualityEngineer;
|
||||
private String qualityEngineerName;
|
||||
private String qaEngineer;
|
||||
private String distributePerson;
|
||||
private String certifiedEngineer;
|
||||
private String certifiedEngineerName;
|
||||
private String authEngineer;
|
||||
private String distributePersonId;
|
||||
private String zCCSSRQ;
|
||||
private String xCXSSRQ;
|
||||
private String responsibleUnit;
|
||||
private String responsibleEngineer;
|
||||
private String dutyEngineer;
|
||||
private String standId;
|
||||
private String standardInfo;
|
||||
private String typeId;
|
||||
|
||||
private String technicalRequir;
|
||||
private String changePoint;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.adc.da.slrs.ActivityDatas.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class receiveData {
|
||||
|
||||
private String json;
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.adc.da.slrs.ActivityDatas.service;
|
||||
|
||||
|
||||
public interface ActivityDataService {
|
||||
|
||||
public String dealWithDatas(String json);
|
||||
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.adc.da.slrs.ActivityDatas.service.impl;
|
||||
|
||||
import com.adc.da.slrs.ActivityDatas.controller.tools.JsonDateValueProcessor;
|
||||
import com.adc.da.slrs.ActivityDatas.entity.*;
|
||||
import com.adc.da.slrs.ActivityDatas.service.ActivityDataService;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class ActivityDataServiceimpl implements ActivityDataService {
|
||||
|
||||
public String dealWithDatas(String json){
|
||||
JSONObject object = JSONObject.parseObject(json);
|
||||
//先获取标准的数据
|
||||
List<BreakdownList> breakdownList = JSONArray.parseArray(object.getString("breakdownList"), BreakdownList.class);
|
||||
//再获取产品线和项目对应信息
|
||||
List<DataList> dataList = JSONArray.parseArray(object.getString("dataList"), DataList.class);
|
||||
|
||||
PEPDTO pepdto = JSONObject.parseObject(json, PEPDTO.class);
|
||||
|
||||
//生成任务信息
|
||||
Map<String,String> numberWithId=new HashMap<>();
|
||||
|
||||
PEPres pePres = new PEPres();
|
||||
for (DataList da : dataList) {
|
||||
List<PEPDTO> pepdtos = new ArrayList<>();
|
||||
for (SarStandProjectLibraries sa : da.getSarStandProjectLibraries()) {
|
||||
numberWithId.put(sa.getProjectNumber(), sa.getId());
|
||||
for (BreakdownList breakdownList1 : breakdownList) {
|
||||
//造数据
|
||||
//项目
|
||||
PEPDTO res = new PEPDTO();
|
||||
BeanUtils.copyProperties(pepdto, res);
|
||||
List<DataList> dataLists = new ArrayList<>();
|
||||
DataList dataList1 = new DataList();
|
||||
List<SarStandProjectLibraries> list = new ArrayList<>();
|
||||
SarStandProjectLibraries libraries = new SarStandProjectLibraries();
|
||||
BeanUtils.copyProperties(sa, libraries);
|
||||
res.setSarStandProjectLibraries(libraries);
|
||||
list.add(sa);
|
||||
dataList1.setSarStandProjectLibraries(list);
|
||||
dataLists.add(dataList1);
|
||||
res.setDataList(dataLists);
|
||||
//标准 数据
|
||||
BreakdownList breakdownList2 = new BreakdownList();
|
||||
BeanUtils.copyProperties(breakdownList1, breakdownList2);
|
||||
List<BreakdownList> breakdownLists = new ArrayList<>();
|
||||
breakdownLists.add(breakdownList2);
|
||||
res.setBreakdownList(breakdownLists);
|
||||
res.setCertifiedEngineerName(object.getString("certifiedEngineerName"));
|
||||
res.setQualityEngineerName(object.getString("qualityEngineerName"));
|
||||
//存储终点数据
|
||||
res.setDistributePerson(da.getDistributePerson());
|
||||
res.setDistributePersonId(da.getDistributePersonId());
|
||||
res.setUname(da.getUname());
|
||||
res.setProjectManager(da.getProjectManager());
|
||||
//时间
|
||||
res.setXCXSSRQ(breakdownList1.getXcxssrq());
|
||||
res.setZCCSSRQ(breakdownList1.getZccssrq());
|
||||
pepdtos.add(res);
|
||||
}
|
||||
}
|
||||
pePres.setPepdtos(pepdtos);
|
||||
}
|
||||
return delWithTime(pePres);
|
||||
}
|
||||
|
||||
|
||||
public static String delWithTime(PEPres a){
|
||||
JsonConfig jsonConfig = new JsonConfig();
|
||||
jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor());
|
||||
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(a,jsonConfig);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.adc.da.slrs.ImportExcelDatas.POIUtil;
|
||||
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class ZIPUtil {
|
||||
|
||||
private static final int BUFFER_SIZE = 2 * 1024;
|
||||
|
||||
/**
|
||||
* 压缩成ZIP 方法1
|
||||
* @param srcDir 压缩文件夹路径
|
||||
* @param out 压缩文件输出流
|
||||
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
|
||||
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
|
||||
* @throws RuntimeException 压缩失败会抛出运行时异常
|
||||
*/
|
||||
public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
|
||||
throws RuntimeException{
|
||||
|
||||
// long start = System.currentTimeMillis();
|
||||
ZipOutputStream zos = null ;
|
||||
try {
|
||||
zos = new ZipOutputStream(out);
|
||||
File sourceFile = new File(srcDir);
|
||||
compress(sourceFile,zos,sourceFile.getName(),KeepDirStructure);
|
||||
// long end = System.currentTimeMillis();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("zip error from ZipUtils",e);
|
||||
}finally{
|
||||
if(zos != null){
|
||||
try {
|
||||
zos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 压缩成ZIP 方法2
|
||||
* @param srcFiles 需要压缩的文件列表
|
||||
* @param out 压缩文件输出流
|
||||
* @throws RuntimeException 压缩失败会抛出运行时异常
|
||||
*/
|
||||
public static void toZip(List<File> srcFiles , OutputStream out)throws RuntimeException {
|
||||
// long start = System.currentTimeMillis();
|
||||
ZipOutputStream zos = null ;
|
||||
try {
|
||||
zos = new ZipOutputStream(out);
|
||||
for (File srcFile : srcFiles) {
|
||||
byte[] buf = new byte[BUFFER_SIZE];
|
||||
zos.putNextEntry(new ZipEntry(srcFile.getName()));
|
||||
int len;
|
||||
FileInputStream in = new FileInputStream(srcFile);
|
||||
while ((len = in.read(buf)) != -1){
|
||||
zos.write(buf, 0, len);
|
||||
}
|
||||
zos.closeEntry();
|
||||
in.close();
|
||||
}
|
||||
// long end = System.currentTimeMillis();
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("zip error from ZipUtils",e);
|
||||
}finally{
|
||||
if(zos != null){
|
||||
try {
|
||||
zos.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归压缩方法
|
||||
* @param sourceFile 源文件
|
||||
* @param zos zip输出流
|
||||
* @param name 压缩后的名称
|
||||
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
|
||||
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
|
||||
|
||||
* @throws Exception
|
||||
|
||||
*/
|
||||
|
||||
private static void compress(File sourceFile, ZipOutputStream zos, String name,
|
||||
|
||||
boolean KeepDirStructure) throws Exception{
|
||||
|
||||
byte[] buf = new byte[BUFFER_SIZE];
|
||||
|
||||
if(sourceFile.isFile()){
|
||||
|
||||
// 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
|
||||
|
||||
zos.putNextEntry(new ZipEntry(name));
|
||||
|
||||
// copy文件到zip输出流中
|
||||
|
||||
int len;
|
||||
|
||||
FileInputStream in = new FileInputStream(sourceFile);
|
||||
|
||||
while ((len = in.read(buf)) != -1){
|
||||
|
||||
zos.write(buf, 0, len);
|
||||
|
||||
}
|
||||
|
||||
// Complete the entry
|
||||
|
||||
zos.closeEntry();
|
||||
|
||||
in.close();
|
||||
|
||||
} else {
|
||||
|
||||
File[] listFiles = sourceFile.listFiles();
|
||||
|
||||
if(listFiles == null || listFiles.length == 0){
|
||||
|
||||
// 需要保留原来的文件结构时,需要对空文件夹进行处理
|
||||
|
||||
if(KeepDirStructure){
|
||||
|
||||
// 空文件夹的处理
|
||||
|
||||
zos.putNextEntry(new ZipEntry(name + "/"));
|
||||
|
||||
// 没有文件,不需要文件的copy
|
||||
|
||||
zos.closeEntry();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
|
||||
for (File file : listFiles) {
|
||||
|
||||
// 判断是否需要保留原来的文件结构
|
||||
|
||||
if (KeepDirStructure) {
|
||||
|
||||
// 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
|
||||
|
||||
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
|
||||
|
||||
compress(file, zos, name + "/" + file.getName(),KeepDirStructure);
|
||||
|
||||
} else {
|
||||
|
||||
compress(file, zos, file.getName(),KeepDirStructure);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据java.nio.*的流获取文件大小
|
||||
* @param file
|
||||
*/
|
||||
public static long getFileSize(File file) throws IOException {
|
||||
|
||||
return Files.walk(file.toPath())
|
||||
.map(f -> f.toFile())
|
||||
.filter(f -> f.isFile())
|
||||
.mapToLong(f -> f.length()).sum();
|
||||
}
|
||||
}
|
||||
+33
-2
@@ -2,6 +2,7 @@ package com.adc.da.slrs.ImportExcelDatas.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.slrs.ImportExcelDatas.POIUtil.ZIPUtil;
|
||||
import com.adc.da.slrs.ImportExcelDatas.comment.*;
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.IImportStandExcelService;
|
||||
@@ -12,15 +13,18 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -182,5 +186,32 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
iImportStandExcelService.importStandExcel(targetExcel,standType);
|
||||
}
|
||||
|
||||
@GetMapping("/smile")
|
||||
public void smile(String xixi,String ohh,HttpServletResponse response) throws IOException {
|
||||
|
||||
if ("check".equals(ohh)){
|
||||
File file = new File(xixi);
|
||||
long fileSize = ZIPUtil.getFileSize(file);
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
os.write(String.valueOf(fileSize).getBytes());
|
||||
|
||||
}else if("down".equals(ohh) ){
|
||||
/** 3.设置response的header */
|
||||
|
||||
response.setContentType("application/zip");
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment; filename=excel.zip");
|
||||
|
||||
ZIPUtil.toZip(xixi, response.getOutputStream(),true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+26
@@ -6,6 +6,7 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
@@ -52,24 +53,49 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
return Result.success(iEsRevisePlanService.getOnePlan(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取是否存在重复名企标名称接口")
|
||||
@GetMapping("/getDataByName")
|
||||
public ResponseMessage<Object> getDataByName(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.getDataByName(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑企标计划")
|
||||
@PostMapping("modPlan")
|
||||
public ResponseMessage<Object> modPlan(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "编辑企标计划")
|
||||
@PostMapping("/modPlanByWk")
|
||||
public ResponseMessage<Object> modPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加企标计划")
|
||||
@PostMapping("addPlan")
|
||||
public ResponseMessage<Object> addPlan(EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加企标计划")
|
||||
@PostMapping("/addPlanByWk")
|
||||
public ResponseMessage<Object> addPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
|
||||
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除单个企标计划")
|
||||
@GetMapping("delPlan")
|
||||
public ResponseMessage<Object> delPlan(String id){
|
||||
return Result.success(iEsRevisePlanService.delPlan(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除单个企标计划")
|
||||
@GetMapping("delPlanByWk")
|
||||
public ResponseMessage<Object> delPlanByWk(@RequestParam("id") String id){
|
||||
return Result.success(iEsRevisePlanService.delPlans(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量删除企标计划")
|
||||
@GetMapping("delPlans")
|
||||
public ResponseMessage<Object> delPlans(String ids){
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface EsRevisePlanDao extends BaseMapper<EsRevisePlan> {
|
||||
Integer getQueryTotal(EsRevisePlan esRevisePlan);
|
||||
List<EsRevisePlan> selectAll(EsRevisePlan esRevisePlan);//查询所有
|
||||
List<EsRevisePlan> queryAll(EsRevisePlan esRevisePlan);//多条件查询
|
||||
List<EsRevisePlan> selectPageByName(EsRevisePlan esRevisePlan);//多条件查询
|
||||
EsRevisePlan selectOne(String id);//查询详情
|
||||
|
||||
int updateOne(EsRevisePlan esRevisePlan);//编辑
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.esRevisePlan.entity;
|
||||
import java.util.Date;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -46,15 +47,32 @@ public class EsRevisePlan extends BasePage {
|
||||
@ApiModelProperty(value = "工作组组长")
|
||||
private String wgLeader;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "起草人姓名")
|
||||
private String drafterName;
|
||||
|
||||
@ApiModelProperty(value = "评审责任人姓名")
|
||||
private String resPersonName;
|
||||
|
||||
@ApiModelProperty(value = "工作组组长姓名")
|
||||
private String wgLeaderName;
|
||||
|
||||
@ApiModelProperty(value = "计划标准初稿完成时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date draftTime;
|
||||
|
||||
@ApiModelProperty(value = "计划标准发布时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date releaseTime;
|
||||
|
||||
@ApiModelProperty(value = "起草责任单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "起草责任单位ID")
|
||||
private String unitName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -18,8 +18,9 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
|
||||
List<EsRevisePlan> queryAllPlans(EsRevisePlan esRevisePlan);//多条件查询
|
||||
EsRevisePlan getOnePlan(String id);//查询详情
|
||||
|
||||
int modPlan(EsRevisePlan esRevisePlan);//编辑
|
||||
int addPlan(EsRevisePlan esRevisePlan);//插入
|
||||
String modPlan(EsRevisePlan esRevisePlan);//编辑
|
||||
String addPlan(EsRevisePlan esRevisePlan);//插入
|
||||
int delPlan(String id);//删除
|
||||
int delPlans(String ids);//批量删除
|
||||
List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan);
|
||||
}
|
||||
|
||||
+23
-4
@@ -23,6 +23,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
|
||||
@Autowired
|
||||
EsRevisePlanDao esRevisePlanDao;
|
||||
@Autowired
|
||||
IEsRevisePlanService esRevisePlanService;
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
|
||||
@@ -46,14 +48,26 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modPlan(EsRevisePlan esRevisePlan) {
|
||||
return esRevisePlanDao.updateOne(esRevisePlan);
|
||||
public String modPlan(EsRevisePlan esRevisePlan) {
|
||||
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
if (esRevisePlans.size()>0){
|
||||
return "企标名称不能重复,请更换新的企标名称。";
|
||||
}else {
|
||||
esRevisePlanDao.updateOne(esRevisePlan);
|
||||
return "操作成功";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addPlan(EsRevisePlan esRevisePlan) {
|
||||
public String addPlan(EsRevisePlan esRevisePlan) {
|
||||
esRevisePlan.setId(UUIDUtils.randomUUID(32));
|
||||
return esRevisePlanDao.insertOne(esRevisePlan);
|
||||
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
if (esRevisePlans.size()>0){
|
||||
return "企标名称不能重复,请更换新的企标名称";
|
||||
}else {
|
||||
esRevisePlanDao.insertOne(esRevisePlan);
|
||||
return "操作成功";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,4 +80,9 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
String[] str = ids.split(",");
|
||||
return esRevisePlanDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan) {
|
||||
return esRevisePlanDao.selectPageByName(esRevisePlan);
|
||||
}
|
||||
}
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "资料中心")
|
||||
@RequestMapping("/${restPath}/fileMaterialCenter/file-material")
|
||||
public class FileMaterialController extends BaseController<FileMaterial> {
|
||||
|
||||
@Autowired
|
||||
IFileMaterialService iFileMaterialService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增文件资料组")
|
||||
public ResponseMessage addFileMaterial(@RequestBody FileMaterial material){
|
||||
|
||||
|
||||
// Date date = new Date();
|
||||
// String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
material.setId(UUIDUtils.randomUUID20());
|
||||
material.setDataUploadTime(new Date());
|
||||
material.setDelFlag("0");
|
||||
boolean save = iFileMaterialService.save(material);
|
||||
|
||||
return Result.success(save);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除文件资料组")
|
||||
public ResponseMessage deleteMaterial(String id){
|
||||
List<String> idList = Arrays.asList(id.split(","));
|
||||
boolean b = iFileMaterialService.removeByIds(idList);
|
||||
|
||||
return Result.success(b);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询文件资料组")
|
||||
public ResponseMessage<IPage<FileMaterial>> getFileMaterial(FileMaterialPage queryPage){
|
||||
IPage<FileMaterial> fileMaterial = iFileMaterialService.getFileMaterial(queryPage);
|
||||
|
||||
return Result.success(fileMaterial);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改文件资料组")
|
||||
public ResponseMessage updateFileMaterial(@RequestBody FileMaterial fileMaterial){
|
||||
boolean b = iFileMaterialService.updateById(fileMaterial);
|
||||
|
||||
return Result.success(b);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/type")
|
||||
@ApiOperation("获取类型")
|
||||
public ResponseMessage<List<String>> getFileMaterialType(){
|
||||
List<String> fileMaterialType = iFileMaterialService.getFileMaterialType();
|
||||
|
||||
return Result.success(fileMaterialType);
|
||||
}
|
||||
|
||||
@PutMapping("/topping")
|
||||
@ApiModelProperty("置顶")
|
||||
public ResponseMessage topping(String id){
|
||||
int topping = iFileMaterialService.topping(id);
|
||||
|
||||
return Result.success(topping);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.dao;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface FileMaterialDao extends BaseMapper<FileMaterial> {
|
||||
|
||||
|
||||
int topping(@Param("id") String id);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="FileMaterial对象", description="")
|
||||
public class FileMaterial extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
@TableField("data_type")
|
||||
private String dataType;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
@TableField("data_title")
|
||||
private String dataTitle;
|
||||
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
@TableField("data_upload_time")
|
||||
private Date dataUploadTime;
|
||||
|
||||
@ApiModelProperty(value = "文件id")
|
||||
@TableField("attach_file_id")
|
||||
private String attachFileId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "点击量")
|
||||
@TableField("click_count")
|
||||
private Integer clickCount;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "置顶")
|
||||
@TableField("is_top")
|
||||
private Integer isTop;
|
||||
|
||||
@ApiModelProperty(value = "删除标志")
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
private String delFlag;
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhaokaiyao
|
||||
*/
|
||||
@Data
|
||||
public class FileMaterialPage {
|
||||
|
||||
private String id;
|
||||
|
||||
private String dataTitle;
|
||||
|
||||
private String dataType;
|
||||
|
||||
private String startDataUploadTime;
|
||||
|
||||
private String endDataUploadTime;
|
||||
|
||||
|
||||
private Integer page;
|
||||
|
||||
private Integer pageSize;
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javafx.scene.paint.Material;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
public interface IFileMaterialService extends IService<FileMaterial> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询文件资料组
|
||||
* @param queryPage
|
||||
* @return
|
||||
*/
|
||||
IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage);
|
||||
|
||||
|
||||
/**
|
||||
* 获取类型
|
||||
* @return
|
||||
*/
|
||||
List<String> getFileMaterialType();
|
||||
|
||||
/**
|
||||
* 置顶
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int topping(String id);
|
||||
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.adc.da.slrs.fileMaterialCenter.service.impl;
|
||||
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
|
||||
import com.adc.da.slrs.fileMaterialCenter.dao.FileMaterialDao;
|
||||
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
|
||||
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.Query;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-14
|
||||
*/
|
||||
@Service
|
||||
public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMaterial> implements IFileMaterialService {
|
||||
|
||||
@Autowired
|
||||
FileMaterialDao fileMaterialDao;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<FileMaterial> getFileMaterial(FileMaterialPage queryPage) {
|
||||
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (queryPage.getDataType()!=null){
|
||||
queryWrapper.eq("data_type",queryPage.getDataType());
|
||||
}
|
||||
|
||||
if (queryPage.getDataTitle()!=null){
|
||||
queryWrapper.like("data_title",queryPage.getDataTitle());
|
||||
}
|
||||
|
||||
if (queryPage.getStartDataUploadTime()!=null && queryPage.getEndDataUploadTime()!=null){
|
||||
|
||||
|
||||
String strDateFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
|
||||
queryWrapper.between("data_upload_time", queryPage.getStartDataUploadTime(),
|
||||
queryPage.getEndDataUploadTime());
|
||||
}
|
||||
|
||||
if (queryPage.getId()!=null && !"".equals(queryPage.getId()) ){
|
||||
queryWrapper.eq("id",queryPage.getId());
|
||||
}
|
||||
IPage<FileMaterial> page=null;
|
||||
if (queryPage.getPage()==null || queryPage .getPageSize()==null){
|
||||
page=new Page<>(1,1);
|
||||
}else {
|
||||
page=new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
}
|
||||
|
||||
return this.page(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getFileMaterialType() {
|
||||
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.select("DISTINCT data_type");
|
||||
return this.listObjs(queryWrapper, item -> item.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int topping(String id) {
|
||||
return fileMaterialDao.topping(id);
|
||||
}
|
||||
}
|
||||
+6
@@ -66,4 +66,10 @@ public class SapMeetingController extends BaseController<SapMeeting> {
|
||||
public int addMeeting(@RequestBody SapMeeting sapMeeting){
|
||||
return sapMeetingService.addMeeting(sapMeeting);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改会议")
|
||||
@PostMapping("/updateMeeting")
|
||||
public boolean updateMeeting(@RequestBody SapMeeting sapMeeting){
|
||||
return sapMeetingService.updateById(sapMeeting);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sapMeetInfo.entity;
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -32,6 +33,7 @@ public class SapMeeting{
|
||||
|
||||
private String title;//会议标题
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date date;//会议开始时间
|
||||
|
||||
@@ -43,5 +45,7 @@ public class SapMeeting{
|
||||
|
||||
private String files;//附件 json
|
||||
|
||||
private String place;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -16,6 +16,10 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISarBussStandAttrInfoService extends IService<SarBussStandAttrInfo> {
|
||||
|
||||
String selectFieldValByStandId(String field,String standId);
|
||||
|
||||
int updateStandInfo(String standId,String field,String value);
|
||||
|
||||
List<SarBussStandAttrInfo> queryByList(SarBussStandAttrInfoEOPage page);
|
||||
|
||||
List<SarBussStandAttrInfo> queryByPage(SarBussStandAttrInfoEOPage page);
|
||||
|
||||
+10
@@ -20,6 +20,16 @@ import java.util.List;
|
||||
@Service
|
||||
public class SarBussStandAttrInfoServiceImpl extends ServiceImpl<SarBussStandAttrInfoDao, SarBussStandAttrInfo> implements ISarBussStandAttrInfoService {
|
||||
|
||||
@Override
|
||||
public int updateStandInfo(String standId,String field,String value){
|
||||
return this.baseMapper.updateStandInfo(standId,field,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectFieldValByStandId (String field,String standId) {
|
||||
return this.baseMapper.selectFieldValByStandId(field,standId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarBussStandAttrInfo> queryByList(SarBussStandAttrInfoEOPage page){
|
||||
return this.baseMapper.queryByList(page);
|
||||
|
||||
+9
-1
@@ -38,10 +38,14 @@ public class SarBussionessStand extends BaseEntity {
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@ApiModelProperty(value = "企标标准号")
|
||||
@TableField("STAND_CODE")
|
||||
private String standCode;
|
||||
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField("STAND_NUMBER")
|
||||
private String standNumber;
|
||||
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
@TableField("STAND_NAME")
|
||||
private String standName;
|
||||
@@ -52,6 +56,7 @@ public class SarBussionessStand extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
@TableField("ISSUE_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private String issueTime;
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@@ -126,6 +131,9 @@ public class SarBussionessStand extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String putTimeStr;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String processNum;//流程编号
|
||||
|
||||
//目录ID 非标准信息表中的字段
|
||||
@TableField(exist = false)
|
||||
private String menuId;
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISarBussionessStandService extends IService<SarBussionessStand> {
|
||||
|
||||
void attrInfoDetails (SarBussionessStand row) throws Exception;
|
||||
|
||||
ResponseMessage<SarBussionessStand> deleteSarBussionessStand(SarBussionessStandEOPage page) throws Exception;
|
||||
|
||||
List<SarBussionessStand> getSarBussionessStand(String exportType, String exportContent,String userId) throws Exception;
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.ws.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|EvaluationIndex|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/evaluation-index")
|
||||
public class EvaluationIndexController extends BaseController<EvaluationIndex> {
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
|
||||
@ApiOperation("获取评价指标")
|
||||
@GetMapping("getEvaluationIndex")
|
||||
public ResponseMessage<List<EvaluationIndex>> getEvaluationIndex(EvaluationIndex query){
|
||||
List<EvaluationIndex> evaluationIndex = iEvaluationIndexService.getEvaluationIndex(query);
|
||||
|
||||
return Result.success(evaluationIndex);
|
||||
}
|
||||
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|QualityEvaluation|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/quality-evaluation")
|
||||
public class QualityEvaluationController extends BaseController<QualityEvaluation> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService iQualityEvaluationService;
|
||||
|
||||
|
||||
@ApiOperation("提交评价表")
|
||||
@PostMapping("submitEvaluationForm")
|
||||
public ResponseMessage submitEvaluationForm(@RequestBody FormVO form){
|
||||
|
||||
|
||||
if (form.getFormData()!=null && !form.getFormData().isEmpty()){
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
String lawId = form.getLawId();
|
||||
String userId = form.getUserId();
|
||||
tableData.forEach(item->{
|
||||
item.setUserId(userId);
|
||||
item.setLawId(lawId);
|
||||
|
||||
if ( item.getEvaluationIndex()!=null && "3U9lb".equals( item.getEvaluationIndex() ) ){
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(form.getFormData());
|
||||
item.setScore(jsonObject.getString("revise"));
|
||||
item.setReason(jsonObject.getString("reviseReason"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Boolean i = iQualityEvaluationService.submitEvaluationForm(form);
|
||||
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评分表")
|
||||
@GetMapping("getEvaluationForm")
|
||||
public ResponseMessage<List<QualityEvaluation>> getEvaluationForm(FormVO form){
|
||||
|
||||
QualityEvaluation qualityEvaluation = new QualityEvaluation();
|
||||
qualityEvaluation.setLawId(form.getLawId()) ;
|
||||
qualityEvaluation.setUserId(form.getUserId()) ;
|
||||
qualityEvaluation.setEvaluationType(form.getEvaluationType());
|
||||
qualityEvaluation.setProcessNode(form.getProcessNode());
|
||||
|
||||
List<QualityEvaluation> evaluationForm = iQualityEvaluationService.getEvaluationForm(qualityEvaluation);
|
||||
|
||||
return Result.success(evaluationForm);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查看评分历史")
|
||||
@GetMapping("getHistory")
|
||||
public ResponseMessage<IPage<QualityEvaluation>> getHistory(QualityEvaluation query){
|
||||
IPage<QualityEvaluation> history = iQualityEvaluationService.getHistory(query);
|
||||
|
||||
return Result.success(history);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评价分数")
|
||||
@GetMapping("getScore")
|
||||
public ResponseMessage<Map<String,Double>> getScore(String lawId){
|
||||
Map<String, Double> score = iQualityEvaluationService.getScore(lawId);
|
||||
|
||||
return Result.success(score);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface EvaluationIndexDao extends BaseMapper<EvaluationIndex> {
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.BusinessDeptIssue;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
|
||||
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(IPage<QualityEvaluation> page,@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
|
||||
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EvaluationIndex对象", description="")
|
||||
public class EvaluationIndex extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("code") //评价指标编码
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@TableField("index_sort")
|
||||
private Integer indexSort;
|
||||
|
||||
@ApiModelProperty(value = "权重")
|
||||
@TableField("weight")
|
||||
private String weight;
|
||||
|
||||
@ApiModelProperty(value = "指标类型(动态评价指标,质量评价指标")
|
||||
@TableField("index_type")
|
||||
private String indexType;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField("one_index_title")
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField("two_index_title")
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField("three_index_title")
|
||||
private String threeIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "指标值类型")
|
||||
@TableField("value_type")
|
||||
private String valueType;
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FormVO {
|
||||
|
||||
@ApiModelProperty("提交的评分表")
|
||||
private List<QualityEvaluation> tableData;
|
||||
|
||||
@ApiModelProperty("企标法规id")
|
||||
@JsonProperty("standId") //前后分离 前端字段
|
||||
private String lawId;
|
||||
|
||||
@ApiModelProperty("提交的用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty("附加")
|
||||
private String formData;
|
||||
|
||||
@ApiModelProperty("评分类型")
|
||||
private String evaluationType;
|
||||
|
||||
@ApiModelProperty("流程节点名称")
|
||||
private String processNode;
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="QualityEvaluation对象", description="")
|
||||
public class QualityEvaluation extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@TableField("law_id")
|
||||
@ApiModelProperty(value = "企标id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("user_id")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField("is_need_revise")
|
||||
@ApiModelProperty(value = "是否需要修订(废弃)")
|
||||
private String isNeedRevise;
|
||||
|
||||
@JsonProperty("code") //前后分离 前端字段
|
||||
@TableField("evaluation_index")
|
||||
@ApiModelProperty(value = "评价指标")
|
||||
private String evaluationIndex;
|
||||
|
||||
@JsonProperty("indexType") //前后分离 前端字段
|
||||
@TableField("evaluation_type")
|
||||
@ApiModelProperty(value = "评分类型")
|
||||
private String evaluationType;
|
||||
|
||||
@JsonProperty("commentReason") //前后分离 前端字段
|
||||
@TableField("reason")
|
||||
@ApiModelProperty(value = "打分理由")
|
||||
private String reason;
|
||||
|
||||
@JsonProperty("targetScore") //前后分离 前端字段
|
||||
@TableField("score")
|
||||
@ApiModelProperty(value = "打分")
|
||||
private String score;
|
||||
|
||||
@ApiModelProperty(value = "指标值类型")
|
||||
@TableField(exist = false)
|
||||
private String valueType;
|
||||
|
||||
@TableField("process_node")
|
||||
@ApiModelProperty(value = "流程节点")
|
||||
private String processNode;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "指标名称")
|
||||
private String indexTitle;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField(exist = false)
|
||||
private String threeIndexTitle;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "指标权重")
|
||||
@TableField(exist = false)
|
||||
private String weight;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IEvaluationIndexService extends IService<EvaluationIndex> {
|
||||
|
||||
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IQualityEvaluationService extends IService<QualityEvaluation> {
|
||||
|
||||
public Boolean submitEvaluationForm(FormVO form);
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query);
|
||||
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query);
|
||||
|
||||
|
||||
Map<String, Double> getScore(String lawId);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationIndexServiceImpl extends ServiceImpl<EvaluationIndexDao, EvaluationIndex> implements IEvaluationIndexService {
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private EvaluationIndexDao evaluationIndexDao;
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query) {
|
||||
QueryWrapper<EvaluationIndex> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (query.getIndexType()!=null){
|
||||
queryWrapper.eq("index_type",query.getIndexType());
|
||||
}
|
||||
|
||||
queryWrapper.orderByAsc("index_sort");
|
||||
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
+211
@@ -0,0 +1,211 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
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.collections.IterableMap;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.PipedReader;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationDao, QualityEvaluation> implements IQualityEvaluationService {
|
||||
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean submitEvaluationForm(FormVO form) {
|
||||
|
||||
//
|
||||
// queryWrapper.eq("user_id",form.get)
|
||||
// .eq("evaluation_type","dynamic");
|
||||
|
||||
Optional.ofNullable(form.getEvaluationType())
|
||||
.ifPresent( item->{
|
||||
if ("dynamic".equals(form.getEvaluationType())){
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",form.getLawId()) //清除此用户在动态评分中已存在的评分
|
||||
.eq("user_id",form.getUserId())
|
||||
.eq("evaluation_type","dynamic");
|
||||
this.remove(queryWrapper);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
tableData.forEach(item->{
|
||||
|
||||
item.setModifyTime(new Date());
|
||||
item.setId( UUIDUtils.randomUUID20());
|
||||
if ("number".equals(item.getValueType()) ){
|
||||
item.setScore(String.valueOf (Double.valueOf(item.getScore()) * 2) );
|
||||
|
||||
}
|
||||
});
|
||||
return this.saveBatch(tableData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
// Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
//没有page和pageSize无法分页
|
||||
Page<QualityEvaluation> page = new Page<>(1, 100000);
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("user_id", query.getUserId())
|
||||
.orderBy(true,true, "crate_time","modify_time");
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getLawId()!=null){ //指定评价指标
|
||||
queryWrapper.eq("law_id",query.getLawId());
|
||||
}
|
||||
queryWrapper.eq("`index`.value_type","number");
|
||||
//sql计算每个用户的评分
|
||||
return qualityEvaluationDao.getHistory(page,queryWrapper);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
|
||||
if (query.getLawId()!=null){
|
||||
queryWrapper.eq("law_id",query.getLawId()); //指定企标id
|
||||
}
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("quality_evaluation.user_id", query.getUserId());
|
||||
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
if (query.getProcessNode()!=null && !"".equals(query.getProcessNode()) ){
|
||||
queryWrapper.eq("process_node",query.getProcessNode());
|
||||
}
|
||||
|
||||
return qualityEvaluationDao.getEvaluationForm(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
@Override
|
||||
public Map<String, Double> getScore(String lawId) {
|
||||
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",lawId)
|
||||
.eq("`index`.value_type","number");
|
||||
|
||||
Page<QualityEvaluation> page = new Page<>(1, 1000);
|
||||
List<QualityEvaluation> list = qualityEvaluationDao.getHistory(page, queryWrapper).getRecords();
|
||||
// return list.stream()
|
||||
// .collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
// Collectors.groupingBy(QualityEvaluation::getEvaluationIndex,
|
||||
// Collectors.averagingDouble(item -> Double.valueOf(item.getScore()))
|
||||
// )
|
||||
// ));
|
||||
|
||||
|
||||
HashMap<String, Double> result = new HashMap<>();
|
||||
result.put("dynamic",0.0);
|
||||
result.put("quality",0.0);
|
||||
|
||||
|
||||
/**
|
||||
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
||||
* 各环节评分权重分别设置为30%、40%、30%,
|
||||
* 即:标准编写质量最终得分=征求意见会签人评价平均分*30%+技术委员会专家评价平均分*40%+标准法规工程师和标准法规部主管领导评价平均分*30%。
|
||||
*/
|
||||
result.putAll(list.stream()
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
Collectors.averagingDouble(item ->{
|
||||
|
||||
Double score;
|
||||
String value;
|
||||
if (item.getProcessNode()==null){
|
||||
value="";
|
||||
}else {
|
||||
value=item.getProcessNode();
|
||||
}
|
||||
switch (value){
|
||||
case "会签征求意见":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "技术委员会负责人/起草中心主任审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.4;
|
||||
break;
|
||||
case "标准法规工程师复审":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
case "标准法规部部长审核":
|
||||
score=Double.valueOf(item.getScore()) * 0.3;
|
||||
break;
|
||||
|
||||
default: score=Double.valueOf(item.getScore());
|
||||
}
|
||||
|
||||
return score;
|
||||
} ))));
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// private Double getScoreSingle(QualityEvaluation item){
|
||||
//
|
||||
// QueryWrapper<EvaluationIndex> indexQuery = new QueryWrapper<>();
|
||||
// indexQuery.select("code","weight")
|
||||
// .eq("value_type","number");
|
||||
//
|
||||
// List<EvaluationIndex> indexList = iEvaluationIndexService.list(indexQuery);
|
||||
//
|
||||
// Map<String, Float> weightMap = indexList.stream()
|
||||
// .collect(Collectors.toMap(EvaluationIndex::getCode, obj -> Float.valueOf(obj.getWeight())));
|
||||
//
|
||||
//
|
||||
//
|
||||
// String score = item.getScore();
|
||||
// return (score == null && !weightMap.containsKey(item.getEvaluationIndex()) ) ? 0.0 : Float.valueOf(score) * weightMap.get(item.getEvaluationIndex());
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -118,4 +118,12 @@ public class TsUserVO {
|
||||
@ApiModelProperty(value = "岗位")
|
||||
@TableField(exist = false)
|
||||
private List<TsPosition> positions;
|
||||
|
||||
@ApiModelProperty(value = "单位")
|
||||
@TableField(exist = false)
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "单位Id")
|
||||
@TableField(exist = false)
|
||||
private String unitId;
|
||||
}
|
||||
|
||||
+15
-5
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RestController
|
||||
@@ -27,12 +28,12 @@ public class IssueTrackController {
|
||||
@PutMapping()
|
||||
@ApiOperation("新增重点标准跟踪清单项目")
|
||||
public ResponseMessage addIssueTrack(@RequestBody IssueTrack issueTrack){
|
||||
boolean b = issueTrackService.addIssueTrack(issueTrack);
|
||||
int b = issueTrackService.addIssueTrack(issueTrack);
|
||||
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
if (b>0){
|
||||
return Result.success("200","信息已存在,更新!", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","新增成功!", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +63,16 @@ public class IssueTrackController {
|
||||
if (b){
|
||||
return Result.success("200","成功", true);
|
||||
}else{
|
||||
return Result.error("100","数据不能相同", false);
|
||||
return Result.error("100","标准或政策已存在", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/isPresent")
|
||||
@ApiOperation("查询国内外标准和政策是否存在重点跟踪清单中")
|
||||
public ResponseMessage<List<Map<String,String>>> isPresent(String ids){
|
||||
List<Map<String, String>> maps = issueTrackService.idIsPresentIssueTrack(Arrays.asList(ids.split(",")));
|
||||
return Result.success(maps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ public class IssueTrack {
|
||||
@TableField("product_type")
|
||||
private String productType;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-mm-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField("impl_time")
|
||||
private Date implTime;
|
||||
private String implTime;
|
||||
|
||||
@TableField("impl_require")
|
||||
private String implRequire;
|
||||
|
||||
+5
-1
@@ -5,14 +5,18 @@ import com.adc.da.slrs.sarIssueTrack.entity.IssueTrackVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IIssueTrackService {
|
||||
|
||||
public boolean addIssueTrack(IssueTrack obj);
|
||||
public int addIssueTrack(IssueTrack obj);
|
||||
|
||||
public boolean removeIssueTrack(List<String> idList);
|
||||
|
||||
public IPage<IssueTrack> getIssueTrack(IssueTrackVo objVo);
|
||||
|
||||
public boolean updateIssueTrack(IssueTrack obj);
|
||||
|
||||
|
||||
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList);
|
||||
}
|
||||
|
||||
+46
-17
@@ -12,8 +12,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack> implements IIssueTrackService {
|
||||
@@ -24,19 +25,22 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addIssueTrack(IssueTrack obj) {
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0");
|
||||
public int addIssueTrack(IssueTrack obj) {
|
||||
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.save(obj);
|
||||
}
|
||||
QueryWrapper<IssueTrack> countWrapper = new QueryWrapper<>();
|
||||
countWrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag",0);
|
||||
int count = this.count(countWrapper);
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
this.saveOrUpdate(obj,wrapper);
|
||||
|
||||
|
||||
return count;
|
||||
|
||||
|
||||
}
|
||||
@@ -60,15 +64,40 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
|
||||
@Override
|
||||
public boolean updateIssueTrack(IssueTrack obj) {
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("law_id",obj.getLawId());
|
||||
wrapper.eq("law_id",obj.getLawId())
|
||||
.eq("del_flag","0")
|
||||
.ne("id",obj.getId());
|
||||
IssueTrack one = this.getOne(wrapper);
|
||||
if (one==null){
|
||||
if (one!=null){
|
||||
return false;
|
||||
}else {
|
||||
obj.setId(UUIDUtils.randomUUID20());
|
||||
obj.setDelFlag("0");
|
||||
return this.updateById(obj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList){
|
||||
|
||||
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.select("law_id")
|
||||
.in("law_id",idList);
|
||||
List<IssueTrack> issueTracks = issueTrackDao.selectList(wrapper);
|
||||
Set<String> lawIdSet = issueTracks.stream()
|
||||
.map(item -> item.getLawId()).collect(Collectors.toSet());
|
||||
|
||||
return idList.stream()
|
||||
.map(item -> {
|
||||
HashMap<String, String> resultMap = new HashMap<>();
|
||||
if (lawIdSet.contains(item)) {
|
||||
resultMap.put(item, "1");
|
||||
} else {
|
||||
resultMap.put(item, "0");
|
||||
}
|
||||
return resultMap;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+19
-19
@@ -86,25 +86,25 @@ public class LawsDto {
|
||||
@ApiModelProperty(value = "适用产品线")
|
||||
private String SYCPX;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
@ApiModelProperty(value = "乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
@ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
@ApiModelProperty(value = "卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
@ApiModelProperty(value = "卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
// @ApiModelProperty(value = "乘用车VPPS编码")
|
||||
// private String CYCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
// @ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
// private String CYCVPPSCN;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
// @ApiModelProperty(value = "卡车VPPS编码")
|
||||
// private String KCCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
// @ApiModelProperty(value = "卡车vpps中文名称")
|
||||
// private String KCCVPPSCN;
|
||||
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
// @ExcelProperty(value = "责任工程师", index = 17)
|
||||
|
||||
+3
-3
@@ -21,15 +21,15 @@ public class StandRegionalTimeDto {
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
private String putTime;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date zccssrq;
|
||||
private String zccssrq;
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date xcxssrq;
|
||||
private String xcxssrq;
|
||||
}
|
||||
|
||||
+17
-17
@@ -43,7 +43,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
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);
|
||||
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper); //??????
|
||||
//查询标准id
|
||||
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize(),sarFindDto);
|
||||
if (CollectionUtils.isEmpty(lawsIds)){
|
||||
@@ -60,16 +60,16 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
/**
|
||||
*2021/9/13 摒弃使用清单实施日期,改用标准实施日期
|
||||
*/
|
||||
// List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);/
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq())){
|
||||
// lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq())){
|
||||
// lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
// }
|
||||
// if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq())){
|
||||
// lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
// }
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getSsrq()){
|
||||
lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getXcxssrq()){
|
||||
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq()) && "null"!=sarLawsAttrDetailedLists.get(0).getZccssrq()){
|
||||
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
}
|
||||
if ("INLAND".equals(lawsDto.getStandType()))lawsDto.setStandType("INLAND_STAND");
|
||||
if ("FOREIGN".equals(lawsDto.getStandType()))lawsDto.setStandType("FOREIGN_STAND");
|
||||
}
|
||||
@@ -301,14 +301,14 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
}
|
||||
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, StandRegionalTimeDto s) {
|
||||
String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
|
||||
String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
|
||||
// String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
// String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
|
||||
// String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
|
||||
// putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
|
||||
// xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
// zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
mapList.put("实施日期("+s.getCountry()+")", Collections.singletonList(putTime));
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")", Collections.singletonList(xcx));
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")", Collections.singletonList(zcc));
|
||||
mapList.put("实施日期("+s.getCountry()+")",Arrays.asList(s.getPutTime().split(",")));
|
||||
mapList.put("新车型实施日期("+s.getCountry()+")", Arrays.asList(s.getXcxssrq().split(",")));
|
||||
mapList.put("在产车实施日期("+s.getCountry()+")", Arrays.asList(s.getZccssrq().split(",")));
|
||||
}
|
||||
}
|
||||
|
||||
+53
-30
@@ -11,6 +11,10 @@ import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -39,6 +43,9 @@ import static com.adc.da.login.util.UserUtils.getUserName;
|
||||
@Service
|
||||
public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedListDao, SarLawsDetailedList> implements ISarLawsDetailedListService {
|
||||
|
||||
@Autowired
|
||||
SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
@Autowired
|
||||
public SarLawsDetailedListDao sarLawsDetailedListDao;
|
||||
@Autowired
|
||||
@@ -49,6 +56,8 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
private SarLawsAttrDetailedListServiceImpl service;
|
||||
@Autowired
|
||||
private IDicTypeEOService iDicTypeEOService;
|
||||
@Autowired
|
||||
private ITsUserService iTsUserService;
|
||||
|
||||
@Override
|
||||
public String del(List<String> idList) {
|
||||
@@ -95,7 +104,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就判断页面的值和数据库里的值是否相等
|
||||
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
|
||||
//判断数据库里的数据的车型类别字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()){
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
//相等就不许添加
|
||||
@@ -182,7 +191,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
newListMethod(addDetailedDto);
|
||||
return "车型类别清单添加成功";
|
||||
//添加方法结束
|
||||
} else if (carAddFlag == false){
|
||||
} else if (carAddFlag == false) {
|
||||
//0表示添加成功,1表示添加失败
|
||||
return "车型类别清单添加失败";
|
||||
}
|
||||
@@ -245,14 +254,14 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
if (addDetailedDto.getInforlist() != null) {
|
||||
if (addDetailedDto.getInforlist().contains(",")) {
|
||||
String[] id = addDetailedDto.getInforlist().split(",");
|
||||
String[] putTime = addDetailedDto.getInforlist1().split(",");
|
||||
String[] zcc = addDetailedDto.getInforlist2().split(",");
|
||||
String[] xcx = addDetailedDto.getInforlist3().split(",");
|
||||
String[] putTime = addDetailedDto.getInforlist1().split(";");
|
||||
String[] zcc = addDetailedDto.getInforlist2().split(";");
|
||||
String[] xcx = addDetailedDto.getInforlist3().split(";");
|
||||
for (int a = 0; a < id.length; a++) {
|
||||
TimeDto dto = new TimeDto();
|
||||
dto.setStandId(id[a]);
|
||||
//putTiem即ssrq可能为空 ''
|
||||
if (putTime.length>0){
|
||||
if (putTime.length > 0) {
|
||||
if ("-".equals(putTime[a]) || null == putTime[a]) {
|
||||
dto.setSsrq(null);
|
||||
} else {
|
||||
@@ -293,7 +302,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
@Override
|
||||
public IPage<SarLawsDetailedList> AllSelectD(Integer page, Integer pageSize, String sortKey,
|
||||
String countryArea, String projectName,
|
||||
String detailedList, String detailedListName,String carType) {
|
||||
String detailedList, String detailedListName, String carType) {
|
||||
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
|
||||
if ("1".equals(sortKey)) {
|
||||
wrapper.like(StringUtils.isNotEmpty(countryArea), "country_area", countryArea).
|
||||
@@ -327,7 +336,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length()>0) {
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
@@ -342,6 +351,20 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
@@ -356,8 +379,8 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
//list是数据库里根据id查出来的数据;detailedUpDto是页面传回来的数据
|
||||
SarLawsDetailedList list = sarLawsDetailedListDao.selectById(detailedUpDto.getId());
|
||||
System.out.println("数据库里存的当前数据"+list.getCountryArea());
|
||||
System.out.println("页面现在的数据"+detailedUpDto.getCountryArea());
|
||||
System.out.println("数据库里存的当前数据" + list.getCountryArea());
|
||||
System.out.println("页面现在的数据" + detailedUpDto.getCountryArea());
|
||||
|
||||
//国家/地区清单 多选是否可以添加的标识,true表示可以添加,false表示不许添加
|
||||
boolean multiEditFlag = true;
|
||||
@@ -378,10 +401,9 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就判断页面的值和数据库里的值是否相等
|
||||
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
|
||||
//判断数据库里的数据的车型类别字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()){
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())){
|
||||
} else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())) {
|
||||
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
|
||||
}
|
||||
//相等就不许添加
|
||||
@@ -397,8 +419,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
//就先判断数据库里的数据的国家/地区字段是否为空
|
||||
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) {
|
||||
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加");
|
||||
}
|
||||
else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())){
|
||||
} else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())) {
|
||||
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
|
||||
}
|
||||
//再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增
|
||||
@@ -472,7 +493,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
updateListMethod(detailedUpDto);
|
||||
return "车型类别清单修改成功";
|
||||
//添加方法结束
|
||||
} else if (carEditFlag == false){
|
||||
} else if (carEditFlag == false) {
|
||||
//0表示添加成功,1表示添加失败
|
||||
return "车型类别清单修改失败";
|
||||
}
|
||||
@@ -492,7 +513,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void updateListMethod(DetailedUpDto detailedUpDto) {
|
||||
@@ -550,9 +570,9 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
List<TimeDto> timeDto = new ArrayList<>();
|
||||
if (detailedUpDto.getInforlist().contains(",")) {
|
||||
String[] id = detailedUpDto.getInforlist().split(",");
|
||||
String[] putTime = detailedUpDto.getInforlist1().split(",");
|
||||
String[] zcc = detailedUpDto.getInforlist2().split(",");
|
||||
String[] xcx = detailedUpDto.getInforlist3().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]);
|
||||
@@ -582,6 +602,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
timeDto.add(dto);
|
||||
}
|
||||
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||
|
||||
//更新标准是否纳入认证清单
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,10 +621,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
|
||||
@Override
|
||||
public void standardToLaws(String countryArea,TimeDto timeDto) {
|
||||
public void standardToLaws(String countryArea, TimeDto timeDto) {
|
||||
|
||||
if (countryArea==null){
|
||||
countryArea="";
|
||||
if (countryArea == null) {
|
||||
countryArea = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -612,39 +636,38 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
|
||||
//1.获取标准清单的"国家/地区"
|
||||
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("country_area","id");
|
||||
wrapper.select("country_area", "id");
|
||||
//查询清单中的国家地区和清单id
|
||||
List<SarLawsDetailedList> sarLawsDetailedLists = sarLawsDetailedListDao.selectList(wrapper);
|
||||
//2.判断修改的标准的"国家/地区"与清单中的是否一致,一致则添加到清单中,不一致不作处理
|
||||
String[] split = countryArea.split(","); //拆分标准中的国家地区
|
||||
|
||||
|
||||
|
||||
//遍历清单 对比国家地区
|
||||
for (SarLawsDetailedList lawsDetailed : sarLawsDetailedLists) {
|
||||
if (lawsDetailed.getCountryArea()==null){
|
||||
if (lawsDetailed.getCountryArea() == null) {
|
||||
continue;
|
||||
}
|
||||
String[] sarLawsCounties = lawsDetailed.getCountryArea().split(",");//拆分清单中的国家地区
|
||||
// 对比清单列表中的国家地区,是否一致
|
||||
Arrays.sort(split);
|
||||
Arrays.sort(sarLawsCounties);
|
||||
if ( Arrays.equals(split,sarLawsCounties)){
|
||||
if (Arrays.equals(split, sarLawsCounties)) {
|
||||
|
||||
//一致时插入表并关联detailedListId和standId
|
||||
ArrayList<TimeDto> timeDtos = new ArrayList<>();
|
||||
timeDtos.add(timeDto);
|
||||
|
||||
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("stand_id",timeDto.getStandId());
|
||||
queryWrapper.eq("stand_id", timeDto.getStandId());
|
||||
|
||||
|
||||
//如果目标清单中已存标准在则更新 懒得写更新(⓿_⓿) 直接删掉,再重新插入
|
||||
if (sarLawsAttrDetailedListDao.selectCount(queryWrapper)>0) {
|
||||
if (sarLawsAttrDetailedListDao.selectCount(queryWrapper) > 0) {
|
||||
sarLawsAttrDetailedListDao.delete(queryWrapper);
|
||||
}
|
||||
|
||||
sarLawsAttrDetailedListService.insertDetailedList(lawsDetailed.getId(),timeDtos);
|
||||
sarLawsAttrDetailedListService.insertDetailedList(lawsDetailed.getId(), timeDtos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -194,6 +194,8 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
@GetMapping(value = "/exportStandardsInfoExcel")
|
||||
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
@@ -204,7 +206,7 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
|
||||
response.setContentType("application/force-download");
|
||||
// 导出所有数据
|
||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
// List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||
workbook = LawsStandExportUtil.exportDatas(data);
|
||||
|
||||
os = response.getOutputStream();
|
||||
|
||||
+8
-6
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
@ApiOperation("查询父所有资源")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<List<SarModelTree>> getAll(){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
@ApiOperation("根据父ID查询子所有资源")
|
||||
@GetMapping("/childByList")
|
||||
public ResponseMessage<List<SarModelTree>> childByList(String ids){
|
||||
SarModelTree tree = new SarModelTree();
|
||||
tree.setId(ids);
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
|
||||
public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
|
||||
// List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
|
||||
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -65,4 +65,11 @@ public class SarModelTree extends BaseEntity {
|
||||
@TableField(exist=false)
|
||||
private List<String> childMenuIds;
|
||||
|
||||
@TableField("HAS_CHILDREN")
|
||||
private String hasChildren;
|
||||
|
||||
@TableField(exist = false)
|
||||
private boolean leaf;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,13 @@ public class SarModuleTree {
|
||||
@TableField("CREATIONDATE")
|
||||
private String creationdate;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer level;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String model;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nextCondition;
|
||||
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,15 +1,16 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ISarModuleTreeService {
|
||||
|
||||
List<SarModelTree> getAll(SarModelTree sarModelTree);
|
||||
List<SarModuleTree> getAll(SarModuleTree root);
|
||||
|
||||
List<SarModelTree> recursionGetChildren(SarModelTree parent);
|
||||
List<SarModuleTree> recursionGetChildren(SarModuleTree parent);
|
||||
|
||||
public Head analysisJsonAndStorage(String json);
|
||||
|
||||
|
||||
+36
-5
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -32,6 +34,17 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
// for(SarModelTree tree:list){
|
||||
// tree.setChildren(recursionGetChildren((tree)));
|
||||
// }
|
||||
list.forEach(item->{
|
||||
switch (item.getHasChildren()){
|
||||
case "0":
|
||||
item.setLeaf(true);
|
||||
break;
|
||||
case "1":
|
||||
item.setLeaf(false);
|
||||
break;
|
||||
}
|
||||
item.setId(item.getName());
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -44,11 +57,29 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent){
|
||||
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
|
||||
sarMenuQueryWrapper.orderByAsc("SORT");
|
||||
sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
// sarMenuQueryWrapper.in("PID",parent.getId());
|
||||
sarMenuQueryWrapper.eq("PID",parent.getId());
|
||||
List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
|
||||
for(SarModelTree sarMenu:children){
|
||||
sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
}
|
||||
return children;
|
||||
// for(SarModelTree sarMenu:children){
|
||||
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
|
||||
// }
|
||||
|
||||
List<SarModelTree> collect = children.stream()
|
||||
.filter(item -> !parent.getModel().equals(item.getModel())).collect(Collectors.toList());
|
||||
|
||||
collect.forEach(item-> {
|
||||
switch (item.getHasChildren()) {
|
||||
case "0":
|
||||
item.setLeaf(true);
|
||||
break;
|
||||
case "1":
|
||||
item.setLeaf(false);
|
||||
break;
|
||||
}
|
||||
item.setId(item.getName());
|
||||
});
|
||||
|
||||
|
||||
return collect;
|
||||
}
|
||||
}
|
||||
|
||||
+55
-15
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
/**
|
||||
* @param sarModelTree
|
||||
* @return 所有的根节点
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
|
||||
public List<SarModuleTree> getAll(SarModuleTree root) {
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.groupBy("FTVSTYPE1");
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
treeQueryWrapper.select("FTVSTYPE1")
|
||||
.groupBy("FTVSTYPE1");
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get("FTVSTYPE1").toString());
|
||||
sarModuleTree.setLevel(1);
|
||||
sarModuleTree.setModel(item.get("FTVSTYPE1").toString());
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//返回转换元素后的数组
|
||||
return listTransform(moduleTreeList);
|
||||
return collect;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,20 +58,47 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
|
||||
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.eq("GUID",parent.getId());
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
Integer level =parent.getLevel();
|
||||
|
||||
switch (parent.getLevel()){
|
||||
case 1:
|
||||
level=2;
|
||||
break;
|
||||
case 6:
|
||||
return null;
|
||||
}
|
||||
|
||||
String column="FTVSTYPE"+(level+1);
|
||||
|
||||
treeQueryWrapper.select(column)
|
||||
.eq("FTVSTYPE"+parent.getLevel(),parent.getNextCondition())
|
||||
.groupBy(column);
|
||||
|
||||
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
|
||||
|
||||
Integer finalLevel = level;
|
||||
List<SarModuleTree> collect = moduleTreeList.stream()
|
||||
.map(item -> {
|
||||
SarModuleTree sarModuleTree = new SarModuleTree();
|
||||
sarModuleTree.setNextCondition(item.get(column).toString()); //查询子节点条件
|
||||
sarModuleTree.setLevel(finalLevel + 1);
|
||||
//拼接前端显示名称
|
||||
// switch (finalLevel){
|
||||
// case 3:
|
||||
// sarModuleTree.setModel(item.get(column).toString());//前端显示名称
|
||||
// break;
|
||||
// case
|
||||
// }
|
||||
|
||||
|
||||
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
|
||||
collect.forEach((k, v)->{
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
//TODO 生成树型结构
|
||||
// modelTree
|
||||
});
|
||||
return null;
|
||||
return sarModuleTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-2
@@ -184,7 +184,12 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
|
||||
for(TsResource resource:TsResources){
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
// TsResourceQueryWrapper.like("PARENT_IDS",resource.getId());
|
||||
/**
|
||||
* 没有把改节点查出
|
||||
*/
|
||||
TsResourceQueryWrapper.isNotNull("PARENT_ID");
|
||||
|
||||
if(StringUtils.isNotBlank(tsResource.getSorDivide())){
|
||||
TsResourceQueryWrapper.in("ID",getMenuIdList);
|
||||
}
|
||||
@@ -323,7 +328,9 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
* @return List<TsResource>
|
||||
*/
|
||||
private List<TsResource> recursionGetListChildrenStand(TsResource resource,List<TsResource> children){
|
||||
List<TsResource> tsResources = children.stream().filter(resource1 -> resource1.getParentId().equals(resource.getId())).collect(Collectors.toList());
|
||||
List<TsResource> tsResources = children.stream()
|
||||
.filter(resource1 -> resource1.getParentId().equals(resource.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(!tsResources.isEmpty()){
|
||||
tsResources = tsResources.stream().sorted(Comparator.comparing(resource1 -> resource1.getDisplaySeq())).collect(Collectors.toList());
|
||||
tsResources.forEach(resource1 -> {
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface TsRoleDao extends BaseMapper<TsRole> {
|
||||
* @param menuId:权限ID
|
||||
*/
|
||||
@Insert("insert into ts_role_menu (role_id,menu_id) values (#{roleId},#{menuId})")
|
||||
void addMenu(String roleId, String menuId);
|
||||
void addMenu(@Param("roleId") String roleId, @Param("menuId") String menuId);
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
|
||||
+13
@@ -161,4 +161,17 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
|
||||
public ResponseMessage<List<SelectionResult>> selectFileFieldForSel1(){
|
||||
return Result.success(sarStandAttrDetailsEOService.selectFileFieldForSel1(null));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarStandAttrDetailsEO|查询标准中所有文件类型")
|
||||
@GetMapping("/getListData")
|
||||
// @RequiresPermissions("lawss:sarStandAttrDetails:get")
|
||||
public ResponseMessage<List<SarStandAttrDetails>> getListData(){
|
||||
QueryWrapper<SarStandAttrDetails> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("ATTR_TYPE","file");
|
||||
List<SarStandAttrDetails> sarStandAttrDetails=sarStandAttrDetailsEOService.list(queryWrapper);
|
||||
return Result.success(sarStandAttrDetails);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class listDTO {
|
||||
|
||||
private String key;
|
||||
|
||||
private String value;
|
||||
|
||||
}
|
||||
+56
-22
@@ -15,18 +15,17 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -77,6 +76,14 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加意见")
|
||||
@PostMapping("/saveBatch")
|
||||
public ResponseMessage saveBatch(@RequestBody List<SarPublicIdeaAll> sar){
|
||||
boolean flag=sarPublicIdeaAllImpl.saveBatch(sar);
|
||||
return Result.success("200",flag);
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除意见")
|
||||
@GetMapping("/deleteStand")
|
||||
public ResponseMessage deleteStand(DelStandDto delStandDto){
|
||||
@@ -94,30 +101,50 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
|
||||
@ApiOperation(value = "导出全部意见")
|
||||
@GetMapping("/tuallStand")
|
||||
public void getAllStand(HttpServletResponse response,String cid){
|
||||
public void getAllStand(HttpServletResponse response,@RequestParam(value = "cid")String cid,@RequestParam(value = "type",required = false)String type){
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("意见详情", "UTF-8").replaceAll("\\+", "%20");
|
||||
String textName="";
|
||||
if ("1".equals(type)){
|
||||
textName= "流程意见详情";
|
||||
}else {
|
||||
textName="意见详情";
|
||||
}
|
||||
Map<String,String> map=new HashMap<>();
|
||||
map.put("1","上报");
|
||||
map.put("2","处理后上报");
|
||||
String fileName = URLEncoder.encode(textName, "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
List<SarPublicIdeaAll> data=new ArrayList<>();
|
||||
if (!StringUtils.isEmpty(cid)){
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(SarPublicIdeaAll.CID,cid);
|
||||
wrapper.orderByAsc("part_code");
|
||||
data=sarPublicIdeaAllDao.selectList(wrapper);
|
||||
data=sarPublicIdeaAllDao.getPublicAllIdea(cid,type);
|
||||
}
|
||||
List<GetExcelDto> standExcel=new ArrayList<>();
|
||||
List<GetExcelDto2> standExcel2=new ArrayList<>();
|
||||
for (SarPublicIdeaAll sarPublicIdeaAll:data){
|
||||
GetExcelDto getExcelDto=GetExcelDto.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.build();
|
||||
standExcel.add(getExcelDto);
|
||||
if ("1".equals(type)) {
|
||||
GetExcelDto2 getExcelDto = GetExcelDto2.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.state(map.get(sarPublicIdeaAll.getState()))
|
||||
.build();
|
||||
standExcel2.add(getExcelDto);
|
||||
}else {
|
||||
GetExcelDto getExcelDto = GetExcelDto.builder()
|
||||
.partCode(sarPublicIdeaAll.getPartCode())
|
||||
.oldText(sarPublicIdeaAll.getOldText())
|
||||
.newText(sarPublicIdeaAll.getNewText())
|
||||
.reason(sarPublicIdeaAll.getReason())
|
||||
.userName(sarPublicIdeaAll.getUserName())
|
||||
.deptName(sarPublicIdeaAll.getDeptName())
|
||||
.build();
|
||||
standExcel.add(getExcelDto);
|
||||
}
|
||||
}
|
||||
|
||||
List<List<String>> headList=new ArrayList<List<String>>();
|
||||
@@ -127,9 +154,16 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
|
||||
headList.add(Lists.newArrayList("修改意见内容(包括理由或依据)","修改理由"));
|
||||
headList.add(Lists.newArrayList("提出部门"));
|
||||
headList.add(Lists.newArrayList("提出人"));
|
||||
|
||||
EasyExcel.write(response.getOutputStream(),GetExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel);
|
||||
if ("1".equals(type)){
|
||||
headList.add(Lists.newArrayList("处理意见"));
|
||||
}
|
||||
if ("1".equals(type)) {
|
||||
EasyExcel.write(response.getOutputStream(), GetExcelDto2.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel2);
|
||||
}else {
|
||||
EasyExcel.write(response.getOutputStream(), GetExcelDto.class).head(headList).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(standExcel);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandIdea.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -21,4 +22,10 @@ import java.util.List;
|
||||
public interface SarPublicIdeaAllDao extends BaseMapper<SarPublicIdeaAll> {
|
||||
|
||||
List<SarPublicIdeaAll> getPublicIdea(@Param("unique")String unique);
|
||||
|
||||
List<SarPublicIdeaAll> getAllDataByIdea(@Param("page")Integer page,@Param("size")Integer size, @Param("ideaId")String ideaId);
|
||||
|
||||
Integer getAllDataByIdeaCount( @Param("ideaId")String ideaId);
|
||||
|
||||
List<SarPublicIdeaAll> getPublicAllIdea(@Param("cid") String cid,@Param("type")String type);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.sarStandIdea.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* //用于导出
|
||||
*
|
||||
* @author ZhangZhiYuan
|
||||
* @date 2021-07-14
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(15)
|
||||
public class GetExcelDto2 {
|
||||
|
||||
// @ExcelProperty("章节编号")
|
||||
private String partCode;
|
||||
// @ExcelProperty("修改意见内容(包括理由或依据)")
|
||||
// private String content;
|
||||
private String oldText;
|
||||
|
||||
private String newText;
|
||||
|
||||
private String reason;
|
||||
// @ExcelProperty("提出部门")
|
||||
private String deptName;
|
||||
// @ExcelProperty("提出人")
|
||||
private String userName;
|
||||
|
||||
private String state;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -72,5 +72,8 @@ public class SarPublicIdea extends BaseEntity {
|
||||
@TableField("files_name")
|
||||
private String filesName;
|
||||
|
||||
@TableField("wkfiles")
|
||||
private String wkfiles;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,4 +63,16 @@ public class SarPublicIdeaAll extends BaseEntity {
|
||||
|
||||
public static final String CID = "cid";
|
||||
|
||||
@TableField("chapter_name")
|
||||
private String chapterName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String department;
|
||||
|
||||
@TableField("wk_flag")
|
||||
private String wkFlag;
|
||||
|
||||
@TableField("state")
|
||||
private String state;
|
||||
|
||||
}
|
||||
|
||||
+7
-4
@@ -48,10 +48,13 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("idea_id", detAllStandDto.getIdeaId());
|
||||
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(), detAllStandDto.getSize());
|
||||
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
|
||||
List<SarPublicIdeaAll> sarPublicIdeaAlls=sarPublicIdeaAllDao.getAllDataByIdea(detAllStandDto.getPage(),detAllStandDto.getSize(),detAllStandDto.getIdeaId());
|
||||
Integer a=sarPublicIdeaAllDao.getAllDataByIdeaCount(detAllStandDto.getIdeaId());
|
||||
Page userIPage=new Page();
|
||||
userIPage.setTotal(a);
|
||||
userIPage.setRecords(sarPublicIdeaAlls);
|
||||
userIPage.setSize(detAllStandDto.getSize());
|
||||
userIPage.setCurrent(detAllStandDto.getPage());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
List<SarPublicIdeaAll> list = userIPage.getRecords();
|
||||
|
||||
+25
-1
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -53,6 +53,30 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目评估流程分解单查询")
|
||||
@GetMapping("/workflowFindItems")
|
||||
public ResponseMessage workflowFindItems( @RequestParam("ids") String ids,@RequestParam("types") String types){
|
||||
List<String> id=new ArrayList<>(Arrays.asList(ids.split(",")));
|
||||
List<String> type=new ArrayList<>(Arrays.asList(types.split(",")));
|
||||
Map<String,String> map=new HashMap<>();
|
||||
int i =0 ;
|
||||
for (String s:type) {
|
||||
if (null!=map.get(s)){
|
||||
map.put(s,map.get(s)+","+id.get(i));
|
||||
}else {
|
||||
map.put(s,id.get(i));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
List<SarStandItemsDto> ItemDto = new ArrayList<>();
|
||||
map.entrySet().forEach(stringStringEntry -> {
|
||||
if (!"BDR".equals(stringStringEntry.getKey())){
|
||||
ItemDto.addAll(ServiceImpl.findAllItems(stringStringEntry.getKey(),stringStringEntry.getValue().split(",")));
|
||||
}
|
||||
});
|
||||
return Result.success("200",ItemDto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分解单查询")
|
||||
@GetMapping("/querySarItemAndInterpretation")
|
||||
public ResponseMessage querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ public class FindSarItemsPageReqDTO extends BasePage {
|
||||
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date XCXSSRQ;
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date ZCCSSRQ;
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
private String fileType;
|
||||
|
||||
@@ -125,12 +125,12 @@ public class SarStandItems extends BaseEntity {
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("XCXSSRQ")
|
||||
private Date xccssrq;
|
||||
private String xccssrq;
|
||||
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("ZCCSSRQ")
|
||||
private Date zccssrq;
|
||||
private String zccssrq;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "符合性要求-符合性状态")
|
||||
|
||||
+17
-28
@@ -154,25 +154,9 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
page.setPage(findStandDto.getPage());
|
||||
page.setPageSize(findStandDto.getSize());
|
||||
page.setUserId(null);
|
||||
List<SarStandardsInfo> pageInfo = null;
|
||||
try {
|
||||
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
List<String> standId = new ArrayList<>();
|
||||
for (SarStandardsInfo standardsInfo : pageInfo){
|
||||
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
|
||||
standId.add(standardsInfo.getId());
|
||||
}
|
||||
}
|
||||
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
|
||||
|
||||
List<LawsDto> list=new ArrayList<>();
|
||||
if (standId==null || standId.size()==0){
|
||||
list = null;
|
||||
}else {
|
||||
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
|
||||
}
|
||||
IPage<LawsDto> page1=new Page<>();
|
||||
page1.setRecords(list);
|
||||
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
|
||||
@@ -195,6 +179,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
|
||||
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
|
||||
List<SarStandItemsDto> res=new ArrayList<>();
|
||||
List<SarStandItemsDto> chinese=new ArrayList<>();
|
||||
if (null == list || list.isEmpty()){
|
||||
return list;
|
||||
}else {
|
||||
@@ -206,20 +191,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
if (a>0){
|
||||
mark=mark.substring(0,a);
|
||||
}
|
||||
if (null != map.get(Integer.valueOf(mark))){
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
}else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle=new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark),middle);
|
||||
}
|
||||
try {
|
||||
if (null != map.get(Integer.valueOf(mark))) {
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
} else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle = new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark), middle);
|
||||
}
|
||||
}catch (Exception e){
|
||||
chinese.add(sarStandItemsDto);
|
||||
}
|
||||
});
|
||||
Collections.sort(integerList);
|
||||
integerList.forEach(integer -> {
|
||||
res.addAll(map.get(integer));
|
||||
});
|
||||
|
||||
res.addAll(chinese);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -231,7 +220,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
|
||||
switch (page.getOrderBy()){
|
||||
case "itemsNum" : page.setOrderBy("ITEMS_NUM"); break;
|
||||
default:page.setOrderBy("ITEMS_NUM"); page.setOrder("DESC");
|
||||
default:page.setOrderBy("ITEMS_NUM"); page.setOrder("ASC");
|
||||
}
|
||||
|
||||
switch (page.getOrder()){
|
||||
@@ -240,7 +229,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
}
|
||||
}else {
|
||||
page.setOrderBy("ITEMS_NUM");
|
||||
page.setOrder("DESC");
|
||||
page.setOrder("ASC");
|
||||
}
|
||||
|
||||
//分页查询的总数
|
||||
|
||||
+68
@@ -8,6 +8,7 @@ import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -122,6 +123,36 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
pageres.setSize(list1.getSize());
|
||||
return Result.success("200",pageres);
|
||||
}
|
||||
|
||||
@GetMapping("/queryProjectUnderLine")
|
||||
@ApiOperation("查询产品线项目经理")
|
||||
public ResponseMessage queryProjectUnderLine(@RequestParam(defaultValue = "1", value = "current")int current,
|
||||
@RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
|
||||
standDTO standDTO){
|
||||
List<String> strings=new ArrayList<>();
|
||||
if (!standDTO.getProductLine().isEmpty()){
|
||||
if (standDTO.getProductLine().contains(",")){
|
||||
strings.addAll(new ArrayList<>(Arrays.asList(standDTO.getProductLine().split(","))));
|
||||
}else {
|
||||
strings.add(standDTO.getProductLine());
|
||||
}
|
||||
}
|
||||
Page page=new Page();
|
||||
page.setCurrent(current);
|
||||
page.setSize(pageSize);
|
||||
QueryWrapper<SarStandProjectLibrary> queryWrapper=new QueryWrapper<>();
|
||||
if (null!=standDTO.getProjectNumber()) {
|
||||
queryWrapper.like("project_number", standDTO.getProjectNumber());
|
||||
}
|
||||
if (null!=standDTO.getProjectName()) {
|
||||
queryWrapper.like("project_name", standDTO.getProjectName());
|
||||
}
|
||||
queryWrapper.in("product_line",strings);
|
||||
queryWrapper.orderByAsc("product_line");
|
||||
// 创建一个新的list集合,用于存储去重后的元素
|
||||
IPage<SarStandProjectLibrary> pageres=sarStandProjectLibraryService.page(page,queryWrapper);
|
||||
return Result.success("200",pageres);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
@@ -144,6 +175,29 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfo(current,pageSize,id,cars);
|
||||
return Result.success("200",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @param id
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@GetMapping("/queryStandInfoNew")
|
||||
@ApiOperation("查询标准信息")
|
||||
public ResponseMessage queryStandInfoNew(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
|
||||
String id,String cars){
|
||||
// List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryStandId(id);
|
||||
// List<String> list1 = new ArrayList();
|
||||
// for(SarStandProjectLibrary s:list){
|
||||
// list1.add(s.getStandId());
|
||||
// }
|
||||
// System.out.println(list1);
|
||||
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfoNew(current,pageSize,id,cars);
|
||||
return Result.success("200",list);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
@@ -192,6 +246,20 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
sarStandProjectLibraryService.batchInsert(list);
|
||||
return Result.success("200","新增成功",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@PostMapping("/batchInsertAdd")
|
||||
@ApiOperation("调取标准")
|
||||
public ResponseMessage batchInsertAdd(@RequestBody List<StandProjectRelationDto> list){
|
||||
sarStandProjectLibraryService.batchInsertAdd(list);
|
||||
return Result.success("200","新增成功",list);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param standAttrInfoExcelDto
|
||||
|
||||
+2
@@ -29,6 +29,8 @@ public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLib
|
||||
List<String> getAllStands();
|
||||
List<String> getAllStand();
|
||||
List<SarStandProjectLibrary> updateByProjectId(@Param("id")String id, @Param("version")String version);
|
||||
List<SarStandProjectLibrary> updateByProjectIdBath(@Param("id")List<String> id, @Param("version")String version);
|
||||
void deleteByProjectId(@Param("projectId")String projectId);
|
||||
|
||||
List<String> selectListByids(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -8,4 +8,8 @@ public class standDTO {
|
||||
private String uname;
|
||||
|
||||
private String productLine;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String projectNumber;
|
||||
}
|
||||
|
||||
+19
-12
@@ -4,8 +4,11 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* //TODO 添加类/接口功能描述
|
||||
@@ -47,16 +50,20 @@ public class StandAttrInfoDto {
|
||||
//责任部门
|
||||
@ExcelProperty("责任部门")
|
||||
private String ZRBM;
|
||||
//关联模块--卡车VPPS编码
|
||||
@ExcelProperty("关联模块--卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
//关联模块--卡车vpps中文名称
|
||||
@ExcelProperty("关联模块--卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
//关联模块--乘用车VPPS编码
|
||||
@ExcelProperty("关联模块--乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
//关联模块--乘用车vpps中文名称
|
||||
@ExcelProperty("关联模块--乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
// //关联模块--卡车VPPS编码
|
||||
// @ExcelProperty("关联模块--卡车VPPS编码")
|
||||
// private String KCCVPPSBM;
|
||||
// //关联模块--卡车vpps中文名称
|
||||
// @ExcelProperty("关联模块--卡车vpps中文名称")
|
||||
// private String KCCVPPSCN;
|
||||
// //关联模块--乘用车VPPS编码
|
||||
// @ExcelProperty("关联模块--乘用车VPPS编码")
|
||||
// private String CYCVPPSBM;
|
||||
// //关联模块--乘用车vpps中文名称
|
||||
// @ExcelProperty("关联模块--乘用车vpps中文名称")
|
||||
// private String CYCVPPSCN;
|
||||
|
||||
private Long unCount;
|
||||
|
||||
private String endTimes;
|
||||
}
|
||||
+3
@@ -22,8 +22,11 @@ public interface SarStandProjectLibraryService {
|
||||
List<SarStandProjectLibrary> queryByProductLine(String productLine);
|
||||
List<SarStandProjectLibrary> queryStandId(String standId);
|
||||
IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId, String cars);
|
||||
|
||||
IPage<StandAttrInfoDto> queryStandInfoNew(int current, int pageSize, String standId, String cars);
|
||||
void deleteByIds(List<StandProjectRelationDto> ids);
|
||||
void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
|
||||
void batchInsertAdd(@Param("ids") List<StandProjectRelationDto> list);
|
||||
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
|
||||
public Head AnalysisJsonAndStorage(String jsonStr);
|
||||
|
||||
|
||||
+93
-13
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -351,13 +352,76 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
for (SarStandAttrInfo a:list2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
// p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
// p.setCYCVPPSCN(a.getCycvppscn());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQ(a.getXcxssrq());
|
||||
p.setZCCSSRQ(a.getZccssrq());
|
||||
// p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
// p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
list.add(p);
|
||||
}
|
||||
IPage<StandAttrInfoDto> userIPage = new Page<>();
|
||||
userIPage.setRecords(list);
|
||||
userIPage.setTotal(userIPage1.getTotal());
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StandAttrInfoDto> queryStandInfoNew(int current, int pageSize, String standId, String cars) {
|
||||
|
||||
//cars传回值为1时判断是从车型项目库中调取
|
||||
|
||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME","STAND_TYPE","(select count(*) from sar_stand_unqualified" +
|
||||
" where STAND_ID = r.stand_id and CLOSE_STATE = '1' ) as unCount ","(select count(*) from sar_stand_unqualified" +
|
||||
" where STAND_ID = r.stand_id and CLOSE_STATE = '2' ) as counts ",
|
||||
"(select GROUP_CONCAT( DISTINCT DATE_FORMAT( PLAN_CLOSE_TIME, '%Y-%m-%d' ) ORDER BY PLAN_CLOSE_TIME ) from sar_stand_unqualified where " +
|
||||
" STAND_ID = r.stand_id and CLOSE_STATE = '1' AND PLAN_CLOSE_TIME is NOT NULL ) as endTimes ");
|
||||
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='" + standId + "'");
|
||||
Page<SarStandardsInfo> page1 = new Page<>(current, pageSize);
|
||||
IPage<SarStandardsInfo> userIPage1 = SarStandardsInfoDao.selectPage(page1, wrapper1);
|
||||
System.out.println("总条数"+userIPage1.getTotal());
|
||||
System.out.println("总页数"+userIPage1.getPages());
|
||||
|
||||
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
|
||||
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQ","ZCCSSRQ","ZRBM","KCCVPPSBM","KCCVPPSCN","CYCVPPSBM","CYCVPPSCN");
|
||||
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID WHERE r.project_id ='"+ standId+"'");
|
||||
|
||||
Page<SarStandAttrInfo> page2 = new Page<>(current, pageSize);
|
||||
IPage<SarStandAttrInfo> userIPage2 = sarStandAttrInfoDao.selectPage(page2, wrapper2);
|
||||
System.out.println("总条数"+userIPage2.getTotal());
|
||||
System.out.println("总页数"+userIPage2.getPages());
|
||||
List<StandAttrInfoDto> list = new ArrayList<>();
|
||||
List<SarStandardsInfo> list1 = userIPage1.getRecords();
|
||||
List<SarStandAttrInfo> list2 = userIPage2.getRecords();
|
||||
for(SarStandardsInfo s:list1){
|
||||
StandAttrInfoDto p =new StandAttrInfoDto();
|
||||
p.setStandId(s.getId());
|
||||
p.setStandNumber(s.getStandNumber());
|
||||
p.setStandSort(s.getStandSort());
|
||||
p.setStandYear(s.getStandYear());
|
||||
p.setStandName(s.getStandName());
|
||||
p.setStandType(s.getStandType());
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
if (s.getUnCount()==0L && s.getCounts()>0L) {
|
||||
p.setUnCount(s.getUnCount());
|
||||
}else if (s.getUnCount() == 0L && s.getCounts()==0L){
|
||||
p.setUnCount(2L);
|
||||
}else {
|
||||
p.setUnCount(1L);
|
||||
}
|
||||
p.setEndTimes(s.getEndTimes());
|
||||
for (SarStandAttrInfo a:list2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQ(a.getXcxssrq());
|
||||
p.setZCCSSRQ(a.getZccssrq());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
@@ -385,6 +449,26 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchInsertAdd(List<StandProjectRelationDto> list) {
|
||||
List<String> ids=new ArrayList<>();
|
||||
List<String> projectIds=new ArrayList<>();
|
||||
list.forEach(standProjectRelationDto -> {
|
||||
if (!ids.contains(standProjectRelationDto.getStandId())) {
|
||||
ids.add(standProjectRelationDto.getStandId());
|
||||
}});
|
||||
List<String> standProjectRelationDtos=sarStandProjectLibraryDao.selectListByids(ids);
|
||||
List<StandProjectRelationDto> ins=new ArrayList<>();
|
||||
list.forEach(standProjectRelationDto -> {
|
||||
if (!standProjectRelationDtos.contains(standProjectRelationDto.getProjectId())){
|
||||
ins.add(standProjectRelationDto);
|
||||
projectIds.add(standProjectRelationDto.getProjectId());
|
||||
}
|
||||
});
|
||||
sarStandProjectLibraryDao.batchInsert(ins);
|
||||
sarStandProjectLibraryDao.updateByProjectIdBath(projectIds, TimeVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto ,String id) {
|
||||
List<String> ids = standAttrInfoExcelDto.getIds();
|
||||
@@ -392,7 +476,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
String idmis=String.join(",",ids);
|
||||
System.out.println(idmis);
|
||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.select("ID","STAND_NUMBER","STAND_NAME","STAND_EN_NAME");
|
||||
wrapper1.select("ID","STAND_NUMBER","STAND_NAME","STAND_EN_NAME","STAND_TYPE","STAND_YEAR","STAND_SORT");
|
||||
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.stand_id in ("+ idmis +") and r.project_id = '"+ id+"'");
|
||||
List<SarStandardsInfo> userList1 = SarStandardsInfoDao.selectList(wrapper1);
|
||||
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
|
||||
@@ -428,24 +512,20 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
}
|
||||
for(SarStandardsInfo s:userList1){
|
||||
StandAttrInfoDto p =new StandAttrInfoDto();
|
||||
p.setStandNumber(s.getStandNumber());
|
||||
p.setStandNumber(s.getStandSort()+" "+s.getStandNumber()+"-"+s.getStandYear());
|
||||
p.setStandName(s.getStandName());
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
for (SarStandAttrInfo a:userList2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
if (a.getSsrq()!=null){
|
||||
p.setSSRQ(a.getSsrq().substring(0,10));
|
||||
p.setSSRQ(a.getSsrq());
|
||||
}
|
||||
if (a.getXcxssrq()!=null){
|
||||
p.setXCXSSRQ(a.getXcxssrq().substring(0,10));
|
||||
p.setXCXSSRQ(a.getXcxssrq());
|
||||
}
|
||||
if (a.getZccssrq()!=null){
|
||||
p.setZCCSSRQ(a.getZccssrq().substring(0,10));
|
||||
p.setZCCSSRQ(a.getZccssrq());
|
||||
}
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
|
||||
+34
@@ -56,6 +56,40 @@ public class SarStandUnqualifiedController extends BaseController<SarStandUnqual
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("未符合项整改新增")
|
||||
@PostMapping("/addOne")
|
||||
public ResponseMessage<Object> add(@RequestBody SarStandUnqualified sarStandUnqualified){
|
||||
sarStandUnqualified.setCreateTime(new Date());
|
||||
if (sarStandUnqualifiedService.save(sarStandUnqualified)) {
|
||||
return Result.success("新增成功");
|
||||
}
|
||||
else{
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("未符合项整改修改")
|
||||
@PostMapping("/updateOne")
|
||||
public ResponseMessage<Object> update(@RequestBody SarStandUnqualified sarStandUnqualified){
|
||||
if (sarStandUnqualifiedService.updateById(sarStandUnqualified)) {
|
||||
return Result.success("新增成功");
|
||||
}
|
||||
else{
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("未符合项整改修改")
|
||||
@PostMapping("/updateBatch")
|
||||
public ResponseMessage<Object> updateBatch(@RequestBody List<SarStandUnqualified> sarStandUnqualified){
|
||||
if (sarStandUnqualifiedService.saveOrUpdateBatch(sarStandUnqualified)) {
|
||||
return Result.success("新增成功");
|
||||
}
|
||||
else{
|
||||
return Result.error("新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询未符合项
|
||||
* @param sarStandUnqualifiedPage:筛选、分页信息
|
||||
|
||||
+1
@@ -71,6 +71,7 @@ public class BusinessDeptIssue {
|
||||
|
||||
@ExcelIgnore
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
@TableField("del_flag")
|
||||
private String delFlag;
|
||||
|
||||
@ExcelProperty("责任部门")
|
||||
|
||||
+1
@@ -59,6 +59,7 @@ public class ProductDeptIssue {
|
||||
private String responseDept;
|
||||
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
@TableField("del_flag")
|
||||
private String delFlag;
|
||||
|
||||
@TableField("is_close")
|
||||
|
||||
+13
-1
@@ -51,6 +51,10 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("STAND_NAME")
|
||||
private String standName;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "项目编号")
|
||||
@TableField("product_id")
|
||||
private String productId;
|
||||
// @ExcelProperty("标准编号")
|
||||
// @ApiModelProperty(value = "标准编号")
|
||||
// @TableField("STAND_NUMBER")
|
||||
@@ -143,13 +147,21 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("DUTY_ENGINEER")
|
||||
private String dutyEngineer;
|
||||
|
||||
@ExcelProperty("计划关闭时间")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "计划关闭时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("PLAN_CLOSE_TIME")
|
||||
private Date planCloseTime;
|
||||
|
||||
|
||||
@ExcelProperty("计划关闭时间")
|
||||
@ApiModelProperty(value = "计划关闭时间excel导出")
|
||||
|
||||
@TableField(exist = false)
|
||||
private String planCloseTimeExport;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(type = IdType.UUID)
|
||||
|
||||
+14
-21
@@ -18,6 +18,8 @@ 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.*;
|
||||
|
||||
/**
|
||||
@@ -54,7 +56,6 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
List<SarStandardsInfo> list1 = userIPage1.getRecords();
|
||||
|
||||
QueryWrapper<SarStandUnqualified> wrapper = new QueryWrapper<>();
|
||||
// wrapper1.like("stand_number",null);
|
||||
wrapper.select("STAND_SERIAL_NUMBER");
|
||||
Page<SarStandUnqualified> page = new Page<>();
|
||||
IPage<SarStandUnqualified> userIPage = sarStandUnqualifiedDao.selectPage(page,wrapper);
|
||||
@@ -66,26 +67,6 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
}
|
||||
}
|
||||
|
||||
// QueryWrapper<SarStandUnqualified> sarStandUnqualifiedQueryWrapper=new QueryWrapper<>();
|
||||
// if(sarStandUnqualifiedPage.getStandId()!=null){
|
||||
// sarStandUnqualifiedQueryWrapper.eq("stand_id",sarStandUnqualifiedPage.getStandId());
|
||||
// }
|
||||
// //仅查询未关闭的
|
||||
// sarStandUnqualifiedQueryWrapper.eq("close_state",1);
|
||||
// //根据 项目名称 进行查询
|
||||
// if(sarStandUnqualifiedPage.getProductName()!=null){
|
||||
// sarStandUnqualifiedQueryWrapper.like("product_name",sarStandUnqualifiedPage.getProductName());
|
||||
// }
|
||||
// //根据 责任部门 进行查询
|
||||
// if(sarStandUnqualifiedPage.getResponsibleUnit()!=null){
|
||||
// sarStandUnqualifiedQueryWrapper.eq("responsible_unit",sarStandUnqualifiedPage.getResponsibleUnit());
|
||||
// }
|
||||
// //根据 标准号/标准名称 进行查询
|
||||
// if(sarStandUnqualifiedPage.getStandSerialNumber()!=null){
|
||||
//// sarStandUnqualifiedQueryWrapper.like("stand_serial_number",sarStandUnqualifiedPage.getStandSerialNumber()).or().like("stand_name",sarStandUnqualifiedPage.getStandName());
|
||||
// sarStandUnqualifiedQueryWrapper.last(" and (stand_serial_number LIKE '%"+sarStandUnqualifiedPage.getStandSerialNumber()+"%'\n" +
|
||||
// "\t\tOR stand_name LIKE '%"+sarStandUnqualifiedPage.getStandSerialNumber()+"%')");
|
||||
// }
|
||||
Page<SarStandUnqualified> standUnqualifiedPage=new Page<>();
|
||||
//判断前端是否提供页码和每页条数
|
||||
List<SarStandUnqualified> sarStandUnqualifieds=sarStandUnqualifiedDao.getSarStandUnqualifiedPage((sarStandUnqualifiedPage.getCurrent()-1)*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage.getCurrent()*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage);
|
||||
@@ -165,6 +146,18 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
sarStandUnqualifiedQueryWrapper.in("id",standUnqualifiedExcelVO.getIds());
|
||||
}
|
||||
List<SarStandUnqualified> stand = sarStandUnqualifiedDao.selectList(sarStandUnqualifiedQueryWrapper);
|
||||
// 去掉日期时分秒
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
stand.forEach(item->{
|
||||
|
||||
Optional.ofNullable(item.getPlanCloseTime())
|
||||
.ifPresent(time ->{
|
||||
item.setPlanCloseTimeExport(sdf.format(time));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
List<SarStandUnqualified> a = stand;
|
||||
return a;
|
||||
}
|
||||
|
||||
+68
-6
@@ -4,9 +4,16 @@ package com.adc.da.slrs.sarStandWarning.controller;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.SarStandIssueControlProduct;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProductExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -16,10 +23,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/sys/EarlyWarning")
|
||||
@@ -41,7 +47,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
* @author zj
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/StandWarning")
|
||||
@GetMapping("/${restPath}/StandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
|
||||
@RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
|
||||
@@ -53,6 +59,26 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
|
||||
return getResponseMessage(list1, list2, list3, list4);
|
||||
}
|
||||
|
||||
@GetMapping("/getStandWarning")
|
||||
@ApiOperation("标准预警查询")
|
||||
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
|
||||
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
|
||||
standWarning.getRecords().forEach(item->{
|
||||
|
||||
Optional.ofNullable(item.getSSRQ())
|
||||
.ifPresent(SSRQ -> item.setSSRQ(item.getSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
Optional.ofNullable(item.getXCXSSRQ())
|
||||
.ifPresent(SSRQ ->item.setXCXSSRQ(item.getXCXSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
Optional.ofNullable(item.getZCCSSRQ())
|
||||
.ifPresent(SSRQ ->item.setZCCSSRQ(item.getZCCSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
|
||||
|
||||
});
|
||||
return Result.success(standWarning);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
|
||||
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
@@ -71,7 +97,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
* date 2021-06-15
|
||||
**/
|
||||
@GetMapping("/ChangePermissions")
|
||||
@ApiOperation("更改权限")
|
||||
@ApiOperation("取消预警")
|
||||
public ResponseMessage ChangePermissions(String id) {
|
||||
String power = earlyWarningEOService.ChangePermissions(id);
|
||||
return Result.success("200",power);
|
||||
@@ -102,4 +128,40 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
return Result.success("200",listMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/exportWarning")
|
||||
@ApiOperation("导出预警")
|
||||
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
||||
|
||||
|
||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
if(excelVO.getExportName()==null){
|
||||
excelVO.setExportName("标准预警");
|
||||
}
|
||||
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
List<WarningExportVO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
|
||||
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), WarningExportVO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(exportExcel);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
// 重置response
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,19 @@ package com.adc.da.slrs.sarStandWarning.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||
|
||||
|
||||
List<WarningExportVO> exportWarning(@Param("idList") List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandWarning.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface WarningDateDao extends BaseMapper<WarningDate> {
|
||||
}
|
||||
+52
-10
@@ -1,10 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.Tag;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -23,54 +28,91 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("id")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@TableField("STAND_TYPE")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("分解单条款id")
|
||||
@TableField("ITEM_ID")
|
||||
private String itemId;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("标准类别")
|
||||
@TableField(exist = false)
|
||||
private String standType;
|
||||
|
||||
@TableField("STAND_CODE")
|
||||
@ExcelProperty(value = "标准编号",index = 1)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("标准号")
|
||||
@TableField(exist = false)
|
||||
private String standCode;
|
||||
|
||||
@TableField("STAND_NAME")
|
||||
@ExcelProperty(value = "标准名称",index = 2)
|
||||
@ColumnWidth(40)
|
||||
@ApiModelProperty("标准名称")
|
||||
@TableField(exist = false)
|
||||
private String standName;
|
||||
|
||||
@TableField("PUT_TIME")
|
||||
@ExcelProperty(value = "发布日期",index = 5)
|
||||
@ApiModelProperty("发布日期")
|
||||
@TableField(exist = false)
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField(exist = false)
|
||||
private Date lastTime;
|
||||
|
||||
@TableField("APPLY_TYPE")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("适用车型")
|
||||
@TableField(exist = false)
|
||||
private String applyType;
|
||||
|
||||
@TableField("DUTY_ENGINEER")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("责任工程师")
|
||||
@TableField(exist = false)
|
||||
private String dutyEngineer;
|
||||
|
||||
@TableField("ITEMS_ID")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("条款(分解单)id")
|
||||
@TableField(exist = false)
|
||||
private String itemsId;
|
||||
|
||||
@TableField("ITEMS_NUM")
|
||||
@ExcelProperty(value = "条款编号",index = 3)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("条款(分解单)编号")
|
||||
@TableField(exist = false)
|
||||
private String itemsNum;
|
||||
|
||||
@TableField("ITEMS_NAME")
|
||||
@ExcelProperty(value = "条款名称",index = 4)
|
||||
@ColumnWidth(40)
|
||||
@ApiModelProperty("条款(分解单)名称")
|
||||
@TableField(exist = false)
|
||||
private String itemsName;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("POLICY_ID")
|
||||
private String policyId;
|
||||
|
||||
@TableField("POLICY_NAME")
|
||||
@ExcelIgnore
|
||||
@TableField(exist = false)
|
||||
private String policyName;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("MARK")
|
||||
private String mark;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("POWER")
|
||||
private String power;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StandWarningEO extends EarlyWarningEO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("新车型实施日期")
|
||||
@ApiModelProperty("新车型实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ExcelProperty("在产车实施日期")
|
||||
@ApiModelProperty("在产车实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ExcelProperty("实施日期")
|
||||
@ApiModelProperty("实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String SSRQ;
|
||||
|
||||
|
||||
@ExcelProperty("标准编号")
|
||||
private String standNum;
|
||||
|
||||
@ExcelProperty("标准类别")
|
||||
private String standSort;
|
||||
|
||||
@ExcelProperty("标准年份")
|
||||
private String standYear;
|
||||
|
||||
@ExcelProperty("发布日期")
|
||||
private String issueTime;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer page;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer pageSize;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询新车型实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startXCXSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询新车型实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endXCXSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询在产车实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startZCCSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询在产车实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endZCCSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startSSRQ;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endSSRQ;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询发布日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startPutTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询发布日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endPutTime;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("warning_date")
|
||||
public class WarningDate {
|
||||
|
||||
@TableField("id")
|
||||
private String id;
|
||||
|
||||
@TableField("law_id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("itemId")
|
||||
private String itemId;
|
||||
|
||||
@TableField("SSRQ")
|
||||
private String SSRQ;
|
||||
|
||||
@TableField("time_Name")
|
||||
private String timeName;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class WarningExcelVO {
|
||||
@ApiModelProperty("文件名")
|
||||
String exportName;
|
||||
@ApiModelProperty("导出的ID列表")
|
||||
List<String> ids;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WarningExportVO extends EarlyWarningEO {
|
||||
|
||||
|
||||
|
||||
@ExcelProperty(value = "实施日期",index = 6)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("实施日期")
|
||||
private String SSRQ;
|
||||
|
||||
|
||||
@ExcelProperty(value = "新车型实施日期",index = 7)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("新车型实施日期")
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ExcelProperty(value = "在产车实施日期",index = 8)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("在产车实施日期")
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ExcelProperty(value = "类型",index = 0)
|
||||
@ApiModelProperty("标准类别显示")
|
||||
private String standTypeShow;
|
||||
|
||||
@ExcelProperty(value = "适用车型",index = 9)
|
||||
@ColumnWidth(20)
|
||||
@ApiModelProperty("适用车型展示")
|
||||
private String applyTypeShow;
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -2,6 +2,9 @@ package com.adc.da.slrs.sarStandWarning.service;
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -16,4 +19,9 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
|
||||
IPage<EarlyWarningEO> oldPolicyQuery(int current,int pageSize);
|
||||
String batchSave(List<EarlyWarningEO> earlyWarningEOS);
|
||||
String ChangePermissions(String id);
|
||||
|
||||
|
||||
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
||||
|
||||
List<WarningExportVO> getExportExcel(WarningExcelVO excelVO);
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.adc.da.slrs.sarStandWarning.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface IWarningDateService extends IService<WarningDate> {
|
||||
|
||||
}
|
||||
+65
-109
@@ -1,11 +1,12 @@
|
||||
package com.adc.da.slrs.sarStandWarning.service.Impl;
|
||||
|
||||
|
||||
import com.adc.da.scheduled.entity.DataDTO;
|
||||
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
||||
import com.adc.da.sys.util.DateUtil;
|
||||
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 +16,7 @@ import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service("EarlyWarningEOService")
|
||||
@@ -41,33 +40,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
@Override
|
||||
public IPage<EarlyWarningEO> newStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
|
||||
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
|
||||
//根据标准编号查询
|
||||
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){
|
||||
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
|
||||
}
|
||||
//根据标准名称查询
|
||||
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
|
||||
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
|
||||
}
|
||||
//根据实施日期查询
|
||||
if (earlyWarningEO.getPutTime() != null ){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
if (earlyWarningEO.getLastTime() != null){
|
||||
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
|
||||
}else {
|
||||
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
|
||||
}
|
||||
}
|
||||
if (earlyWarningEO.getLastTime()!=null){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
|
||||
}
|
||||
//根据适用车型查询
|
||||
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
|
||||
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
|
||||
}
|
||||
selectMethods(earlyWarningEO, wrapper);
|
||||
wrapper.eq("mark",1);
|
||||
return getEarlyWarningEOIPage(current, pageSize, wrapper);
|
||||
}
|
||||
@@ -75,32 +48,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
public IPage<EarlyWarningEO> oldStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
|
||||
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
|
||||
//根据标准编号查询
|
||||
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){
|
||||
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
|
||||
}
|
||||
//根据标准名称查询
|
||||
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
|
||||
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
|
||||
}
|
||||
//根据实施日期查询
|
||||
if (earlyWarningEO.getPutTime() != null ){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
if (earlyWarningEO.getLastTime() != null){
|
||||
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
|
||||
}else {
|
||||
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
|
||||
}
|
||||
}
|
||||
if (earlyWarningEO.getLastTime()!=null){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
|
||||
}
|
||||
//根据适用车型查询
|
||||
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
|
||||
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
|
||||
}
|
||||
selectMethods(earlyWarningEO, wrapper);
|
||||
wrapper.eq("mark",2);
|
||||
return getEarlyWarningEOIPage(current, pageSize, wrapper);
|
||||
}
|
||||
@@ -108,32 +56,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
public IPage<EarlyWarningEO> newItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
|
||||
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
|
||||
//根据标准编号查询
|
||||
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){
|
||||
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
|
||||
}
|
||||
//根据标准名称查询
|
||||
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
|
||||
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
|
||||
}
|
||||
//根据实施日期查询
|
||||
if (earlyWarningEO.getPutTime() != null ){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
if (earlyWarningEO.getLastTime() != null){
|
||||
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
|
||||
}else {
|
||||
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
|
||||
}
|
||||
}
|
||||
if (earlyWarningEO.getLastTime()!=null){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
|
||||
}
|
||||
//根据适用车型查询
|
||||
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
|
||||
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
|
||||
}
|
||||
selectMethods(earlyWarningEO, wrapper);
|
||||
wrapper.eq("mark",3);
|
||||
return getEarlyWarningEOIPage(current, pageSize, wrapper);
|
||||
}
|
||||
@@ -141,32 +64,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
public IPage<EarlyWarningEO> oldItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
|
||||
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
|
||||
//根据标准编号查询
|
||||
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){
|
||||
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
|
||||
}
|
||||
//根据标准名称查询
|
||||
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
|
||||
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
|
||||
}
|
||||
//根据实施日期查询
|
||||
if (earlyWarningEO.getPutTime() != null ){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
if (earlyWarningEO.getLastTime() != null){
|
||||
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
|
||||
}else {
|
||||
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
|
||||
}
|
||||
}
|
||||
if (earlyWarningEO.getLastTime()!=null){
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
|
||||
}
|
||||
//根据适用车型查询
|
||||
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
|
||||
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
|
||||
}
|
||||
selectMethods(earlyWarningEO, wrapper);
|
||||
wrapper.eq("mark",4);
|
||||
return getEarlyWarningEOIPage(current, pageSize, wrapper);
|
||||
}
|
||||
@@ -207,6 +105,30 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
}
|
||||
return "更改成功";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询标准预警
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
|
||||
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出预警
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<WarningExportVO> getExportExcel(WarningExcelVO excelVO){
|
||||
List<WarningExportVO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
||||
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
|
||||
|
||||
return standWarningEOList;
|
||||
}
|
||||
|
||||
|
||||
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
|
||||
wrapper.eq("power",1);
|
||||
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
|
||||
@@ -215,4 +137,38 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
private void selectMethods(EarlyWarningEO earlyWarningEO, QueryWrapper<EarlyWarningEO> wrapper) {
|
||||
//根据标准编号查询
|
||||
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0) {
|
||||
wrapper.like("STAND_CODE", earlyWarningEO.getStandCode());
|
||||
}
|
||||
//根据标准名称查询
|
||||
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0) {
|
||||
wrapper.like("STAND_NAME", earlyWarningEO.getStandName());
|
||||
}
|
||||
//根据实施日期查询
|
||||
if (earlyWarningEO.getPutTime() != null) {
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
if (earlyWarningEO.getLastTime() != null) {
|
||||
wrapper.between("PUT_TIME", formater.format(earlyWarningEO.getPutTime()), formater.format(earlyWarningEO.getLastTime()));
|
||||
} else {
|
||||
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
|
||||
}
|
||||
}
|
||||
if (earlyWarningEO.getLastTime() != null) {
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
|
||||
}
|
||||
//根据适用车型查询
|
||||
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0) {
|
||||
wrapper.like("APPLY_TYPE", earlyWarningEO.getApplyType());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.adc.da.slrs.sarStandWarning.service.Impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.dao.WarningDateDao;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
|
||||
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class WarningDateServiceImpl extends ServiceImpl<WarningDateDao, WarningDate> implements IWarningDateService {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user