This commit is contained in:
2023-06-03 11:15:51 +08:00
11 changed files with 155 additions and 29 deletions

View File

@@ -28,11 +28,11 @@ public enum TASKEnum implements FunctionStrategy<String, JSONObject> {
}), }),
CHECK_TASK(type -> AcsTaskEnum.TASK_STRUCT_CHECK.getCode().equals(type), form -> { CHECK_TASK(type -> AcsTaskEnum.TASK_STRUCT_CHECK.getCode().equals(type), form -> {
IStIvtCheckmstYlService bean = SpringContextHolder.getBean(IStIvtCheckmstYlService.class); IStIvtCheckmstYlService bean = SpringContextHolder.getBean(IStIvtCheckmstYlService.class);
bean.confirm(form); bean.taskOperate(form);
}), }),
SHUT_TASK(type -> AcsTaskEnum.TASK_STRUCT_SHUT.getCode().equals(type), form -> { SHUT_TASK(type -> AcsTaskEnum.TASK_STRUCT_SHUT.getCode().equals(type), form -> {
IStIvtShutframeinvBcpService bean = SpringContextHolder.getBean(IStIvtShutframeinvBcpService.class); IStIvtShutframeinvBcpService bean = SpringContextHolder.getBean(IStIvtShutframeinvBcpService.class);
bean.confirm(form); bean.taskOperate(form);
}), }),
CP_IN_TASK(type -> AcsTaskEnum.TASK_STRUCT_CP_IN.getCode().equals(type), form -> { CP_IN_TASK(type -> AcsTaskEnum.TASK_STRUCT_CP_IN.getCode().equals(type), form -> {
IStIvtIostorinvCpService bean = SpringContextHolder.getBean(IStIvtIostorinvCpService.class); IStIvtIostorinvCpService bean = SpringContextHolder.getBean(IStIvtIostorinvCpService.class);

View File

@@ -48,4 +48,8 @@ public interface IStIvtCheckmstBcpService extends IService<StIvtCheckmstBcp> {
void process0(JSONObject jo); void process0(JSONObject jo);
void process1(JSONObject jo); void process1(JSONObject jo);
void issueTask(JSONObject jo);
void taskOperate(JSONObject jo);
} }

View File

@@ -107,7 +107,7 @@ public class StIvtCheckdtlBcp implements Serializable {
/** /**
* 是否已下发 * 是否已下发
*/ */
private Boolean is_down; private String is_down;
/** /**
* 盘点数量 * 盘点数量
@@ -154,5 +154,7 @@ public class StIvtCheckdtlBcp implements Serializable {
*/ */
private String process_time; private String process_time;
private String task_id;
} }

View File

@@ -14,6 +14,9 @@ import io.jsonwebtoken.lang.Assert;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.publish.BussEventMulticaster;
import org.nl.common.publish.event.PointEvent;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
@@ -32,14 +35,19 @@ import org.nl.wms.storage_manage.semimanage.service.check.IStIvtCheckdtlBcpServi
import org.nl.wms.storage_manage.semimanage.service.check.IStIvtCheckmstBcpService; import org.nl.wms.storage_manage.semimanage.service.check.IStIvtCheckmstBcpService;
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp; import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp;
import org.nl.wms.storage_manage.semimanage.service.check.dao.mapper.StIvtCheckmstBcpMapper; import org.nl.wms.storage_manage.semimanage.service.check.dao.mapper.StIvtCheckmstBcpMapper;
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessmstBcpService; import org.nl.wms.storage_manage.semimanage.service.moveOrLess.IStIvtMoreorlessmstBcpService;
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.StIvtShutframedtlBcp;
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dao.StIvtShutframeinvBcp;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer;
/** /**
* <p> * <p>
@@ -220,6 +228,7 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
this.updateById(jo_mst); this.updateById(jo_mst);
} }
@Override @Override
public void process0(JSONObject whereJson) { public void process0(JSONObject whereJson) {
JSONObject form = whereJson.getJSONObject("form"); JSONObject form = whereJson.getJSONObject("form");
@@ -254,6 +263,67 @@ public class StIvtCheckmstBcpServiceImpl extends ServiceImpl<StIvtCheckmstBcpMap
this.updateById(jo_mst); this.updateById(jo_mst);
} }
@Override
public void issueTask(JSONObject form) {
Assert.notNull(new Object[]{form, form.get("checkdtl_id")}, "请求参数不能为空");
//查询可用的半成品移出点位
String point_code = "PD01";
StIvtCheckdtlBcp dtl = checkdtlBcpService.getById(form.getString("checkdtl_id"));
StIvtCheckmstBcp mst = this.getById(dtl.getCheck_id());
StIvtStructattr struct = structattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", dtl.getStruct_id()));
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_SHUT.getCode())
.point_code1(struct.getStruct_code())
.point_code2(point_code)
.vehicle_code(dtl.getStoragevehicle_code())
.product_area(mst.getWorkshop_id())
.callback((Consumer<String>) task_id -> dtl.setTask_id(task_id))
.build();
BussEventMulticaster.Publish(event);
checkdtlBcpService.update(new UpdateWrapper<StIvtCheckdtlBcp>()
.set("is_down", "1")
.set("checkpoint_id", point_code)
.set("status", CHECKEnum.DTL_STATUS.code("盘点中"))
.eq("struct_id", dtl.getStruct_id())
.eq("check_id", dtl.getCheck_id()));
}
@Override
public void taskOperate(JSONObject form) {
String task_id = form.getString("task_id");
String status = form.getString("status");
StIvtCheckdtlBcp dtl = new StIvtCheckdtlBcp();
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode()) && dtl.getIs_down().equals("2")) {
checkdtlBcpService.update(new UpdateWrapper<StIvtCheckdtlBcp>()
.set("status", CHECKEnum.DTL_STATUS.code("完成"))
.eq("struct_id", dtl.getStruct_id())
.eq("check_id", dtl.getCheck_id()));
//判断是否存在未完成的明细
List<StIvtCheckdtlBcp> list = checkdtlBcpService.list(new QueryWrapper<StIvtCheckdtlBcp>().eq("check_id", dtl.getCheck_id())
.ne("status", CHECKEnum.DTL_STATUS.code("完成")));
if (list.size() == 0) {
StIvtCheckmstBcp jo_mst = this.getOne(new QueryWrapper<StIvtCheckmstBcp>().eq("check_id", dtl.getCheck_id()));
jo_mst.setStatus(CHECKEnum.BILL_STATUS.code("完成"));
jo_mst.setConfirm_optid(SecurityUtils.getCurrentUserId());
jo_mst.setConfirm_optname(SecurityUtils.getCurrentNickName());
jo_mst.setConfirm_time(DateUtil.now());
//解锁起点点位、仓位
List<StIvtCheckdtlBcp> finish_list = checkdtlBcpService.list(new QueryWrapper<StIvtCheckdtlBcp>().eq("check_id", dtl.getCheck_id())
.eq("status", CHECKEnum.DTL_STATUS.code("完成")));
finish_list.stream()
.map(finish -> finish.getStruct_id())
.distinct()
.forEach(struct_id -> structattrService.update(new UpdateWrapper<StIvtStructattr>().set("inv_code", "").set("lock_type", "0").eq("struct_id", struct_id)));
}
}
}
@Override @Override
public void process1(JSONObject whereJson) { public void process1(JSONObject whereJson) {
JSONObject form = whereJson.getJSONObject("form"); JSONObject form = whereJson.getJSONObject("form");

View File

@@ -106,10 +106,33 @@ public class StIvtShutframeinvBcpServiceImpl extends ServiceImpl<StIvtShutframei
StIvtShutframedtlBcp dtl = list.get(0); StIvtShutframedtlBcp dtl = list.get(0);
String work_status = dtl.getWork_status(); String work_status = dtl.getWork_status();
if (all_finish){
}else {
if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
if (work_status.equals(SHUTEnum.WORK_STATUS.code("移出中")) || work_status.equals(SHUTEnum.WORK_STATUS.code("生成"))) {
shutframedtlBcpService.update(new UpdateWrapper<StIvtShutframedtlBcp>()
.eq("task_id", task.getTask_group_id())
.set("work_status", SHUTEnum.WORK_STATUS.code("移出中")));
}
if (work_status.equals(SHUTEnum.WORK_STATUS.code("移出确认")) || work_status.equals(SHUTEnum.WORK_STATUS.code("移回中"))) {
shutframedtlBcpService.update(new UpdateWrapper<StIvtShutframedtlBcp>()
.eq("task_id", task.getTask_group_id())
.set("work_status", SHUTEnum.WORK_STATUS.code("移回中")));
}
}
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode()) && all_finish) {
if (work_status.equals(SHUTEnum.WORK_STATUS.code("移出中"))) {
shutframedtlBcpService.update(new UpdateWrapper<StIvtShutframedtlBcp>()
.eq("task_id", task.getTask_group_id())
.set("work_status", SHUTEnum.WORK_STATUS.code("移出确认")));
}
if (work_status.equals(SHUTEnum.WORK_STATUS.code("移回中"))) {
shutframedtlBcpService.update(new UpdateWrapper<StIvtShutframedtlBcp>()
.eq("task_id", task.getTask_group_id())
.set("work_status", SHUTEnum.WORK_STATUS.code("完成")));
JSONObject jo = new JSONObject();
jo.put("shutframeinv_id", dtl.getShutframeinv_id());
this.confirm(jo);
}
} }
} }

View File

@@ -84,6 +84,17 @@
> >
新增一行 新增一行
</el-button> </el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
:disabled="add_flag"
@click="issueTask"
>
下发任务
</el-button>
</span> </span>
</div> </div>
@@ -370,6 +381,13 @@ export default {
this.dialogVisible = false this.dialogVisible = false
}) })
}, },
issueTask(){
if (this.nowrow === null) {
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
check.issueTask(this.nowrow)
},
saveCheck() { saveCheck() {
if (this.tableData.length === 0) { if (this.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)

View File

@@ -85,7 +85,6 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index' import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date() const start = new Date()
export default { export default {

View File

@@ -111,6 +111,14 @@ export function process1(data) {
}) })
} }
export function issueTask(data) {
return request({
url: '/api/bcp/check/issueTask',
method: 'post',
data
})
}
export default { export default {
add, add,
edit, edit,
@@ -122,6 +130,7 @@ export default {
getInvTypes, getInvTypes,
saveCheck, saveCheck,
process0, process0,
issueTask,
getOutBillDis, getOutBillDis,
process1 process1
} }

View File

@@ -204,7 +204,8 @@ export default {
name: 'ShutFrame', name: 'ShutFrame',
components: {AddDialog, crudOperation, rrOperation, udOperation, pagination}, components: {AddDialog, crudOperation, rrOperation, udOperation, pagination},
cruds() { cruds() {
return CRUD({ title: '拼盘', return CRUD({
title: '拼盘',
props: { props: {
// 每页数据条数 // 每页数据条数
size: 20 size: 20
@@ -216,7 +217,8 @@ export default {
del: false, del: false,
reset: true, reset: true,
download: false download: false
}}) }
})
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
// 数据字典 // 数据字典
@@ -290,7 +292,7 @@ export default {
} }
}, },
taskOpen() { taskOpen() {
shutframe.handdown({ 'shutframeinv_id': this.currentRow.shutframeinv_id }).then(res => { shutframe.issueTask({'shutframeinv_id': this.currentRow.shutframeinv_id}).then(res => {
this.querytable() this.querytable()
}) })
}, },

View File

@@ -131,6 +131,6 @@ export default {
confirm, confirm,
getInvTypes, getInvTypes,
getOutBillDtl2, getOutBillDtl2,
getStructIvt2, issueTask,
getStruct getStruct
} }

View File

@@ -82,7 +82,6 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker/index' import DateRangePicker from '@/components/DateRangePicker/index'
import crudProductIn from '@/views/wms/storage_manage/rawproduct/rawProductIn/rawproductin'
const start = new Date() const start = new Date()
export default { export default {