Merge remote-tracking branch 'origin/develop_1' into develop_master
# Conflicts: # adc-da-slrs/src/main/resources/mybatis/mapper/sarStandProjectLibrary/SarStandProjectLibraryMapper.xml
This commit is contained in:
+2
-2
@@ -96,7 +96,7 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
||||
* date 2021-06-24
|
||||
**/
|
||||
@ApiOperation(value = "导出标准信息")
|
||||
@PostMapping("/ExportLawsById")
|
||||
@GetMapping("/ExportLawsById")
|
||||
public void ExportLawsById(HttpServletResponse response, StandExcelVo standExcelVo){
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
@@ -138,7 +138,7 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
||||
.KCCVPPSCN(lawsDto.getKCCVPPSCN())
|
||||
.build();
|
||||
}
|
||||
EasyExcel.write(response.getOutputStream(), LawsDto.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
EasyExcel.write(response.getOutputStream(), LawsDto.class).useDefaultStyle(false).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(data);
|
||||
} catch (Exception e) {
|
||||
response.reset();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -22,32 +24,54 @@ import lombok.NoArgsConstructor;
|
||||
public class LawsDto {
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
@ExcelProperty(value = "标准编号", index = 0)
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
private String standNumber;
|
||||
@ExcelProperty(value = "中文名称", index = 1)
|
||||
@ApiModelProperty(value = "中文名称")
|
||||
private String standName;
|
||||
@ExcelProperty(value = "英文名称", index = 2)
|
||||
@ApiModelProperty(value = "英文名称")
|
||||
private String standEnName;
|
||||
@ExcelProperty(value = "适用车型", index = 3)
|
||||
@ApiModelProperty(value = "适用车型")
|
||||
private String typeApplicable;
|
||||
@ExcelProperty(value = "能源类型", index = 4)
|
||||
@ApiModelProperty(value = "能源类型")
|
||||
private String NYLX;
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "标准实施日期", index = 5)
|
||||
@ApiModelProperty(value = "标准实施日期")
|
||||
private String putTime;
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "新车型实施日期", index = 6)
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
private String XCXSSRQGJ;
|
||||
@ColumnWidth(16)
|
||||
@ExcelProperty(value = "在产车实施日期", index = 7)
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
private String ZCCSSRQGJ;
|
||||
@ExcelProperty(value = "责任部门", index = 8)
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
private String ZRBM;
|
||||
@ColumnWidth(14)
|
||||
@ExcelProperty(value = "适用产品线", index = 9)
|
||||
@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;
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarLawsDetailedList.controller;
|
||||
|
||||
|
||||
import com.adc.da.att.controller.AttFileEOController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
@@ -13,7 +14,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
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.*;
|
||||
|
||||
@@ -37,6 +37,7 @@ public class SarLawsDetailedListController extends BaseController<SarLawsDetaile
|
||||
|
||||
@Autowired
|
||||
private SarLawsDetailedListServiceImpl sarLawsDetailedListService;
|
||||
private AttFileEOController attFileEOController;
|
||||
|
||||
/**
|
||||
* @param idList 要进行删除的清单id
|
||||
|
||||
+1
-8
@@ -26,10 +26,8 @@ public class AddDetailedDto {
|
||||
private String sortKey;
|
||||
@ApiModelProperty(value = "清单名称")
|
||||
private String detailedListName;
|
||||
|
||||
@ApiModelProperty(value = "清单详情")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "清单状态,1为未发布,2为发布")
|
||||
private String detailedListState;
|
||||
@ApiModelProperty(value = "适用领域")
|
||||
@@ -37,12 +35,7 @@ public class AddDetailedDto {
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updatePeople;
|
||||
@ApiModelProperty(value = "上传的附件")
|
||||
private MultipartFile[] files;
|
||||
private String fileIds;
|
||||
@ApiModelProperty(value = "要添加的清单id")
|
||||
private String inforlist;
|
||||
|
||||
|
||||
public MultipartFile getFiles(int i) {
|
||||
return files[i];
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -44,8 +44,7 @@ public class DetailedUpDto {
|
||||
private String applicationScope;
|
||||
|
||||
@ApiModelProperty(value = "附件id")
|
||||
private String fileId;
|
||||
|
||||
private String fileIds;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date reNewTime;
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ public class SarLawsDetailedList extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "附件id")
|
||||
@TableField("file_id")
|
||||
private String fileId;
|
||||
private String fileIds;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
-7
@@ -70,6 +70,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
.updatePeople(addDetailedDto.getUpdatePeople())
|
||||
.remark(addDetailedDto.getRemark())
|
||||
.updatePeople(getUserName())
|
||||
.fileIds(addDetailedDto.getFileIds())
|
||||
.build();
|
||||
switch (addDetailedDto.getSortKey()) {
|
||||
case "1":
|
||||
@@ -136,13 +137,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setCountryArea(completedString);
|
||||
}else {
|
||||
for (Map<String,String> map1:arr) {
|
||||
if (map1.get("value").equals(list1.getCountryArea())){
|
||||
list1.setCountryArea(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
@@ -194,6 +188,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
if (StringUtils.isBlank(detailedUpDto.getDetailedListState())) list.setDetailedListState(null);
|
||||
else if ("null".equals(detailedUpDto.getDetailedListState()));
|
||||
else list.setDetailedListState(detailedUpDto.getDetailedListState());
|
||||
//文件
|
||||
if (StringUtils.isBlank(detailedUpDto.getFileIds())) list.setFileIds(null);
|
||||
else if ("null".equals(detailedUpDto.getFileIds()));
|
||||
else list.setFileIds(detailedUpDto.getFileIds());
|
||||
|
||||
sarLawsDetailedListDao.updateById(list);
|
||||
if (null!=detailedUpDto.getInforlist()) {
|
||||
|
||||
+5
-5
@@ -150,11 +150,11 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
list = null;
|
||||
}else {
|
||||
list = sarLawsAttrDetailedListDao.selectLawsByIdC(standId,findStandDto.getStandName(), findStandDto.getStandType());
|
||||
}
|
||||
for (LawsDto lawsDto:list){
|
||||
if (sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).size()!=0){
|
||||
lawsDto.setTypeApplicable(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
||||
System.out.println(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
||||
for (LawsDto lawsDto:list){
|
||||
if (sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).size()!=0){
|
||||
lawsDto.setTypeApplicable(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
||||
System.out.println(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
IPage<LawsDto> page1=new Page<>();
|
||||
|
||||
+96
-13
@@ -1,26 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.productLineDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -37,7 +31,6 @@ import java.util.*;
|
||||
public class SarStandProjectLibraryController extends BaseController<SarStandProjectLibrary> {
|
||||
@Resource
|
||||
private SarStandProjectLibraryServiceImpl sarStandProjectLibraryService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Page
|
||||
@@ -71,7 +64,14 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryById(id);
|
||||
return Result.success("200",list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-13
|
||||
**/
|
||||
@GetMapping("/queryProjectManager")
|
||||
@ApiOperation("查询产品线项目经理")
|
||||
public ResponseMessage queryProjectManager(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize){
|
||||
@@ -95,6 +95,89 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
pageres.setSize(list1.getSize());
|
||||
return Result.success("200",pageres);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param current
|
||||
* @param pageSize
|
||||
* @param id
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@GetMapping("/queryStandInfo")
|
||||
@ApiOperation("查询标准信息")
|
||||
public ResponseMessage queryStandInfo(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
|
||||
String id){
|
||||
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> list2 = sarStandProjectLibraryService.queryStandInfo(current,pageSize,id);
|
||||
return Result.success("200",list2);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@PostMapping("/deleteByIds")
|
||||
@ApiOperation("批量删除标准")
|
||||
public ResponseMessage deleteByIds(String id){
|
||||
String[] ids = id.split(",");
|
||||
List<String> list = Arrays.asList(ids);
|
||||
sarStandProjectLibraryService.deleteByIds(list);
|
||||
return Result.success("200","删除成功");
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-15
|
||||
**/
|
||||
@PostMapping("/batchInsert")
|
||||
@ApiOperation("调取标准")
|
||||
public ResponseMessage batchInsert(@RequestBody List<StandProjectRelationDto> list){
|
||||
sarStandProjectLibraryService.batchInsert(list);
|
||||
return Result.success("200","新增成功",list);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param standAttrInfoExcelDto
|
||||
* @param response
|
||||
* @return
|
||||
* @author zj
|
||||
* date 2021-07-16
|
||||
**/
|
||||
@ApiOperation("导出Excel表")
|
||||
@GetMapping(value = "/exportStandAttrInfoExcel")
|
||||
public void exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto, HttpServletResponse response) throws Exception {
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
if(standAttrInfoExcelDto.getExportName()==null){
|
||||
standAttrInfoExcelDto.setExportName("车型项目详情");
|
||||
}
|
||||
String fileName = URLEncoder.encode(standAttrInfoExcelDto.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
List<StandAttrInfoDto> data= sarStandProjectLibraryService.exportStandAttrInfoExcel(standAttrInfoExcelDto);
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), StandAttrInfoDto.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(data);
|
||||
} 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()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -17,5 +18,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
|
||||
// List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
|
||||
|
||||
void deleteByIds(@Param("ids") List<String> ids);
|
||||
void batchInsert(@Param("list") List<StandProjectRelationDto> list);
|
||||
}
|
||||
|
||||
+30
@@ -68,8 +68,38 @@ public class SarStandProjectLibrary extends BaseEntity {
|
||||
private String projectManager;
|
||||
|
||||
@ApiModelProperty(value = "项目经理名称")
|
||||
|
||||
@TableField(exist = false)
|
||||
private String uName;
|
||||
|
||||
|
||||
//标准编号
|
||||
@TableField(exist = false)
|
||||
private String standId;
|
||||
//中文名称
|
||||
@TableField(exist = false)
|
||||
private String standName;
|
||||
//英文名称
|
||||
@TableField(exist = false)
|
||||
private String standEnName;
|
||||
//标准实施日期
|
||||
@TableField(exist = false)
|
||||
private String ssrq;
|
||||
//新车型实施日期
|
||||
@TableField(exist = false)
|
||||
private String XCXSSRQGJ;
|
||||
//在产车实施日期
|
||||
@TableField(exist = false)
|
||||
private String ZCCSSRQGJ;
|
||||
//责任部门
|
||||
@TableField(exist = false)
|
||||
private String ZRBM;
|
||||
//关联模块-VPPS
|
||||
@TableField(exist = false)
|
||||
private String CYCVPPSBM;
|
||||
//关联模块-中文名称
|
||||
@TableField(exist = false)
|
||||
private String CYCVPPSCN;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
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 io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* //TODO 添加类/接口功能描述
|
||||
*
|
||||
* @author zhangjin
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
@Data
|
||||
@HeadRowHeight(35)
|
||||
@ColumnWidth(30)
|
||||
public class StandAttrInfoDto {
|
||||
|
||||
//标准编号
|
||||
@ExcelProperty("标准编号")
|
||||
private String standId;
|
||||
//中文名称
|
||||
@ExcelProperty("中文名称")
|
||||
private String standName;
|
||||
//英文名称
|
||||
@ExcelProperty("英文名称")
|
||||
private String standEnName;
|
||||
//标准实施日期
|
||||
@ExcelProperty("标准实施日期")
|
||||
private String SSRQ;
|
||||
//新车型实施日期
|
||||
@ExcelProperty("新车型实施日期")
|
||||
private String XCXSSRQGJ;
|
||||
//在产车实施日期
|
||||
@ExcelProperty("在产车实施日期")
|
||||
private String ZCCSSRQGJ;
|
||||
//责任部门
|
||||
@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;
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* //TODO 添加类/接口功能描述
|
||||
*
|
||||
* @author zhangjin
|
||||
* @date 2021-07-15
|
||||
*/
|
||||
@Data
|
||||
public class StandAttrInfoExcelDto {
|
||||
|
||||
String exportName;
|
||||
|
||||
List<String> ids;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* //TODO 添加类/接口功能描述
|
||||
*
|
||||
* @author zhangjin
|
||||
* @date 2021-07-13
|
||||
*/
|
||||
@Data
|
||||
public class StandProjectRelationDto {
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String standId;
|
||||
|
||||
}
|
||||
+8
-3
@@ -1,9 +1,8 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.productLineDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,4 +12,10 @@ public interface SarStandProjectLibraryService {
|
||||
List<SarStandProjectLibrary> queryById(String id);
|
||||
IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize);
|
||||
List<SarStandProjectLibrary> queryByProductLine(String productLine);
|
||||
List<SarStandProjectLibrary> queryStandId(String standId);
|
||||
IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId);
|
||||
void deleteByIds(List<String> ids);
|
||||
void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
|
||||
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto);
|
||||
|
||||
}
|
||||
|
||||
+146
-3
@@ -1,10 +1,13 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.SarStandIssueControlProduct;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.SarStandProjectLibraryService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
@@ -15,6 +18,8 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -30,6 +35,10 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
|
||||
@Resource
|
||||
private SarStandProjectLibraryDao sarStandProjectLibraryDao;
|
||||
@Resource
|
||||
private SarStandardsInfoDao SarStandardsInfoDao;
|
||||
@Resource
|
||||
private SarStandAttrInfoDao sarStandAttrInfoDao;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -144,6 +153,140 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarStandProjectLibrary> queryStandId(String standId) {
|
||||
QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>();
|
||||
wrapper.select("stand_id");
|
||||
wrapper.last("INNER JOIN sar_stand_project_relation r ON sar_stand_project_library.id = r.project_id");
|
||||
List<SarStandProjectLibrary> list = sarStandProjectLibraryDao.selectList(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId) {
|
||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.select("ID","STAND_NAME","STAND_EN_NAME");
|
||||
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","XCXSSRQGJ","ZCCSSRQGJ","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.setStandName(s.getStandName());
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
for (SarStandAttrInfo a:list2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQGJ(a.getXcxssrqgj());
|
||||
p.setZCCSSRQGJ(a.getZccssrqgj());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
list.add(p);
|
||||
System.out.println(list);
|
||||
}
|
||||
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 void deleteByIds(List<String> ids) {
|
||||
sarStandProjectLibraryDao.deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchInsert(List<StandProjectRelationDto> list) {
|
||||
sarStandProjectLibraryDao.batchInsert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto) {
|
||||
List<String> ids = standAttrInfoExcelDto.getIds();
|
||||
List<StandAttrInfoDto> list = new ArrayList<>();
|
||||
if (ids==null||ids.size()==0){
|
||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.select("ID","STAND_NAME","STAND_EN_NAME");
|
||||
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID");
|
||||
List<SarStandardsInfo> userList1 = SarStandardsInfoDao.selectList(wrapper1);
|
||||
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
|
||||
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQGJ","ZCCSSRQGJ","ZRBM","KCCVPPSBM","KCCVPPSCN","CYCVPPSBM","CYCVPPSCN");
|
||||
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID");
|
||||
List<SarStandAttrInfo> userList2 = sarStandAttrInfoDao.selectList(wrapper2);
|
||||
for(SarStandardsInfo s:userList1){
|
||||
StandAttrInfoDto p =new StandAttrInfoDto();
|
||||
p.setStandId(s.getId());
|
||||
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());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQGJ(a.getXcxssrqgj());
|
||||
p.setZCCSSRQGJ(a.getZccssrqgj());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
list.add(p);
|
||||
}
|
||||
}else {
|
||||
String idmis=String.join(",",ids);
|
||||
System.out.println(idmis);
|
||||
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.select("ID","STAND_NAME","STAND_EN_NAME");
|
||||
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.stand_id in ("+ idmis +")");
|
||||
List<SarStandardsInfo> userList1 = SarStandardsInfoDao.selectList(wrapper1);
|
||||
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
|
||||
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQGJ","ZCCSSRQGJ","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.stand_id in ("+ idmis +")");
|
||||
List<SarStandAttrInfo> userList2 = sarStandAttrInfoDao.selectList(wrapper2);
|
||||
for(SarStandardsInfo s:userList1){
|
||||
StandAttrInfoDto p =new StandAttrInfoDto();
|
||||
p.setStandId(s.getId());
|
||||
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());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQGJ(a.getXcxssrqgj());
|
||||
p.setZCCSSRQGJ(a.getZccssrqgj());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
list.add(p);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private IPage<SarStandProjectLibrary> getSarStandProjectLibraryIPage(int current, int pageSize, QueryWrapper<SarStandProjectLibrary> wrapper) {
|
||||
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
||||
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
|
||||
|
||||
+14
@@ -1,6 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao">
|
||||
<insert id="batchInsert">
|
||||
insert into sar_stand_project_relation(project_id,stand_id) VALUES
|
||||
<foreach collection="list" item="list" separator=",">
|
||||
(#{list.projectId,jdbcType=VARCHAR},#{list.standId,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="queryProjectManagerPage" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
||||
@@ -11,4 +17,12 @@
|
||||
GROUP BY s.product_line
|
||||
limit #{current},#{pageSize}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from sar_stand_project_relation where stand_id in (
|
||||
<foreach collection="ids" item="list" separator=",">
|
||||
#{list}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user