产品线 数据

This commit is contained in:
yuezhihang
2021-07-09 15:28:15 +08:00
parent aed855e336
commit 00798eb2b1
6 changed files with 26 additions and 18 deletions
@@ -9,12 +9,9 @@ import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.sarStandItems.entity.SarStandItems; import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
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 java.util.List; import java.util.List;
@@ -29,7 +26,7 @@ import java.util.List;
*/ */
@RestController @RestController
@Api(description = "|SarStandItems|") @Api(description = "|SarStandItems|")
@RequestMapping("/SarStandItems/sar-stand-items") @RequestMapping("/api/SarStandItems/sar-stand-items")
public class SarStandItemsController extends BaseController<SarStandItems> { public class SarStandItemsController extends BaseController<SarStandItems> {
@Autowired @Autowired
@@ -37,7 +34,7 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
@ApiOperation(value = "分解单查询") @ApiOperation(value = "分解单查询")
@GetMapping("/findAllItems") @GetMapping("/findAllItems")
public ResponseMessage findAllItems( String type,String ids){ public ResponseMessage findAllItems( @RequestParam("type") String type,@RequestParam("ids") String ids){
if (!StringUtils.isEmpty(ids) && ids.contains(",")){ if (!StringUtils.isEmpty(ids) && ids.contains(",")){
String[] Sids=ids.split(","); String[] Sids=ids.split(",");
List<SarStandItemsDto> ItemDto = ServiceImpl.findAllItems(type,Sids); List<SarStandItemsDto> ItemDto = ServiceImpl.findAllItems(type,Sids);
@@ -10,6 +10,7 @@ import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; 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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -75,10 +76,10 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
@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){
List<SarStandProjectLibrary> list1 = sarStandProjectLibraryService.queryProjectManager((current-1)*pageSize,pageSize); IPage<SarStandProjectLibrary> list1 = sarStandProjectLibraryService.queryProjectManager(current,pageSize);
// 创建一个新的list集合,用于存储去重后的元素 // 创建一个新的list集合,用于存储去重后的元素
List<productLineDto> listTemp = new ArrayList(); List<productLineDto> listTemp = new ArrayList();
for (SarStandProjectLibrary sarStandProjectLibrary:list1){ for (SarStandProjectLibrary sarStandProjectLibrary:list1.getRecords()){
productLineDto p = new productLineDto(); productLineDto p = new productLineDto();
p.setProductLine(sarStandProjectLibrary.getProductLine()); p.setProductLine(sarStandProjectLibrary.getProductLine());
p.setUName(sarStandProjectLibrary.getUName()); p.setUName(sarStandProjectLibrary.getUName());
@@ -86,8 +87,14 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
p.setSarStandProjectLibraries(list2); p.setSarStandProjectLibraries(list2);
listTemp.add(p); listTemp.add(p);
} }
System.out.println(listTemp); IPage<productLineDto> iPage = new Page<>();
return Result.success("200",listTemp); iPage.setRecords(listTemp);
iPage.setCurrent(list1.getCurrent());
iPage.setSize(list1.getSize());
iPage.setTotal(list1.getTotal());
iPage.setPages(list1.getPages());
return Result.success("200",iPage);
} }
} }
@@ -2,6 +2,8 @@ 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.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@@ -14,6 +16,6 @@ import java.util.List;
* @since 2021-06-15 * @since 2021-06-15
*/ */
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> { public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
List<SarStandProjectLibrary> queryProjectManager(int current, int pageSize); List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
} }
@@ -11,6 +11,6 @@ public interface SarStandProjectLibraryService {
IPage<SarStandProjectLibrary> queryMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto); IPage<SarStandProjectLibrary> queryMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto);
IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto); IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto);
List<SarStandProjectLibrary> queryById(String id); List<SarStandProjectLibrary> queryById(String id);
List<SarStandProjectLibrary> queryProjectManager(int current, int pageSize); IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize);
List<SarStandProjectLibrary> queryByProductLine(String productLine); List<SarStandProjectLibrary> queryByProductLine(String productLine);
} }
@@ -1,5 +1,6 @@
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.sarStandProjectLibrary.entity.SarStandProjectLibrary;
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.entity.SarStandProjectLibraryDto;
@@ -125,11 +126,12 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
} }
@Override @Override
public List<SarStandProjectLibrary> queryProjectManager(int current, int pageSize) { public IPage<SarStandProjectLibrary> queryProjectManager(int current, int pageSize) {
// QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>(); QueryWrapper<SarStandProjectLibrary> wrapper = new QueryWrapper<>();
// wrapper.select("product_line","project_manager"); wrapper.groupBy("product_line");
// wrapper.groupBy("product_line"); IPage<SarStandProjectLibrary> list = sarStandProjectLibraryDao.selectPage(new Page<>(current,pageSize),wrapper);
List<SarStandProjectLibrary> list = sarStandProjectLibraryDao.queryProjectManager(current,pageSize); List<SarStandProjectLibrary> libraryIPage=sarStandProjectLibraryDao.queryProjectManagerPage((current-1)*pageSize,current*pageSize);
list.setRecords(libraryIPage);
return list; return list;
} }
@@ -3,7 +3,7 @@
<mapper namespace="com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao"> <mapper namespace="com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao">
<select id="queryProjectManager" 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