请领单、退货单提交必须有物料检测
This commit is contained in:
parent
5584085a2e
commit
4a38ac5397
|
|
@ -293,14 +293,14 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测是否有物料
|
//检测是否有物料
|
||||||
// QueryWrapper<NuInvoicingQldInfo> infoQW = new QueryWrapper<>();
|
QueryWrapper<NuInvoicingQldInfo> infoQW = new QueryWrapper<>();
|
||||||
// infoQW.eq("qld_no", dto.getQldNo());
|
infoQW.eq("qld_no", dto.getQldNo());
|
||||||
// List<NuInvoicingQldInfo> infoList = invoicingQldInfoMapper.selectList(infoQW);
|
List<NuInvoicingQldInfo> infoList = invoicingQldInfoMapper.selectList(infoQW);
|
||||||
// if (CollectionUtils.isEmpty(infoList)) {
|
if (CollectionUtils.isEmpty(infoList)) {
|
||||||
// result.put("status", "faild");
|
result.put("status", "faild");
|
||||||
// result.put("message", "不存在物料,无法提交");
|
result.put("message", "不存在物料,无法提交");
|
||||||
// return result;
|
return result;
|
||||||
// }
|
}
|
||||||
|
|
||||||
//回退单-提交
|
//回退单-提交
|
||||||
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
QueryWrapper<NuInvoicingQldMain> qw = new QueryWrapper<>();
|
||||||
|
|
@ -370,11 +370,11 @@ public class QingLingServiceImpl implements IQinglingApi {
|
||||||
List<NuInvoicingQldGwc> gwcList = invoicingQldGwcService.list(gwcQW);
|
List<NuInvoicingQldGwc> gwcList = invoicingQldGwcService.list(gwcQW);
|
||||||
|
|
||||||
//请购车未添加物料
|
//请购车未添加物料
|
||||||
// if (CollectionUtils.isEmpty(gwcList)) {
|
if (CollectionUtils.isEmpty(gwcList)) {
|
||||||
// result.put("status", "empty");
|
result.put("status", "empty");
|
||||||
// result.put("message", "请选择请领物料");
|
result.put("message", "请选择请领物料");
|
||||||
// return result;
|
return result;
|
||||||
// }
|
}
|
||||||
|
|
||||||
//检测哪些“物料”有未完成请领流程的
|
//检测哪些“物料”有未完成请领流程的
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -276,8 +276,8 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
//指令工单处判断是否允许提交
|
//指令工单处判断是否允许提交
|
||||||
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
InvoicingOrdersEntity p_ = new InvoicingOrdersEntity();
|
||||||
p_.setPoolId(dto.getId());
|
p_.setPoolId(dto.getId());
|
||||||
Map<String, String> j = invoicingThOrdersApi.izCanSubmit(p_);
|
Map<String,String> j = invoicingThOrdersApi.izCanSubmit(p_);
|
||||||
if (!j.get("error_code").equals("0")) {
|
if(!j.get("error_code").equals("0")){
|
||||||
result.put("status", "nodeError");
|
result.put("status", "nodeError");
|
||||||
result.put("message", j.get("msg"));
|
result.put("message", j.get("msg"));
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -310,11 +310,11 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
// return result;
|
// return result;
|
||||||
// }
|
// }
|
||||||
//未添加退货物料检测
|
//未添加退货物料检测
|
||||||
// if (CollectionUtils.isEmpty(gwcList)) {
|
if (CollectionUtils.isEmpty(gwcList)) {
|
||||||
// result.put("status", "faild");
|
result.put("status", "faild");
|
||||||
// result.put("message", "未添加物料");
|
result.put("message", "未添加物料");
|
||||||
// return result;
|
return result;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理数据 主表当前数据:main
|
//处理数据 主表当前数据:main
|
||||||
|
|
@ -373,7 +373,7 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
thdMainMapper.updateById(main);
|
thdMainMapper.updateById(main);
|
||||||
|
|
||||||
//购物车数据 挪到info表里
|
//购物车数据 挪到info表里
|
||||||
if (!CollectionUtils.isEmpty(gwcList)) {
|
//========================================================================
|
||||||
wlList = gwcList.stream().map(NuInvoicingThdGwc::getWlId).collect(Collectors.toList());
|
wlList = gwcList.stream().map(NuInvoicingThdGwc::getWlId).collect(Collectors.toList());
|
||||||
|
|
||||||
//查出对应物料信息存储到info表和日志表中
|
//查出对应物料信息存储到info表和日志表中
|
||||||
|
|
@ -410,6 +410,17 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
infoList.add(info);
|
infoList.add(info);
|
||||||
}
|
}
|
||||||
thdInfoService.saveBatch(infoList);
|
thdInfoService.saveBatch(infoList);
|
||||||
|
//========================================================================
|
||||||
|
//日志记录
|
||||||
|
NuInvoicingThdLog logData = new NuInvoicingThdLog();
|
||||||
|
logData.setThdId(dto.getId());//退货指令id
|
||||||
|
logData.setThdNo(thdNo);//退货单号
|
||||||
|
logData.setStatus(status);//操作状态
|
||||||
|
logData.setOpeBy(sysUser.getId());//操作人
|
||||||
|
logData.setOpeTime(new Date());//操作时间
|
||||||
|
logData.setNuId(main.getNuId());//护理单元id
|
||||||
|
logData.setElderId(main.getElderId());//长者id
|
||||||
|
thdLogMapper.insert(logData);
|
||||||
|
|
||||||
//库房出入库日志+库存
|
//库房出入库日志+库存
|
||||||
{
|
{
|
||||||
|
|
@ -527,17 +538,6 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//日志记录
|
|
||||||
NuInvoicingThdLog logData = new NuInvoicingThdLog();
|
|
||||||
logData.setThdId(dto.getId());//退货指令id
|
|
||||||
logData.setThdNo(thdNo);//退货单号
|
|
||||||
logData.setStatus(status);//操作状态
|
|
||||||
logData.setOpeBy(sysUser.getId());//操作人
|
|
||||||
logData.setOpeTime(new Date());//操作时间
|
|
||||||
logData.setNuId(main.getNuId());//护理单元id
|
|
||||||
logData.setElderId(main.getElderId());//长者id
|
|
||||||
thdLogMapper.insert(logData);
|
|
||||||
}
|
|
||||||
|
|
||||||
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
InvoicingOrdersEntity orderEntity = new InvoicingOrdersEntity();
|
||||||
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号(入库时才生成的退货单号)
|
orderEntity.setPoolId(dto.getId());//退货主表id 入库时会根据更新为对应退货单号(入库时才生成的退货单号)
|
||||||
|
|
@ -642,10 +642,10 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Map<String, String> requireTH(InvoicingThdMainEntity dto) {
|
public Map<String,String> requireTH(InvoicingThdMainEntity dto) {
|
||||||
Map<String, String> map = new HashMap();
|
Map<String,String> map = new HashMap();
|
||||||
map.put("error_code", "0");
|
map.put("error_code","0");
|
||||||
map.put("msg", "操作成功");
|
map.put("msg","操作成功");
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
String status = "0";//发起待执行
|
String status = "0";//发起待执行
|
||||||
|
|
||||||
|
|
@ -654,9 +654,9 @@ public class ThdServiceImpl implements ITuiHuoApi {
|
||||||
qw.eq("elder_id", dto.getElderId());
|
qw.eq("elder_id", dto.getElderId());
|
||||||
qw.eq("status", status);
|
qw.eq("status", status);
|
||||||
NuInvoicingThdMain qwMain = thdMainMapper.selectOne(qw);
|
NuInvoicingThdMain qwMain = thdMainMapper.selectOne(qw);
|
||||||
if (qwMain != null) {
|
if(qwMain!=null){
|
||||||
map.put("error_code", "1");
|
map.put("error_code","1");
|
||||||
map.put("msg", "退货单已存在");
|
map.put("msg","退货单已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
NuInvoicingThdMain main = new NuInvoicingThdMain();
|
NuInvoicingThdMain main = new NuInvoicingThdMain();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue