Merge branch 'master' of http://121.40.234.130:8899/root/hl_one
This commit is contained in:
@@ -20,13 +20,13 @@
|
||||
and der.sale_code = #{query.sale_code}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
and der.status >= #{query.status}
|
||||
and der.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.sale_type != null">
|
||||
and der.sale_type >= #{query.sale_type}
|
||||
and der.sale_type = #{query.sale_type}
|
||||
</if>
|
||||
<if test="query.cust_code != null">
|
||||
and der.cust_code >= #{query.cust_code}
|
||||
and der.cust_code = #{query.cust_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
@@ -26,8 +26,10 @@ public enum IOSEnum {
|
||||
, "领料出库", "21", "销售出库", "22", "手工出库", "23")),
|
||||
//单据状态
|
||||
BILL_STATUS(MapOf.of("生成", "10", "分配中", "20", "分配完", "30", "完成", "99")),
|
||||
//单据状态
|
||||
//分配单据状态
|
||||
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
|
||||
//订单/发货单 状态
|
||||
ORDER_STATUS(MapOf.of("生成", "10", "提交", "20", "发货中", "30", "确认", "99")),
|
||||
//锁定类型
|
||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","其他锁","99")),
|
||||
;
|
||||
|
||||
@@ -110,6 +110,8 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
|
||||
* @param whereJson
|
||||
* {
|
||||
* iostorinvdis_id : 分配标识
|
||||
* point_code: 出库点位
|
||||
* checked: 是否自动分配
|
||||
* }
|
||||
*/
|
||||
void setPoint(JSONObject whereJson);
|
||||
|
||||
@@ -49,6 +49,8 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostor
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
@@ -113,6 +115,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
@Autowired
|
||||
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
|
||||
|
||||
@Autowired
|
||||
private IStIfDeliveryorderCpService iStIfDeliveryorderCpService; // 发货单服务
|
||||
|
||||
@Override
|
||||
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
||||
// 查询条件
|
||||
@@ -184,6 +189,21 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
dao.setIs_delete(true);
|
||||
|
||||
this.updateById(dao);
|
||||
|
||||
// 修改发货单状态
|
||||
List<StIvtIostorinvdtlCp> list = iostorinvdtlCpService.list(
|
||||
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, id)
|
||||
);
|
||||
|
||||
list.forEach(item -> {
|
||||
iStIfDeliveryorderCpService.update(
|
||||
new UpdateWrapper<StIfDeliveryorderCp>().lambda()
|
||||
.set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("生成"))
|
||||
.eq(StIfDeliveryorderCp::getDeliver_id, item.getSource_billdtl_id())
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +450,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
);
|
||||
|
||||
boolean is_dis = dtlDaoList.stream()
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")));
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完"))
|
||||
|| row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成"))
|
||||
|| row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配中"))
|
||||
);
|
||||
|
||||
if (!is_dis) throw new BadRequestException("请先分配单据!");
|
||||
|
||||
@@ -635,10 +658,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
||||
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||
// 1.下发任务
|
||||
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
bean.issueTaskToAcs3(param);
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
|
||||
// 反馈失败报错
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
if (!ObjectUtil.equal(MapUtil.getStr(result, "status"),"200")) {
|
||||
throw new BadRequestException("下发失败:"+MapUtil.getStr(result, "message"));
|
||||
}
|
||||
|
||||
@@ -366,6 +366,20 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
dao.setIs_delete(true);
|
||||
|
||||
this.updateById(dao);
|
||||
|
||||
// 修改销售单状态
|
||||
List<StIvtIostorinvdtlCp> list = iostorinvdtlCpService.list(
|
||||
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||
.eq(StIvtIostorinvdtlCp::getIostorinv_id, id)
|
||||
);
|
||||
|
||||
list.forEach(item -> {
|
||||
iMpsSaleOrderService.update(
|
||||
new UpdateWrapper<MpsSaleOrder>().lambda()
|
||||
.set(MpsSaleOrder::getStatus, IOSEnum.ORDER_STATUS.code("生成"))
|
||||
.eq(MpsSaleOrder::getSale_id, item.getBase_billdtl_id())
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,7 +695,10 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
||||
);
|
||||
|
||||
boolean is_dis = dtlDaoList.stream()
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")));
|
||||
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完"))
|
||||
|| row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成"))
|
||||
|| row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配中"))
|
||||
);
|
||||
|
||||
if (!is_dis) throw new BadRequestException("请先分配单据!");
|
||||
|
||||
|
||||
@@ -16,11 +16,15 @@ import org.nl.wms.mps_manage.ordermanage.service.saleOrder.IMpsSaleOrderService;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.IVTEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvdtlCpMapper;
|
||||
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -57,6 +61,11 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
||||
@Autowired
|
||||
protected IMpsSaleOrderService iMpsSaleOrderService; // 销售订单服务
|
||||
|
||||
@Autowired
|
||||
private IStIvtIostorinvCpService iStIvtIostorinvCpService; // 主表服务
|
||||
|
||||
@Autowired
|
||||
private IStIfDeliveryorderCpService iStIfDeliveryorderCpService; // 发货单服务
|
||||
|
||||
@Override
|
||||
public void batchInsert(Collection<StIvtIostorinvdtlCp> list) {
|
||||
@@ -69,6 +78,8 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
||||
public double create(JSONArray rows, String iostorinvCp_id) {
|
||||
double total_qty = 0;
|
||||
|
||||
StIvtIostorinvCp mstDao = iStIvtIostorinvCpService.getById(iostorinvCp_id);
|
||||
|
||||
if (rows.size()>0 && StringUtils.isNotEmpty(iostorinvCp_id)){
|
||||
// 先删除在插入
|
||||
this.remove(new QueryWrapper<StIvtIostorinvdtlCp>().eq("iostorinv_id", iostorinvCp_id));
|
||||
@@ -94,6 +105,20 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
||||
row.setBase_bill_code(orderDao.getSale_code());
|
||||
row.setBase_bill_type(orderDao.getSale_type());
|
||||
row.setBase_bill_table(orderDao.getSeq_no().toString());
|
||||
|
||||
if (IOSEnum.IO_TYPE.code("入库").equals(mstDao.getIo_type())){
|
||||
// 入库: 更新销售单状态
|
||||
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||
iMpsSaleOrderService.updateById(orderDao);
|
||||
} else {
|
||||
// 出库: 更新发货单状态
|
||||
iStIfDeliveryorderCpService.update(
|
||||
new UpdateWrapper<StIfDeliveryorderCp>().lambda()
|
||||
.set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("提交"))
|
||||
.eq(StIfDeliveryorderCp::getDeliver_id,row.getSource_billdtl_id())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
row.setIostorinv_id(iostorinvCp_id);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -26,6 +27,7 @@ public class StIfDeliveryorderCp implements Serializable {
|
||||
/**
|
||||
* 发货单标识
|
||||
*/
|
||||
@TableId
|
||||
private String deliver_id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -285,10 +285,11 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
checkParam(mst);
|
||||
|
||||
PointEvent event = PointEvent.builder()
|
||||
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
|
||||
.type(AcsTaskEnum.TASK_STRUCT_OUT.getCode())
|
||||
.acs_task_type("7")
|
||||
.point_code1(mst.getPoint_code())
|
||||
.point_code2(mst.getStruct_code())
|
||||
.task_group_id(IdUtil.getStringId())
|
||||
.point_code2(mst.getPoint_code())
|
||||
.point_code1(mst.getStruct_code())
|
||||
.vehicle_code(mst.getStoragevehicle_code())
|
||||
.product_area(mst.getWorkshop_id())
|
||||
.callback((Consumer<String>) mst::setTask_id)
|
||||
@@ -315,10 +316,9 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||
// 1.下发任务
|
||||
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
bean.issueTaskToAcs3(param);
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
|
||||
// 反馈失败报错
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
if (!ObjectUtil.equal(MapUtil.getStr(result, "status"),"200")) {
|
||||
throw new BadRequestException("下发失败:"+MapUtil.getStr(result, "message"));
|
||||
}
|
||||
|
||||
@@ -238,6 +238,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
PointEvent event = PointEvent.builder()
|
||||
.type(AcsTaskEnum.TASK_STRUCT_IN.getCode())
|
||||
.acs_task_type("7")
|
||||
.task_group_id(IdUtil.getStringId())
|
||||
.point_code1(mst.getPoint_code())
|
||||
.point_code2(stIvtStructattr.getStruct_code())
|
||||
.vehicle_code(mst.getStoragevehicle_code())
|
||||
@@ -354,10 +355,9 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
|
||||
// 1.下发任务
|
||||
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
bean.issueTaskToAcs3(param);
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
|
||||
// 反馈失败报错
|
||||
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||
if (!ObjectUtil.equal(MapUtil.getStr(result, "status"),"200")) {
|
||||
throw new BadRequestException("下发失败:"+MapUtil.getStr(result, "message"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user