Merge branch 'develop_1' into 'develop_master'

zzzDevelop 1

See merge request LiuChao/foton-slrs-system-rest!189
This commit is contained in:
张宇欢
2021-10-08 09:30:19 +08:00
12 changed files with 94 additions and 47 deletions
@@ -35,10 +35,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("/${restPath}/lawss/activiti") @RequestMapping("/${restPath}/lawss/activiti")
@@ -74,8 +72,11 @@ public class WorkFlowController {
if(exportExcelEO.getFileName()==null||exportExcelEO.getFileName().trim().length()==0){ if(exportExcelEO.getFileName()==null||exportExcelEO.getFileName().trim().length()==0){
exportExcelEO.setFileName(UUID.fastUUID().toString(true)); exportExcelEO.setFileName(UUID.fastUUID().toString(true));
} }
List<Map<String, Object>> dataList = exportExcelEO.getDataList().stream()
.sorted(Comparator.comparing(a -> String.valueOf(a.get("chapterNumber").toString())))
.collect(Collectors.toList());
Workbook excel = TableToExcel.createExcel(exportExcelEO.getColumnName(), exportExcelEO.getDataList(), null, exportExcelEO.getFileName()); Workbook excel = TableToExcel.createExcel(exportExcelEO.getColumnName(), dataList, null, exportExcelEO.getFileName());
response.reset(); response.reset();
@@ -48,66 +48,66 @@ public class LawsDto {
private String NYLX; private String NYLX;
@ApiModelProperty(value = "标准年份") @ApiModelProperty(value = "标准年份")
@ExcelProperty(value = "标准年份", index = 5) // @ExcelProperty(value = "标准年份", index = 5)
private String standYear; private String standYear;
@ApiModelProperty(value = "标准类别") @ApiModelProperty(value = "标准类别")
@ExcelProperty(value = "标准类别", index = 6) // @ExcelProperty(value = "标准类别", index = 6)
private String standSortShow; private String standSortShow;
@ApiModelProperty(value = "标准发表日期") @ApiModelProperty(value = "标准发表日期")
@ExcelProperty(value = "标准发表日期", index = 7) // @ExcelProperty(value = "标准发表日期", index = 7)
private String issueTime; private String issueTime;
@ColumnWidth(16) @ColumnWidth(16)
@ExcelProperty(value = "标准实施日期", index = 8) @ExcelProperty(value = "标准实施日期", index = 5)
@ApiModelProperty(value = "标准实施日期") @ApiModelProperty(value = "标准实施日期")
@DateTimeFormat("yyyy年MM月dd日") @DateTimeFormat("yyyy年MM月dd日")
private String SSRQ; private String SSRQ;
@ColumnWidth(16) @ColumnWidth(16)
@ExcelProperty(value = "新车型实施日期", index = 9) @ExcelProperty(value = "新车型实施日期", index = 6)
@ApiModelProperty(value = "新车型实施日期") @ApiModelProperty(value = "新车型实施日期")
@DateTimeFormat("yyyy年MM月dd日") @DateTimeFormat("yyyy年MM月dd日")
private String XCXSSRQGJ; private String XCXSSRQGJ;
@ColumnWidth(16) @ColumnWidth(16)
@ExcelProperty(value = "在产车实施日期", index = 10) @ExcelProperty(value = "在产车实施日期", index = 7)
@ApiModelProperty(value = "在产车实施日期") @ApiModelProperty(value = "在产车实施日期")
@DateTimeFormat("yyyy年MM月dd日") @DateTimeFormat("yyyy年MM月dd日")
private String ZCCSSRQGJ; private String ZCCSSRQGJ;
@ExcelProperty(value = "责任部门", index = 11) @ExcelProperty(value = "责任部门", index = 8)
@ApiModelProperty(value = "责任部门") @ApiModelProperty(value = "责任部门")
private String ZRBM; private String ZRBM;
@ColumnWidth(14) @ColumnWidth(14)
@ExcelProperty(value = "适用产品线", index = 12) @ExcelProperty(value = "适用产品线", index = 9)
@ApiModelProperty(value = "适用产品线") @ApiModelProperty(value = "适用产品线")
private String SYCPX; private String SYCPX;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "乘用车VPPS编码", index = 13) @ExcelProperty(value = "乘用车VPPS编码", index = 10)
@ApiModelProperty(value = "乘用车VPPS编码") @ApiModelProperty(value = "乘用车VPPS编码")
private String CYCVPPSBM; private String CYCVPPSBM;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "乘用车vpps中文名称", index = 14) @ExcelProperty(value = "乘用车vpps中文名称", index = 11)
@ApiModelProperty(value = "乘用车vpps中文名称") @ApiModelProperty(value = "乘用车vpps中文名称")
private String CYCVPPSCN; private String CYCVPPSCN;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "卡车VPPS编码", index = 15) @ExcelProperty(value = "卡车VPPS编码", index = 12)
@ApiModelProperty(value = "卡车VPPS编码") @ApiModelProperty(value = "卡车VPPS编码")
private String KCCVPPSBM; private String KCCVPPSBM;
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty(value = "卡车vpps中文名称", index = 16) @ExcelProperty(value = "卡车vpps中文名称", index = 13)
@ApiModelProperty(value = "卡车vpps中文名称") @ApiModelProperty(value = "卡车vpps中文名称")
private String KCCVPPSCN; private String KCCVPPSCN;
@ApiModelProperty(value = "责任工程师") @ApiModelProperty(value = "责任工程师")
@ExcelProperty(value = "责任工程师", index = 17) // @ExcelProperty(value = "责任工程师", index = 17)
private String responsibleEngineer; private String responsibleEngineer;
@ApiModelProperty(value = "1") @ApiModelProperty(value = "1")
@@ -104,6 +104,7 @@ public class SarPublicIdeaAllController extends BaseController<SarPublicIdeaAll>
if (!StringUtils.isEmpty(cid)){ if (!StringUtils.isEmpty(cid)){
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>(); QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
wrapper.eq(SarPublicIdeaAll.CID,cid); wrapper.eq(SarPublicIdeaAll.CID,cid);
wrapper.orderByAsc("part_code");
data=sarPublicIdeaAllDao.selectList(wrapper); data=sarPublicIdeaAllDao.selectList(wrapper);
} }
List<GetExcelDto> standExcel=new ArrayList<>(); List<GetExcelDto> standExcel=new ArrayList<>();
@@ -8,7 +8,6 @@ import com.adc.da.http.Result;
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto; import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
import com.adc.da.slrs.sarStandItems.entity.*; import com.adc.da.slrs.sarStandItems.entity.*;
import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl; import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.util.UUIDUtils; import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -56,7 +55,7 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
@ApiOperation(value = "分解单查询") @ApiOperation(value = "分解单查询")
@GetMapping("/querySarItemAndInterpretation") @GetMapping("/querySarItemAndInterpretation")
public ResponseMessage<PageInfo<SarStandItems>> querySarItemAndInterpretation(FindSarItemsPageReqDTO page){ public ResponseMessage querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
List<SarStandItems> rows = ServiceImpl.querySarItemAndInterpretation(page); List<SarStandItems> rows = ServiceImpl.querySarItemAndInterpretation(page);
PageInfo<SarStandItems> pageInfo = getPageInfo(page.getPager(), rows); PageInfo<SarStandItems> pageInfo = getPageInfo(page.getPager(), rows);
@@ -13,6 +13,9 @@ import java.util.Date;
public class FindSarItemsPageReqDTO extends BasePage { public class FindSarItemsPageReqDTO extends BasePage {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer page = 1;
private Integer pageSize = 20;
@ApiModelProperty(value = "标准id") @ApiModelProperty(value = "标准id")
private String standId; private String standId;
@@ -1,5 +1,6 @@
package com.adc.da.slrs.sarStandItems.entity; package com.adc.da.slrs.sarStandItems.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -22,9 +23,13 @@ public class SarStandItemsDto {
@ApiModelProperty(value = "条目编号") @ApiModelProperty(value = "条目编号")
private String itemsNum; private String itemsNum;
@ApiModelProperty(value = "内容") @ApiModelProperty(value = "名称")
private String itemsName; private String itemsName;
@ApiModelProperty(value = "内容")
@TableField("TERMS_CONDITIONS")
private String termsConditions;
@ApiModelProperty(value = "责任部门") @ApiModelProperty(value = "责任部门")
private String responsibleUnit; private String responsibleUnit;
@@ -36,7 +36,12 @@ public class SarStandUnqualified extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ExcelProperty("标准ID") @ExcelProperty("标准")
@ApiModelProperty(value = "标准编号")
@TableField("STAND_SERIAL_NUMBER")
private String standSerialNumber;
@ExcelIgnore
@ApiModelProperty(value = "标准ID") @ApiModelProperty(value = "标准ID")
@TableField("STAND_ID") @TableField("STAND_ID")
private String standId; private String standId;
@@ -69,27 +74,27 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("ITEMS_NAME") @TableField("ITEMS_NAME")
private String itemsName; private String itemsName;
@ExcelProperty(value = "产品类型",converter = ProductTypeConverter.class)
@ApiModelProperty(value = "产品类型(research为在研产品,product为在产产品)")
@TableField("PRODUCT_TYPE")
private String productType;
@ExcelProperty("产品线") @ExcelProperty("产品线")
@ApiModelProperty(value = "产品线") @ApiModelProperty(value = "产品线")
@TableField("PRODUCT_LINE") @TableField("PRODUCT_LINE")
private String productLine; private String productLine;
@ExcelProperty("责任部门")
@ApiModelProperty(value = "责任部门")
@TableField("RESPONSIBLE_UNIT")
private String responsibleUnit;
@ExcelProperty("项目名称") @ExcelProperty("项目名称")
@ApiModelProperty(value = "项目名称") @ApiModelProperty(value = "项目名称")
@TableField("PRODUCT_NAME") @TableField("PRODUCT_NAME")
private String productName; private String productName;
@ExcelProperty("创建部门") @ExcelIgnore
@ApiModelProperty(value = "创建部门") @ApiModelProperty(value = "创建部门")
@TableField("CREATE_DEPT_ID") @TableField("CREATE_DEPT_ID")
private String createDeptId; private String createDeptId;
@ExcelProperty("创建人") @ExcelIgnore
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
@TableField("CREATE_BY_ID") @TableField("CREATE_BY_ID")
private String createById; private String createById;
@@ -113,17 +118,16 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("ACTUAL_CLOSE_TIME") @TableField("ACTUAL_CLOSE_TIME")
private Date actualCloseTime; private Date actualCloseTime;
@ExcelIgnore @ExcelProperty("不合规项目")
@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;
@ApiModelProperty(value = "未符合原因") @ApiModelProperty(value = "未符合原因")
@TableField("REASON") @TableField("REASON")
private String reason; private String reason;
@ExcelProperty("责任部门")
@ApiModelProperty(value = "责任部门")
@TableField("RESPONSIBLE_UNIT")
private String responsibleUnit;
@ExcelProperty("质量工程师") @ExcelProperty("质量工程师")
@ApiModelProperty(value = "质量工程师") @ApiModelProperty(value = "质量工程师")
@TableField("QA_ENGINEER") @TableField("QA_ENGINEER")
@@ -139,33 +143,34 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("DUTY_ENGINEER") @TableField("DUTY_ENGINEER")
private String dutyEngineer; private String dutyEngineer;
@ExcelProperty("标准编号") @ExcelProperty("计划关闭时间")
@ApiModelProperty(value = "标准编号") @ApiModelProperty(value = "计划关闭时间")
@TableField("STAND_SERIAL_NUMBER") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String standSerialNumber; @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField("PLAN_CLOSE_TIME")
@ExcelProperty(value = "产品类型",converter = ProductTypeConverter.class) private Date planCloseTime;
@ApiModelProperty(value = "产品类型(research为在研产品,product为在产产品)")
@TableField("PRODUCT_TYPE")
private String productType;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
@TableId(type = IdType.UUID) @TableId(type = IdType.UUID)
private String id; private String id;
@ExcelIgnore
@ApiModelProperty(value = "质量工程师") @ApiModelProperty(value = "质量工程师")
@TableField(exist=false) @TableField(exist=false)
private String qaEngineerName; private String qaEngineerName;
@ExcelIgnore
@ApiModelProperty(value = "认证工程师") @ApiModelProperty(value = "认证工程师")
@TableField(exist=false) @TableField(exist=false)
private String authEngineerName; private String authEngineerName;
@ExcelIgnore
@ApiModelProperty(value = "责任工程师") @ApiModelProperty(value = "责任工程师")
@TableField(exist=false) @TableField(exist=false)
private String dutyEngineerName; private String dutyEngineerName;
@ExcelIgnore
@ApiModelProperty(value = "国内OR海外") @ApiModelProperty(value = "国内OR海外")
@TableField(exist=false) @TableField(exist=false)
private String standType; private String standType;
@@ -218,7 +218,10 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
int result = sarStandardsInfoEOService.deleteSarStandards(ids); int result = sarStandardsInfoEOService.deleteSarStandards(ids);
if (result > 0) { if (result > 0) {
return Result.success("0", "删除成功", result); return Result.success("0", "删除成功", result);
} else { }else if(result == -1) {
return Result.success("-1","所选的标准下挂有标准,无法删除");
}
else {
return Result.error("删除失败"); return Result.error("删除失败");
} }
} }
@@ -15,6 +15,8 @@ import com.adc.da.search.entity.StandLawsEO;
import com.adc.da.search.service.StandLawsSearchService; import com.adc.da.search.service.StandLawsSearchService;
import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao; import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao;
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq; import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
import com.adc.da.slrs.sarLawsAttrDetailedList.service.impl.SarLawsAttrDetailedListServiceImpl;
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo; import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage; import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
import com.adc.da.slrs.sarLawsInfo.page.SarLawsItemsEOPage; import com.adc.da.slrs.sarLawsInfo.page.SarLawsItemsEOPage;
@@ -1285,13 +1287,32 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
} }
@Autowired
SarLawsAttrDetailedListServiceImpl detailedListService;
public int deleteSarStandards(String ids) { public int deleteSarStandards(String ids) {
QueryWrapper<SarLawsAttrDetailedList> detailedListQueryWrapper = new QueryWrapper<>();
String[] idArr = ids.split(","); String[] idArr = ids.split(",");
SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo(); SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo();
sarStandardsInfoEO.setValidFlag("1"); sarStandardsInfoEO.setValidFlag("1");
sarStandardsInfoEO.setModifyTime(new Date()); sarStandardsInfoEO.setModifyTime(new Date());
int countResult = 0; int countResult = 0;
//如果清单下挂着标准A,在标准库里删除标准A的话,加个验证 不让删这个标准
for (String id : idArr){
detailedListQueryWrapper.eq("stand_id",id);
int count = detailedListService.count(detailedListQueryWrapper);
if (count>0){
countResult = -1;
return countResult;
}
}
for (String id : idArr) { for (String id : idArr) {
countResult++; countResult++;
//查询删除的标准信息(为删除代替关系) //查询删除的标准信息(为删除代替关系)
SarStandardsInfo getDelStandInfoList = dao.selectById(id); SarStandardsInfo getDelStandInfoList = dao.selectById(id);
@@ -72,7 +72,7 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
Page<TsUser> tsUserPage = new Page<>(); Page<TsUser> tsUserPage = new Page<>();
System.out.println(tsUser.getCurrent()); System.out.println(tsUser.getCurrent());
System.out.println(tsUser.getSize()); System.out.println(tsUser.getSize());
List<TsUser> tsUserList = tsUserDao.getUserAndPositionPage((tsUser.getCurrent()-1)*tsUser.getSize(),1*tsUser.getSize(),tsUser); List<TsUser> tsUserList = tsUserDao.getUserAndPositionPage((tsUser.getCurrent()-1)*tsUser.getSize(),tsUser.getSize(),tsUser);
Integer total = tsUserDao.getUserAndPositionCount(tsUser); Integer total = tsUserDao.getUserAndPositionCount(tsUser);
tsUserPage.setRecords(tsUserList); tsUserPage.setRecords(tsUserList);
tsUserPage.setCurrent(tsUser.getCurrent()); tsUserPage.setCurrent(tsUser.getCurrent());
@@ -413,6 +413,9 @@
<!-- 标准名称 --> <!-- 标准名称 -->
<if test="standName != null and standName != ''"> <if test="standName != null and standName != ''">
and stand_name like concat(concat('%',#{standName}),'%') and stand_name like concat(concat('%',#{standName}),'%')
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
or STAND_YEAR like concat(concat('%',#{standName}),'%')
or STAND_SORT like concat(concat('%',#{standName}),'%')
</if> </if>
<if test="standEnName != null and standEnName != ''"> <if test="standEnName != null and standEnName != ''">
and stand_en_name like concat(concat('%',#{standEnName}),'%') and stand_en_name like concat(concat('%',#{standEnName}),'%')
@@ -51,6 +51,12 @@
left join ts_position p left join ts_position p
on up.position_id=p.id on up.position_id=p.id
where u.institution_id=#{TsUser.institutionId} where u.institution_id=#{TsUser.institutionId}
<if test="TsUser.uname != null and TsUser.uname != '' ">
and u.uname like concat('%',#{TsUser.uname},'%')
</if>
<if test="TsUser.email != null and TsUser.email != '' ">
and u.email like concat('%',#{TsUser.email},'%')
</if>
</select> </select>
<select id="getUserIdsByPositionIds" resultType="String"> <select id="getUserIdsByPositionIds" resultType="String">