|
|
@ -1,16 +1,22 @@
|
|
|
|
package com.dsic.gj_erp.controller.zyjh;
|
|
|
|
package com.dsic.gj_erp.controller.zyjh;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
import com.dsic.gj_erp.bean.pgd.PgdSljh;
|
|
|
|
import com.dsic.gj_erp.bean.zyjh.YcldwInfo;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.controller.zyjh.dto.DaoDuo;
|
|
|
|
import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao;
|
|
|
|
import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao;
|
|
|
|
import com.dsic.gj_erp.mapper.zyjh.YcldwMapper;
|
|
|
|
import com.dsic.gj_erp.controller.zyjh.dto.SljhSearch;
|
|
|
|
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
|
|
|
|
import com.dsic.gj_erp.exception.CustomException;
|
|
|
|
import com.dsic.gj_erp.service.pgd.PgdSljhService;
|
|
|
|
import com.dsic.gj_erp.service.zyjh.YcldwInfoService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.zyjh.YcldwService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.service.zyjh.ZyjhService;
|
|
|
|
|
|
|
|
import com.dsic.gj_erp.ws.WsHandler;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -20,21 +26,30 @@ import java.util.List;
|
|
|
|
@AllArgsConstructor
|
|
|
|
@AllArgsConstructor
|
|
|
|
public class ZyjhController {
|
|
|
|
public class ZyjhController {
|
|
|
|
|
|
|
|
|
|
|
|
private final DmYdjhService ydjhService;
|
|
|
|
private final ZyjhService zyjhService;
|
|
|
|
|
|
|
|
|
|
|
|
private final PgdSljhService pgdSljhService;
|
|
|
|
private final YcldwService ycldwService;
|
|
|
|
|
|
|
|
|
|
|
|
private final YcldwMapper ycldwMapper;
|
|
|
|
private final YcldwInfoService ycldwInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final WsHandler wsHandler;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取上料计划
|
|
|
|
* 获取上料计划,所有派工单数据整合到月度计划中统一管理,
|
|
|
|
|
|
|
|
* 单独的派工单页面需要进行调整,从月度计划中获取对应工序数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("sljh")
|
|
|
|
@PostMapping("sljh")
|
|
|
|
public ResultBean<?> sljh(){
|
|
|
|
public ResultBean<?> sljh(@RequestBody SljhSearch search){
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
List<DmYdjh> list = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
if (StrUtil.isAllNotEmpty(search.getSljhrq())){
|
|
|
|
.le(DmYdjh::getSlrq, date)
|
|
|
|
date=search.getSljhrq();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
|
|
|
.le(DmYdjh::getSljhrq, date)
|
|
|
|
.eq(DmYdjh::getZt, "2")
|
|
|
|
.eq(DmYdjh::getZt, "2")
|
|
|
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getDcch()),DmYdjh::getDcCh, search.getDcch())
|
|
|
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getPl()),DmYdjh::getDcPl, search.getPl())
|
|
|
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getKw()),DmYdjh::getKw, search.getKw())
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return new ResultBean<>(list);
|
|
|
|
return new ResultBean<>(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -44,12 +59,42 @@ public class ZyjhController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("ycldw")
|
|
|
|
@PostMapping("ycldw")
|
|
|
|
public ResultBean<?> ycldw(){
|
|
|
|
public ResultBean<?> ycldw(){
|
|
|
|
return new ResultBean<>(ycldwMapper.ycldwList());
|
|
|
|
return new ResultBean<>(ycldwService.ycldwList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("sl")
|
|
|
|
@PostMapping("sl")
|
|
|
|
public ResultBean<?> sl(@RequestBody ShangLiao sl){
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
public ResultBean<?> sl(@RequestBody ShangLiao sl) throws CustomException {
|
|
|
|
|
|
|
|
if (!sl.checkCkwp()){
|
|
|
|
|
|
|
|
//throw new CustomException(10009,"物品库存不存在,或库存信息错误");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新预处理垛位信息
|
|
|
|
|
|
|
|
YcldwInfo info=ycldwInfoService.updateForSl(sl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新月度计划上料相关字段
|
|
|
|
|
|
|
|
zyjhService.updateForSl(sl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//todo 更新库存信息
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wsHandler.sendSlComplete((JSONObject)JSONObject.toJSON(info));
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 倒垛
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping("daoduo")
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
|
|
|
public ResultBean<?> daoduo(@RequestBody DaoDuo dd){
|
|
|
|
|
|
|
|
if (dd.getLastCeng()!=dd.getCeng()||dd.getLastDuo()!=dd.getDuo()){
|
|
|
|
|
|
|
|
int moveY=dd.getLastCeng()-dd.getCeng();
|
|
|
|
|
|
|
|
int y=moveY>0?1:-1;
|
|
|
|
|
|
|
|
for (YcldwInfo info:dd.getMovedList()){
|
|
|
|
|
|
|
|
ycldwInfoService.daoduo(info.getId(),y);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ycldwInfoService.daoduo(dd.getId(),dd.getCeng());
|
|
|
|
|
|
|
|
}
|
|
|
|
return new ResultBean<>();
|
|
|
|
return new ResultBean<>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|