入库部分和接口

This commit is contained in:
张怡蓉
2026-01-29 10:43:56 +08:00
parent b73a93c317
commit dfbe04cedb
6 changed files with 63 additions and 43 deletions

View File

@@ -118,7 +118,7 @@ public class InStockinServiceImpl implements IInStockinService
inStockin.setCreateDate(DateUtil.formatDateTime(DateUtil.date()));
inStockin.setSpare3(DateUtil.formatDateTime(DateUtil.date()));
inStockin.setCreateManId(Convert.toStr(SecurityUtils.getUsername()));
inStockin.setSpare4(Convert.toStr(SecurityUtils.getUserId()));
inStockin.setSpare4(Convert.toStr(SecurityUtils.getUsername()));
inStockin.setSupplierNo(inStockinVo.getSupplierId());
inStockin.setErpBill(inStockinVo.getErpBill());
inStockin.setInType(inStockinVo.getInType());

View File

@@ -84,6 +84,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
private PdaMapper pdaMapper;
@Autowired
private ICheckDifferenceRecordService checkDifferenceRecordService;
@Autowired
private IMydoJobService mydoJobService;
/**
@@ -182,20 +184,9 @@ public class MydoJobServiceImpl implements IMydoJobService {
if (job == null) {
return AjaxResult.warn("任务不存在");
}
if (!"1".equals(job.getStatus())) {
return AjaxResult.warn("只能作废未开始的任务");
}
if ("1".equals(job.getInOrOut())) {
mydoJob.setStatus("5");
updateMydoJob(mydoJob);
//修改货位状态
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
basCargoSpace.setStatus("1");
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
//插入历史表
insertHistory(mydoJob.getJobId());
} else if ("2".equals(job.getInOrOut())|| "3".equals(job.getInOrOut())){
if ("1".equals(job.getInOrOut())) {
MydoJobDetail param = new MydoJobDetail();
param.setJobId(jobId);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
@@ -209,20 +200,32 @@ public class MydoJobServiceImpl implements IMydoJobService {
inStockinDetail.setScanNum(Convert.toStr(subtract));
inStockinDetailService.updateInStockinDetail(inStockinDetail);
}
mydoJob.setStatus("5");
updateMydoJob(mydoJob);
//修改货位状态
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
basCargoSpace.setStatus("1");
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
if(job.getCargoSpaceId()!=null && job.getCargoSpaceId()!=""){
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
basCargoSpace.setStatus("1");
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
}
//插入历史表
insertHistory(mydoJob.getJobId());
} else{
if(job.getCargoSpaceId()!=null && job.getCargoSpaceId()!="") {
//修改货位状态
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
basCargoSpace.setStatus("1");
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
}
mydoJob.setStatus("5");
mydoJob.setFinishTime(DateUtil.formatDateTime(new Date()));
updateMydoJob(mydoJob);
//插入历史表
insertHistory(mydoJob.getJobId());
}
//通知wcs
AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo());
log.info("取消任务结果:{}", ajaxResult);
return AjaxResult.success();
}
@@ -244,8 +247,14 @@ public class MydoJobServiceImpl implements IMydoJobService {
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult manualCompleted(MydoJob mydoJobParam, int type) {
HashMap<String, Object> map = new HashMap<>();
String jobId = mydoJobParam.getJobId();
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(jobId);
if(Integer.valueOf(mydoJob.getStatus())<3){
return AjaxResult.error("只能完成正执行的作业");
}
HashMap<String, Object> map = new HashMap<>();
map.put("v_job_id", jobId);
mydoJobMapper.manualCompleted(map);
if (!"10".equals(map.get("v_result").toString())) {

View File

@@ -72,15 +72,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
is2.spare4,
is2.spare3,
is2.spare5,
bw.warehouse_name,
bs.supplier_name,
sd.dept_name ,
su.user_name
bw.warehouse_name
-- bs.supplier_name,
-- sd.dept_name ,
-- su.user_name
from in_stockin_finish is2
left join bas_warehouse bw on is2.warehouse_id = bw.warehouse_id
left join bas_supplier bs on bs.supplier_no = is2.supplier_no
left join sys_dept sd on is2.department_no = sd.dept_id
left join sys_user su on su.user_id = is2.create_man_id</sql>
-- left join bas_supplier bs on bs.supplier_no = is2.supplier_no
-- left join sys_dept sd on is2.department_no = sd.dept_id
-- left join sys_user su on su.user_id = is2.create_man_id
</sql>
<select id="selectInStockinFinishList" parameterType="InStockinFinish" resultMap="InStockinFinishResult">
<include refid="selectInStockinFinishVo"/>