首页跳转修改
This commit is contained in:
parent
a896dbd22e
commit
c09b3ab368
|
|
@ -16,6 +16,8 @@ import com.nflg.product.material.service.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import nflg.product.common.vo.ResultVO;
|
import nflg.product.common.vo.ResultVO;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
@ -39,6 +41,7 @@ import java.util.stream.Collectors;
|
||||||
@Api(tags = "主数据平台首页")
|
@Api(tags = "主数据平台首页")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("home")
|
@RequestMapping("home")
|
||||||
|
@RefreshScope
|
||||||
public class MaterialHomeApi extends BaseApi {
|
public class MaterialHomeApi extends BaseApi {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -62,6 +65,9 @@ public class MaterialHomeApi extends BaseApi {
|
||||||
@Resource
|
@Resource
|
||||||
private StandardCategoryService standardCategoryService;
|
private StandardCategoryService standardCategoryService;
|
||||||
|
|
||||||
|
@Value("${material.home.day:30}")
|
||||||
|
private Integer homeDay;
|
||||||
|
|
||||||
@GetMapping("materialManagement")
|
@GetMapping("materialManagement")
|
||||||
@ApiOperation("物料管理")
|
@ApiOperation("物料管理")
|
||||||
public ResultVO<Map<String,List<MaterialHomeMainVO>>> materialManagement(){
|
public ResultVO<Map<String,List<MaterialHomeMainVO>>> materialManagement(){
|
||||||
|
|
@ -88,7 +94,7 @@ public class MaterialHomeApi extends BaseApi {
|
||||||
@ApiOperation("标准部件")
|
@ApiOperation("标准部件")
|
||||||
public ResultVO<Map<String, List<StandardPartPickRuleHomeVO>>> standardPartList(){
|
public ResultVO<Map<String, List<StandardPartPickRuleHomeVO>>> standardPartList(){
|
||||||
//仅取90天内的数据
|
//仅取90天内的数据
|
||||||
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
Date date90 = DateUtil.offsetDay(new Date(),-homeDay);
|
||||||
|
|
||||||
Map<String, List<StandardPartPickRuleHomeVO>> mp = Maps.newHashMap();
|
Map<String, List<StandardPartPickRuleHomeVO>> mp = Maps.newHashMap();
|
||||||
AuthorityDepartmentEntity auDept = authorityDepartmentService.getById(SessionUtil.getPartRowId());
|
AuthorityDepartmentEntity auDept = authorityDepartmentService.getById(SessionUtil.getPartRowId());
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,17 @@ public class MaterialHomeMainVO implements Serializable {
|
||||||
@ApiModelProperty(value = "物料名称")
|
@ApiModelProperty(value = "物料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料分类编码")
|
||||||
|
private String materialCategoryCode;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "对应的物料大类")
|
||||||
|
private String relCategoryCode;
|
||||||
|
|
||||||
@ApiModelProperty(value = "流程状态")
|
@ApiModelProperty(value = "流程状态")
|
||||||
private Integer processState;
|
private Integer processState;
|
||||||
|
|
||||||
@ApiModelProperty(value = "流程状态名称")
|
@ApiModelProperty(value = "流程状态名称")
|
||||||
private String processStateName;
|
private String processStateName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -161,6 +161,9 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
||||||
@Resource
|
@Resource
|
||||||
private ConnectPooled connectPooled;
|
private ConnectPooled connectPooled;
|
||||||
|
|
||||||
|
@Value("${material.home.day:30}")
|
||||||
|
private Integer homeDay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询所有数据
|
* 分页查询所有数据
|
||||||
*
|
*
|
||||||
|
|
@ -2886,8 +2889,8 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
||||||
*/
|
*/
|
||||||
public List<MaterialHomeMainVO> listByHome(Integer processState,Integer limitNums){
|
public List<MaterialHomeMainVO> listByHome(Integer processState,Integer limitNums){
|
||||||
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
||||||
//仅取90天内的数据
|
//仅取30天内的数据
|
||||||
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
Date date90 = DateUtil.offsetDay(new Date(),-homeDay);
|
||||||
LambdaQueryWrapper<MaterialMainEntity> lw = Wrappers.<MaterialMainEntity>lambdaQuery()
|
LambdaQueryWrapper<MaterialMainEntity> lw = Wrappers.<MaterialMainEntity>lambdaQuery()
|
||||||
.eq(MaterialMainEntity::getCreatedBy, SessionUtil.getUserCode());
|
.eq(MaterialMainEntity::getCreatedBy, SessionUtil.getUserCode());
|
||||||
//消息提醒,仅获取已驳回的记录
|
//消息提醒,仅获取已驳回的记录
|
||||||
|
|
@ -2895,18 +2898,27 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
||||||
lw.eq(MaterialMainEntity::getProcessState,processState);
|
lw.eq(MaterialMainEntity::getProcessState,processState);
|
||||||
lw.ge(MaterialMainEntity::getRejectTime,date90).orderByDesc(MaterialMainEntity::getRejectTime);
|
lw.ge(MaterialMainEntity::getRejectTime,date90).orderByDesc(MaterialMainEntity::getRejectTime);
|
||||||
}else{
|
}else{
|
||||||
lw.ge(MaterialMainEntity::getCreatedTime,date90).orderByDesc(MaterialMainEntity::getCreatedTime);
|
lw.ge(MaterialMainEntity::getCreatedTime,date90)
|
||||||
|
.orderByAsc(MaterialMainEntity::getProcessState).orderByDesc(MaterialMainEntity::getCreatedTime);
|
||||||
}
|
}
|
||||||
lw.last(String.format("limit %d",limitNums));
|
lw.last(String.format("limit %d",limitNums));
|
||||||
|
|
||||||
List<MaterialMainEntity> mainList = this.list(lw);
|
List<MaterialMainEntity> mainList = this.list(lw);
|
||||||
|
|
||||||
if(!mainList.isEmpty()){
|
if(!mainList.isEmpty()){
|
||||||
|
List<String> categoryCodeList = mainList.stream().map(MaterialMainEntity::getMaterialCategoryCode)
|
||||||
|
.distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<MaterialCategoryEntity> categoryList = materialCategoryService.list(Wrappers.<MaterialCategoryEntity>lambdaQuery()
|
||||||
|
.in(MaterialCategoryEntity::getCategoryCode,categoryCodeList));
|
||||||
|
Map<String,String> categoryMap = categoryList.stream().collect(Collectors
|
||||||
|
.toMap(MaterialCategoryEntity::getCategoryCode,MaterialCategoryEntity::getRelCategoryCode,(k1,k2)->k1));
|
||||||
|
|
||||||
rlist = Convert.toList(MaterialHomeMainVO.class,mainList);
|
rlist = Convert.toList(MaterialHomeMainVO.class,mainList);
|
||||||
rlist.forEach(r -> r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState()))
|
rlist.forEach(r -> {
|
||||||
.map(MaterialProcessStateEnum::getDescription).orElse("") ));
|
r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState()))
|
||||||
|
.map(MaterialProcessStateEnum::getDescription).orElse("") );
|
||||||
|
r.setRelCategoryCode(categoryMap.getOrDefault(r.getMaterialCategoryCode(),""));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return rlist;
|
return rlist;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ import nflg.product.common.vo.ResultVO;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
@ -84,6 +85,9 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
||||||
@Resource
|
@Resource
|
||||||
AuthorityDepartmentService departmentService;
|
AuthorityDepartmentService departmentService;
|
||||||
|
|
||||||
|
@Value("${material.home.day:30}")
|
||||||
|
private Integer homeDay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询所有数据
|
* 分页查询所有数据
|
||||||
*
|
*
|
||||||
|
|
@ -975,7 +979,7 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
||||||
public List<MaterialHomeMainVO> listByHome(Integer billState,Integer limitNums){
|
public List<MaterialHomeMainVO> listByHome(Integer billState,Integer limitNums){
|
||||||
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
List<MaterialHomeMainVO> rlist = Lists.newArrayList();
|
||||||
//仅取90天内的数据
|
//仅取90天内的数据
|
||||||
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
Date date90 = DateUtil.offsetDay(new Date(),-homeDay);
|
||||||
|
|
||||||
LambdaQueryWrapper<MaterialUpdateBillEntity> lw = Wrappers.<MaterialUpdateBillEntity>lambdaQuery()
|
LambdaQueryWrapper<MaterialUpdateBillEntity> lw = Wrappers.<MaterialUpdateBillEntity>lambdaQuery()
|
||||||
.eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode());
|
.eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode());
|
||||||
|
|
@ -987,16 +991,12 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
||||||
.orderByDesc(MaterialUpdateBillEntity::getRejectTime);
|
.orderByDesc(MaterialUpdateBillEntity::getRejectTime);
|
||||||
}else{
|
}else{
|
||||||
lw.ge(MaterialUpdateBillEntity::getCreatedTime,date90)
|
lw.ge(MaterialUpdateBillEntity::getCreatedTime,date90)
|
||||||
|
.orderByAsc(MaterialUpdateBillEntity::getBillState)
|
||||||
.orderByDesc(MaterialUpdateBillEntity::getCreatedTime);
|
.orderByDesc(MaterialUpdateBillEntity::getCreatedTime);
|
||||||
}
|
}
|
||||||
lw.last(String.format("limit %d",limitNums));
|
lw.last(String.format("limit %d",limitNums));
|
||||||
|
|
||||||
List<MaterialUpdateBillEntity> entityList = this.list(Wrappers.<MaterialUpdateBillEntity>lambdaQuery()
|
List<MaterialUpdateBillEntity> entityList = this.list(lw);
|
||||||
.eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode())
|
|
||||||
.eq(null != billState,MaterialUpdateBillEntity::getBillState,billState)
|
|
||||||
.ge(MaterialUpdateBillEntity::getCreatedTime,date90)
|
|
||||||
.orderByDesc(MaterialUpdateBillEntity::getCreatedTime)
|
|
||||||
.last(String.format("limit %d",limitNums)));
|
|
||||||
if(!entityList.isEmpty()){
|
if(!entityList.isEmpty()){
|
||||||
entityList.forEach(e -> {
|
entityList.forEach(e -> {
|
||||||
MaterialHomeMainVO r = Convert.convert(MaterialHomeMainVO.class,e);
|
MaterialHomeMainVO r = Convert.convert(MaterialHomeMainVO.class,e);
|
||||||
|
|
@ -1006,6 +1006,7 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
|
||||||
r.setProcessState(e.getBillState());
|
r.setProcessState(e.getBillState());
|
||||||
r.setProcessStateName(Optional.ofNullable(MaterialUpdateBillStateEnum.findDescriptionByValue(e.getBillState()))
|
r.setProcessStateName(Optional.ofNullable(MaterialUpdateBillStateEnum.findDescriptionByValue(e.getBillState()))
|
||||||
.map(MaterialUpdateBillStateEnum::getDescription).orElse(""));
|
.map(MaterialUpdateBillStateEnum::getDescription).orElse(""));
|
||||||
|
r.setMaterialCategoryCode(Optional.ofNullable(e.getNewCategoryCode()).orElse(e.getOldCategoryCode()));
|
||||||
rlist.add(r);
|
rlist.add(r);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import nflg.product.common.vo.ResultVO;
|
import nflg.product.common.vo.ResultVO;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.ttzero.excel.entity.ListSheet;
|
import org.ttzero.excel.entity.ListSheet;
|
||||||
|
|
@ -81,6 +82,9 @@ public class EbomApi extends BaseApi {
|
||||||
@Resource
|
@Resource
|
||||||
private BomNewNoticeNumService bomNewNoticeNumService;
|
private BomNewNoticeNumService bomNewNoticeNumService;
|
||||||
|
|
||||||
|
@Value("${material.home.day:30}")
|
||||||
|
private Integer homeDay;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("workDetailsListByPage")
|
@PostMapping("workDetailsListByPage")
|
||||||
@ApiOperation("Ebom-工作明细列表")
|
@ApiOperation("Ebom-工作明细列表")
|
||||||
|
|
@ -567,11 +571,12 @@ public class EbomApi extends BaseApi {
|
||||||
public ResultVO<Map<String,List<BomNewHomeBomVO>>> byHome(){
|
public ResultVO<Map<String,List<BomNewHomeBomVO>>> byHome(){
|
||||||
Map<String,List<BomNewHomeBomVO>> mp = Maps.newHashMap();
|
Map<String,List<BomNewHomeBomVO>> mp = Maps.newHashMap();
|
||||||
//仅取90天内的数据
|
//仅取90天内的数据
|
||||||
Date date90 = DateUtil.offsetDay(new Date(),-90);
|
Date date90 = DateUtil.offsetDay(new Date(),-homeDay);
|
||||||
int limitNums = 5;
|
int limitNums = 5;
|
||||||
List<BomNewEbomParentEntity> eList = bomNewEbomParentService.list(Wrappers.<BomNewEbomParentEntity>lambdaQuery()
|
List<BomNewEbomParentEntity> eList = bomNewEbomParentService.list(Wrappers.<BomNewEbomParentEntity>lambdaQuery()
|
||||||
.eq(BomNewEbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
.eq(BomNewEbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
||||||
.ge(BomNewEbomParentEntity::getCreatedTime,date90)
|
.ge(BomNewEbomParentEntity::getCreatedTime,date90)
|
||||||
|
.orderByAsc(BomNewEbomParentEntity::getEditStatus)
|
||||||
.orderByDesc(BomNewEbomParentEntity::getCreatedTime)
|
.orderByDesc(BomNewEbomParentEntity::getCreatedTime)
|
||||||
.last(String.format("limit %d",limitNums)));
|
.last(String.format("limit %d",limitNums)));
|
||||||
List<BomNewHomeBomVO> ebomList = Convert.toList(BomNewHomeBomVO.class,eList);
|
List<BomNewHomeBomVO> ebomList = Convert.toList(BomNewHomeBomVO.class,eList);
|
||||||
|
|
@ -581,6 +586,7 @@ public class EbomApi extends BaseApi {
|
||||||
List<BomNewPbomParentEntity> pList = bomNewPbomParentService.list(Wrappers.<BomNewPbomParentEntity>lambdaQuery()
|
List<BomNewPbomParentEntity> pList = bomNewPbomParentService.list(Wrappers.<BomNewPbomParentEntity>lambdaQuery()
|
||||||
.eq(BomNewPbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
.eq(BomNewPbomParentEntity::getCreatedBy,SessionUtil.getUserCode())
|
||||||
.ge(BomNewPbomParentEntity::getCreatedTime,date90)
|
.ge(BomNewPbomParentEntity::getCreatedTime,date90)
|
||||||
|
.orderByAsc(BomNewPbomParentEntity::getEditStatus)
|
||||||
.orderByDesc(BomNewPbomParentEntity::getCreatedTime)
|
.orderByDesc(BomNewPbomParentEntity::getCreatedTime)
|
||||||
.last(String.format("limit %d",limitNums)));
|
.last(String.format("limit %d",limitNums)));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue