rev:更新

This commit is contained in:
2026-07-19 10:29:03 +08:00
parent aa1dda4fa2
commit 824400397b
21 changed files with 414 additions and 387 deletions

View File

@@ -455,15 +455,21 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
throw new BadRequestException("该点位存在正在执行的任务,请核对!");
}
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getPoint_status, whereJson.getString("point_status"))
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_code, null)
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_type, "")
.set("1".equals(whereJson.getString("point_status")), SchBasePoint::getVehicle_qty, 0)
.set("2".equals(whereJson.getString("point_status")),SchBasePoint::getVehicle_code, vehicle_code)
.set("2".equals(whereJson.getString("point_status")),SchBasePoint::getVehicle_type, vehicleInfo.getStoragevehicle_type())
.set("2".equals(whereJson.getString("point_status")),SchBasePoint::getVehicle_qty, 1)
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
if ("1".equals(whereJson.getString("point_status"))) {
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getPoint_status, whereJson.getString("point_status"))
.set(SchBasePoint::getVehicle_code, "")
.set(SchBasePoint::getVehicle_type, "")
.set(SchBasePoint::getVehicle_qty, 0)
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
} else {
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
.set(SchBasePoint::getPoint_status, whereJson.getString("point_status"))
.set(SchBasePoint::getVehicle_code, vehicle_code)
.set(SchBasePoint::getVehicle_type, vehicleInfo.getStoragevehicle_type())
.set(SchBasePoint::getVehicle_qty, 1)
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code")));
}
//查询点位上的载具
List<SchBasePoint> schBasePointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()

View File

@@ -2,6 +2,7 @@ package org.nl.wms.sch_manage.service.util;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -15,6 +16,9 @@ import org.nl.wms.ext_manage.service.util.AcsResponse;
import org.nl.wms.sch_manage.enums.TaskStatus;
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.system_manage.enums.SysParamConstant;
import org.nl.wms.system_manage.service.param.ISysParamService;
import org.nl.wms.system_manage.service.param.dao.Param;
import org.nl.wms.warehouse_manage.enums.IOSConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -48,6 +52,8 @@ public abstract class AbstractTask {
private WmsToAcsService wmsToAcsService;
@Autowired
private TaskFactory taskFactory;
@Autowired
private ISysParamService sysParamService;
/**
* 任务创建
@@ -73,6 +79,27 @@ public abstract class AbstractTask {
acsTaskDto.setTask_group_seq(taskDao.getTask_group_seq());
}
/**
* AGV扫码关闭时兼容旧ACS任务类型
* 2 -> 13 -> 4开启扫码时保持原值。
*/
protected String normalizeAgvSystemType(String agvSystemType) {
if (StrUtil.isBlank(agvSystemType)) {
return agvSystemType;
}
Param param = sysParamService.findByCode(SysParamConstant.IS_OPEN_AGV_SCANNER);
if (param == null || !StrUtil.equals(param.getValue(), "0")) {
return agvSystemType;
}
if (StrUtil.equals(agvSystemType, "2")) {
return "1";
}
if (StrUtil.equals(agvSystemType, "3")) {
return "4";
}
return agvSystemType;
}
/**
* 定时任务
*/

View File

@@ -110,10 +110,10 @@ public class JbDownAgvTask extends AbstractTask {
acsTaskDto.setStart_device_code2(taskDao.getPoint_code3());
acsTaskDto.setNext_device_code2(taskDao.getPoint_code4());
// 解包出桶四点任务 -> ACS 类型 3
acsTaskDto.setAgv_system_type("3");
acsTaskDto.setAgv_system_type(normalizeAgvSystemType("3"));
} else {
// 解包出桶两点任务 -> ACS 类型 2
acsTaskDto.setAgv_system_type("2");
acsTaskDto.setAgv_system_type(normalizeAgvSystemType("2"));
}
acsTaskDto.setTask_group_id(taskDao.getTask_group_id());
acsTaskDto.setTask_group_seq(taskDao.getTask_group_seq());

View File

@@ -100,7 +100,7 @@ public class JbDownCloseUnsealingAgvTask extends AbstractTask {
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
acsTaskDto.setStart_device_code2(taskDao.getPoint_code3());
acsTaskDto.setNext_device_code2(taskDao.getPoint_code4());
acsTaskDto.setAgv_system_type("3");
acsTaskDto.setAgv_system_type(normalizeAgvSystemType("3"));
acsTaskDto.setPriority(taskDao.getPriority());
acsTaskDto.setTask_type(taskconfig.getTask_type());
acsTaskDto.setTruss_type(object.getString("truss_type"));

View File

@@ -131,7 +131,7 @@ public class SeparateMaterialTask extends AbstractTask {
acsTaskDto.setStart_device_code2(taskDao.getPoint_code3());
acsTaskDto.setNext_device_code2(taskDao.getPoint_code4());
acsTaskDto.setPriority(taskDao.getPriority());
acsTaskDto.setAgv_system_type("2");
acsTaskDto.setAgv_system_type(normalizeAgvSystemType("2"));
acsTaskDto.setTask_type("2");
fillCommonAcsTaskFields(taskDao, acsTaskDto);
return acsTaskDto;

View File

@@ -22,6 +22,11 @@ public class SysParamConstant {
*/
public final static String ACS_URL = "acs_url";
/**
* 是否开启AGV扫码识别
*/
public final static String IS_OPEN_AGV_SCANNER = "is_open_agv_scanner";
/**
* ERP系统IP
*/

View File

@@ -25,7 +25,7 @@ public enum IOSEnum {
IO_TYPE(MapOf.of("入库", "0", "出库", "1")),
//单据状态
BILL_STATUS(MapOf.of("生成", "10", "分配中", "20", "分配完", "30", "完成", "99")),
BILL_STATUS(MapOf.of("生成", "10", "审核", "15", "分配中", "20", "分配完", "30", "完成", "99")),
// 入库业务类型
BILL_TYPE(MapOf.of("生产入库", "0001", "手工入库", "0009", "解包入库", "0011", "解包直接入库", "0016", "手工出库", "1009", "解包出库", "1012")),

View File

@@ -80,6 +80,13 @@ public class OutBillController {
return new ResponseEntity<>(iOutBillService.getOutBillDis(whereJson), HttpStatus.OK);
}
@PostMapping("/audit")
@Log("出库单审核")
public ResponseEntity<Object> audit(@RequestBody JSONObject whereJson) {
iOutBillService.audit(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/allDiv")
@Log("出库单全部分配")
public ResponseEntity<Object> allDiv(@RequestBody JSONObject whereJson) {

View File

@@ -82,6 +82,13 @@ public interface IOutBillService extends IService<IOStorInv> {
*/
List<IOStorInvDisDto> getOutBillDis(Map whereJson);
/**
* 出库单审核
*
* @param whereJson /
*/
void audit(JSONObject whereJson);
/**
* 全部分配,对同一出库单明细进行分配
*

View File

@@ -90,7 +90,7 @@ public class IOStorInv implements Serializable {
private Integer detail_count;
/**
* 单据状态 10生成 20分配中 30分配完 99完成
* 单据状态 10生成 15审核 20分配中 30分配完 99完成
*/
private String bill_status;
@@ -139,6 +139,21 @@ public class IOStorInv implements Serializable {
*/
private String dis_optid;
/**
* 审核人
*/
private String audit_optid;
/**
* 审核人姓名
*/
private String audit_optname;
/**
* 审核时间
*/
private String audit_time;
/**
* 分配人姓名
*/

View File

@@ -72,6 +72,11 @@ import java.util.stream.Collectors;
@Service
public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> implements IOutBillService {
private static final String OUT_BILL_STATUS_CREATED = "生成";
private static final String OUT_BILL_STATUS_AUDITED = "审核";
private static final String OUT_BILL_STATUS_ASSIGNING = "分配中";
private static final String OUT_BILL_STATUS_ASSIGNED = "分配完";
@Resource
private IOStorInvMapper ioStorInvMapper;
@@ -125,6 +130,24 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
@Resource
private IInBillService inBillService;
private IOStorInv getOutBillOrThrow(String iostorinvId) {
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinvId);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException("查不到出库单信息");
}
return ioStorInv;
}
private void ensureOutBillStatus(IOStorInv ioStorInv, String... allowedStatuses) {
String currentStatus = ioStorInv.getBill_status();
for (String allowedStatus : allowedStatuses) {
if (IOSEnum.BILL_STATUS.code(allowedStatus).equals(currentStatus)) {
return;
}
}
throw new BadRequestException("当前出库单状态不允许执行该操作");
}
@Override
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page, String[] stor_id, String[] bill_status, String[] bill_type) {
@@ -366,6 +389,35 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
return ioStorInvDisMapper.queryOutBillDisDtl(whereJson);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void audit(JSONObject whereJson) {
String iostorinvId = whereJson.getString("iostorinv_id");
IOStorInv ioStorInv = getOutBillOrThrow(iostorinvId);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_CREATED);
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
IOStorInv updateMst = new IOStorInv();
updateMst.setIostorinv_id(iostorinvId);
updateMst.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
updateMst.setAudit_optid(currentUserId);
updateMst.setAudit_optname(nickName);
updateMst.setAudit_time(now);
updateMst.setUpdate_optid(currentUserId);
updateMst.setUpdate_optname(nickName);
updateMst.setUpdate_time(now);
ioStorInvMapper.updateById(updateMst);
ioStorInvDtlMapper.update(new IOStorInvDtl(),
new LambdaUpdateWrapper<IOStorInvDtl>()
.set(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED))
.eq(IOStorInvDtl::getIostorinv_id, iostorinvId)
.eq(IOStorInvDtl::getBill_status, IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_CREATED)));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void allDiv(JSONObject whereJson) {
@@ -377,14 +429,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String iostorinv_id = whereJson.getString("iostorinv_id");
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException("查不到出库单信息");
}
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
//查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id);
List<IOStorInvDtlDto> dtls = ioStorInvMapper.getIODtl(queryDtl);
@@ -459,7 +509,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
}
//更新详情
dtl.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
dtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
dtl.setUnassign_qty(unassign_qty);
dtl.setAssign_qty(dtl.getAssign_qty().add(allocation_canuse_qty));
ioStorInvDtlMapper.updateById(dtl);
@@ -469,7 +519,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//根据单据标识判断明细是否都已经分配完成
int disCount = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,iostorinv_id)
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("分配完"))
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED))
);
// 根据分配货位情况 更新主表单据状态
IOStorInv ios = new IOStorInv();
@@ -477,7 +527,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING) : IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
ioStorInvMapper.updateById(ios);
}
@@ -490,6 +540,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String now = DateUtil.now();
String iostorinv_id = whereJson.getString("iostorinv_id");
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
.le(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("未生成"))
@@ -538,7 +590,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(dtlId);
ioStorInvDtl.setAssign_qty(BigDecimal.ZERO);
ioStorInvDtl.setUnassign_qty(ioStorInvDtl.getPlan_qty());
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
ioStorInvDtlMapper.updateById(ioStorInvDtl);
}
@@ -549,7 +601,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
ios.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
ioStorInvMapper.updateById(ios);
}
@@ -563,14 +615,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String sectCode = whereJson.getString("sect_code");
String iostorinv_id = whereJson.getString("iostorinv_id");
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException("查不到出库单信息");
}
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
//查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id);
queryDtl.put("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"));
@@ -642,7 +692,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
}
}
//更新详情
dtl.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
dtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
dtl.setUnassign_qty(unassign_qty);
dtl.setAssign_qty(dtl.getAssign_qty().add(allocation_canuse_qty));
ioStorInvDtlMapper.updateById(dtl);
@@ -651,7 +701,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//根据单据标识判断明细是否都已经分配完成
int disCount = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,iostorinv_id)
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("分配完"))
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED))
);
// 根据分配货位情况 更新主表单据状态
IOStorInv ios = new IOStorInv();
@@ -659,7 +709,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING) : IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
ioStorInvMapper.updateById(ios);
}
@@ -670,6 +720,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String now = DateUtil.now();
String iostorinv_id = whereJson.getString("iostorinv_id");
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
.le(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("未生成"))
@@ -719,7 +771,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
IOStorInvDtl ioStorInvDtl = ioStorInvDtlMapper.selectById(dtlId);
ioStorInvDtl.setAssign_qty(BigDecimal.ZERO);
ioStorInvDtl.setUnassign_qty(ioStorInvDtl.getPlan_qty());
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
ioStorInvDtlMapper.updateById(ioStorInvDtl);
}
@@ -728,8 +780,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//根据单据标识判断明细是否都已经分配完成
int disCount = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,iostorinv_id)
.le(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("分配完"))
.gt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("生成"))
.le(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED))
.gt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED))
);
// 根据分配货位情况 更新主表单据状态
@@ -738,7 +790,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("生成"));
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING) : IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
ioStorInvMapper.updateById(ios);
}
@@ -761,14 +813,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String iostorinv_id = row.getString("iostorinv_id");
//查询主表信息
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
if (ObjectUtil.isEmpty(ioStorInv)) {
throw new BadRequestException("当前订单无可分配出库明细");
}
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
//查询生成和未分配完的明细
JSONObject queryDtl = new JSONObject();
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完"));
queryDtl.put("bill_status", IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
queryDtl.put("unassign_flag", BaseDataEnum.IS_YES_NOT.code(""));
queryDtl.put("iostorinv_id", iostorinv_id);
queryDtl.put("iostorinvdtl_id", row.getString("iostorinvdtl_id"));
@@ -853,7 +903,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
}
//更新详情
dtl.setBill_status(unassign_qty==0 ? IOSEnum.BILL_STATUS.code("分配完"): IOSEnum.BILL_STATUS.code("分配中"));
dtl.setBill_status(unassign_qty==0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED): IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING));
double assign_qty = allocation_canuse_qty + dtl.getAssign_qty().doubleValue();
dtl.setUnassign_qty(BigDecimal.valueOf(unassign_qty));
dtl.setAssign_qty(BigDecimal.valueOf(assign_qty));
@@ -864,7 +914,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//根据单据标识判断明细是否都已经分配完成
int disCount = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,iostorinv_id)
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("分配完"))
.lt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED))
);
// 根据分配货位情况 更新主表单据状态
@@ -873,7 +923,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("分配完"));
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING) : IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
ioStorInvMapper.updateById(ios);
}
@@ -885,6 +935,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
String now = DateUtil.now();
String iostorinv_id = whereJson.getString("iostorinv_id");
IOStorInv ioStorInv = getOutBillOrThrow(iostorinv_id);
ensureOutBillStatus(ioStorInv, OUT_BILL_STATUS_AUDITED, OUT_BILL_STATUS_ASSIGNING, OUT_BILL_STATUS_ASSIGNED);
List<IOStorInvDis> ioStorInvDisList = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<>(IOStorInvDis.class)
.le(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("未生成"))
@@ -928,11 +980,11 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ioStorInvDtl.setAssign_qty(BigDecimal.valueOf(assign_qty));
ioStorInvDtl.setUnassign_qty(BigDecimal.valueOf(unassign_qty));
if (assign_qty == 0){
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
}else if (unassign_qty == 0){
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED));
}else {
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("分配中"));
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING));
}
ioStorInvDtlMapper.updateById(ioStorInvDtl);
@@ -945,8 +997,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
//根据单据标识判断明细是否都已经分配完成
int disCount = ioStorInvDtlMapper.selectCount(new LambdaQueryWrapper<>(IOStorInvDtl.class)
.eq(IOStorInvDtl::getIostorinv_id,iostorinv_id)
.le(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("分配完"))
.gt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code("生成"))
.le(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNED))
.gt(IOStorInvDtl::getBill_status,IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED))
);
// 根据分配货位情况 更新主表单据状态
@@ -955,7 +1007,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
ios.setUpdate_optid(currentUserId);
ios.setUpdate_optname(nickName);
ios.setUpdate_time(now);
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code("分配中") : IOSEnum.BILL_STATUS.code("生成"));
ios.setBill_status(disCount>0 ? IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_ASSIGNING) : IOSEnum.BILL_STATUS.code(OUT_BILL_STATUS_AUDITED));
ioStorInvMapper.updateById(ios);
}

View File

@@ -0,0 +1,4 @@
ALTER TABLE `pdm_bd_workorder`
ADD COLUMN `audit_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核人' AFTER `workshop_code`,
ADD COLUMN `audit_name` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核人姓名' AFTER `audit_id`,
ADD COLUMN `audit_time` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核时间' AFTER `audit_name`;

View File

@@ -0,0 +1,4 @@
ALTER TABLE `st_ivt_iostorinv`
ADD COLUMN `audit_optid` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核人' AFTER `update_time`,
ADD COLUMN `audit_optname` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核人姓名' AFTER `audit_optid`,
ADD COLUMN `audit_time` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL DEFAULT NULL COMMENT '审核时间' AFTER `audit_optname`;