add:车型项目库 调取 批量删除 导出
This commit is contained in:
+96
-13
@@ -1,26 +1,20 @@
|
|||||||
package com.adc.da.slrs.sarStandProjectLibrary.controller;
|
package com.adc.da.slrs.sarStandProjectLibrary.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.productLineDto;
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
|
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.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
|
||||||
import io.swagger.annotations.Api;
|
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 com.adc.da.base.web.BaseController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +31,6 @@ import java.util.*;
|
|||||||
public class SarStandProjectLibraryController extends BaseController<SarStandProjectLibrary> {
|
public class SarStandProjectLibraryController extends BaseController<SarStandProjectLibrary> {
|
||||||
@Resource
|
@Resource
|
||||||
private SarStandProjectLibraryServiceImpl sarStandProjectLibraryService;
|
private SarStandProjectLibraryServiceImpl sarStandProjectLibraryService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param Page
|
* @param Page
|
||||||
@@ -71,7 +64,14 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
|||||||
List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryById(id);
|
List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryById(id);
|
||||||
return Result.success("200",list);
|
return Result.success("200",list);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param current
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
* @author zj
|
||||||
|
* date 2021-07-13
|
||||||
|
**/
|
||||||
@GetMapping("/queryProjectManager")
|
@GetMapping("/queryProjectManager")
|
||||||
@ApiOperation("查询产品线项目经理")
|
@ApiOperation("查询产品线项目经理")
|
||||||
public ResponseMessage queryProjectManager(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize){
|
public ResponseMessage queryProjectManager(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize){
|
||||||
@@ -89,6 +89,89 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
|||||||
}
|
}
|
||||||
return Result.success("200",listTemp);
|
return Result.success("200",listTemp);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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;
|
package com.adc.da.slrs.sarStandProjectLibrary.dao;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
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.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -17,5 +18,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
|
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
|
||||||
// List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
|
// 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;
|
private String projectManager;
|
||||||
|
|
||||||
@ApiModelProperty(value = "项目经理名称")
|
@ApiModelProperty(value = "项目经理名称")
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String uName;
|
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;
|
package com.adc.da.slrs.sarStandProjectLibrary.service;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.productLineDto;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -13,4 +12,10 @@ public interface SarStandProjectLibraryService {
|
|||||||
List<SarStandProjectLibrary> queryById(String id);
|
List<SarStandProjectLibrary> queryById(String id);
|
||||||
IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize);
|
IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize);
|
||||||
List<SarStandProjectLibrary> queryByProductLine(String productLine);
|
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;
|
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.dao.SarStandProjectLibraryDao;
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibraryDto;
|
|
||||||
import com.adc.da.slrs.sarStandProjectLibrary.service.SarStandProjectLibraryService;
|
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.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
@@ -15,6 +18,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,6 +35,10 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SarStandProjectLibraryDao sarStandProjectLibraryDao;
|
private SarStandProjectLibraryDao sarStandProjectLibraryDao;
|
||||||
|
@Resource
|
||||||
|
private SarStandardsInfoDao SarStandardsInfoDao;
|
||||||
|
@Resource
|
||||||
|
private SarStandAttrInfoDao sarStandAttrInfoDao;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,6 +153,140 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
|||||||
return list;
|
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) {
|
private IPage<SarStandProjectLibrary> getSarStandProjectLibraryIPage(int current, int pageSize, QueryWrapper<SarStandProjectLibrary> wrapper) {
|
||||||
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
||||||
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
|
IPage<SarStandProjectLibrary> userIPage = sarStandProjectLibraryDao.selectPage(page, wrapper);
|
||||||
|
|||||||
+21
-8
@@ -1,14 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!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">
|
<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">-->
|
<!-- <select id="queryProjectManagerPage" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">-->
|
||||||
<!-- select s.product_line,t.UNAME as uName-->
|
<!-- select s.product_line,t.UNAME as uName-->
|
||||||
<!-- from sar_stand_project_library s-->
|
<!-- from sar_stand_project_library s-->
|
||||||
<!-- INNER JOIN ts_user t-->
|
<!-- INNER JOIN ts_user t-->
|
||||||
<!-- ON s.project_manager=t.USID-->
|
<!-- ON s.project_manager=t.USID-->
|
||||||
<!-- GROUP BY s.product_line-->
|
<!-- GROUP BY s.product_line-->
|
||||||
<!-- limit #{current},#{pageSize}-->
|
<!-- limit #{current},#{pageSize}-->
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
|
<delete id="deleteByIds">
|
||||||
|
delete from sar_stand_project_relation where stand_id in (
|
||||||
|
<foreach collection="ids" item="list" separator=",">
|
||||||
|
#{list}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user