|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import com.dsic.gj_erp.annotation.AuthFunction;
|
|
|
|
|
import com.dsic.gj_erp.bean.ResultBean;
|
|
|
|
|
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
|
|
|
|
|
import com.dsic.gj_erp.bean.zyjh.YcldwInfo;
|
|
|
|
@ -18,6 +19,7 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -60,6 +62,36 @@ public class ZyjhController {
|
|
|
|
|
throw new ServiceException(10001,"属性字段不存在");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@PostMapping("zxweb")
|
|
|
|
|
public ResultBean<?> zxweb(@RequestBody PgDto dto,HttpServletRequest request) {
|
|
|
|
|
if (StrUtil.isEmpty(dto.getZxZtName())) {
|
|
|
|
|
throw new ServiceException(10001,"作业计划执行内容不能为空");
|
|
|
|
|
}
|
|
|
|
|
List<DmYdjh> list=dto.getList();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
Field field=DmYdjh.class.getDeclaredField(dto.getField());
|
|
|
|
|
Field fieldry=DmYdjh.class.getDeclaredField(dto.getFieldry());
|
|
|
|
|
if (ObjUtil.isNotEmpty(field)){
|
|
|
|
|
field.setAccessible(true);
|
|
|
|
|
String date=DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
for(DmYdjh dmYdjh:list){
|
|
|
|
|
field.set(dmYdjh,date);
|
|
|
|
|
dmYdjh.setZtByZyjhzx(dto.getZxZtName());
|
|
|
|
|
|
|
|
|
|
if(ObjUtil.isNotEmpty(fieldry)){
|
|
|
|
|
fieldry.setAccessible(true);
|
|
|
|
|
fieldry.set(dmYdjh,request.getAttribute("yhms"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
zyjhService.updateBatchById(list);
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
|
|
|
|
throw new ServiceException(10001,"属性字段不存在");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 派工单查询
|
|
|
|
@ -71,6 +103,7 @@ public class ZyjhController {
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getField()),search.getField(),search.getUser())
|
|
|
|
|
.isNull(StrUtil.isEmpty(search.getField()),search.getField())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getZt()),"zt",search.getZt())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getDcch()),"dcch",search.getDcch())
|
|
|
|
|
.le(StrUtil.isNotEmpty(search.getJhrqField()),search.getJhrqField(), DateUtil.date().toString("yyyy/MM/dd"))
|
|
|
|
|
//跟踪查询
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getXqrq()),"xqrq",search.getXqrq())
|
|
|
|
@ -79,6 +112,22 @@ public class ZyjhController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("pgdweb")
|
|
|
|
|
@AuthFunction
|
|
|
|
|
public ResultBean<?> pgdweb(@RequestBody PgdSearch search){
|
|
|
|
|
List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>query()
|
|
|
|
|
//执行查询
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getField()),search.getField(),search.getUser())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getZt()),"zt",search.getZt())
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getDcch()),"dcch",search.getDcch())
|
|
|
|
|
.le(StrUtil.isNotEmpty(search.getJhrqField()),search.getJhrqField(), DateUtil.date().toString("yyyy/MM/dd"))
|
|
|
|
|
//跟踪查询
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getXqrq()),"xqrq",search.getXqrq())
|
|
|
|
|
);
|
|
|
|
|
return new ResultBean<>(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取上料计划,所有派工单数据整合到月度计划中统一管理,
|
|
|
|
|
* 单独的派工单页面需要进行调整,从月度计划中获取对应工序数据
|
|
|
|
@ -91,7 +140,7 @@ public class ZyjhController {
|
|
|
|
|
}
|
|
|
|
|
List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
.le(DmYdjh::getSljhrq, date)
|
|
|
|
|
.eq(DmYdjh::getZt, "2")
|
|
|
|
|
.eq(StrUtil.isNotEmpty(search.getZt()),DmYdjh::getZt, search.getZt())
|
|
|
|
|
.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())
|
|
|
|
@ -99,6 +148,22 @@ public class ZyjhController {
|
|
|
|
|
return new ResultBean<>(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @PostMapping("sljhWeb")
|
|
|
|
|
// public ResultBean<?> sljhWeb(@RequestBody SljhSearch search){
|
|
|
|
|
// String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
// if (StrUtil.isAllNotEmpty(search.getSljhrq())){
|
|
|
|
|
// date=search.getSljhrq();
|
|
|
|
|
// }
|
|
|
|
|
// List<DmYdjh> list = zyjhService.list(Wrappers.<DmYdjh>lambdaQuery()
|
|
|
|
|
// .le(DmYdjh::getSljhrq, date)
|
|
|
|
|
// .eq(StrUtil.isNotEmpty(search.getDcch()),DmYdjh::getZt, search.getZt())
|
|
|
|
|
// .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);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取预处理垛位信息
|
|
|
|
|
*/
|
|
|
|
@ -107,6 +172,53 @@ public class ZyjhController {
|
|
|
|
|
return new ResultBean<>(ycldwService.ycldwList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("slweb")
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@AuthFunction
|
|
|
|
|
public ResultBean<?> slweb(@RequestBody List<DmYdjh> ydjhs, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
for(DmYdjh dmYdjh :ydjhs){
|
|
|
|
|
ShangLiao shangLiao = new ShangLiao();
|
|
|
|
|
dmYdjh.setSlfkrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd HH:mm:ss"));
|
|
|
|
|
dmYdjh.setSlfkry( (String) request.getAttribute("yhms"));
|
|
|
|
|
shangLiao.setYdjh(dmYdjh);
|
|
|
|
|
// shangLiao.setCkwpkwp();
|
|
|
|
|
// shangLiao.setPgdId();
|
|
|
|
|
shangLiao.setDwId(dmYdjh.getSlkcdw());
|
|
|
|
|
shangLiao.setCeng(dmYdjh.getSlcs());
|
|
|
|
|
shangLiao.setCzbh(dmYdjh.getDcCh());
|
|
|
|
|
shangLiao.setPl(dmYdjh.getDcPl());
|
|
|
|
|
shangLiao.setFd(dmYdjh.getDcFd());
|
|
|
|
|
shangLiao.setKw(dmYdjh.getKw());
|
|
|
|
|
shangLiao.setZl(dmYdjh.getZl());
|
|
|
|
|
shangLiao.setTlth(dmYdjh.getTzbh());
|
|
|
|
|
// shangLiao.setWph(dmYdjh.getm);
|
|
|
|
|
shangLiao.setWpgg(dmYdjh.getWpgg());
|
|
|
|
|
shangLiao.setSljhrq(dmYdjh.getSljhrq());
|
|
|
|
|
shangLiao.setQgjhrq(dmYdjh.getSljhrq());
|
|
|
|
|
shangLiao.setBfr( (String) request.getAttribute("yhms"));
|
|
|
|
|
//更新预处理垛位信息
|
|
|
|
|
if (!shangLiao.checkCkwp()){
|
|
|
|
|
//throw new ServiceException(10009,"物品库存不存在,或库存信息错误");
|
|
|
|
|
}
|
|
|
|
|
YcldwInfo info=ycldwInfoService.updateForSl(shangLiao);
|
|
|
|
|
|
|
|
|
|
//更新月度计划上料相关字段
|
|
|
|
|
zyjhService.updateForSl(shangLiao);
|
|
|
|
|
|
|
|
|
|
//todo 更新库存信息
|
|
|
|
|
|
|
|
|
|
wsHandler.sendSlComplete((JSONObject)JSONObject.toJSON(info));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 上料
|
|
|
|
|
*/
|
|
|
|
|