add:成品库移库任务

This commit is contained in:
zhangzhiqiang
2023-09-11 09:24:11 +08:00
parent 9ece4e9113
commit 665ac256b9
31 changed files with 2004 additions and 70 deletions

View File

@@ -46,6 +46,7 @@ public enum AcsTaskEnum {
TASK_STRUCT_HR_EMP_IN("29","入库-海柔半成品-空托盘"), TASK_STRUCT_HR_EMP_IN("29","入库-海柔半成品-空托盘"),
TASK_STRUCT_HR_EMP_OUT("30","出库-海柔半成品-空托盘"), TASK_STRUCT_HR_EMP_OUT("30","出库-海柔半成品-空托盘"),
TASK_STRUCT_CP_CHECK("13","成品-盘点"), TASK_STRUCT_CP_CHECK("13","成品-盘点"),
TASK_STRUCT_CP_MOVE("14","成品-移库"),
TASK_WASH_SEND_MATERIAL("20","清洗机-上料请求"), TASK_WASH_SEND_MATERIAL("20","清洗机-上料请求"),
TASK_WASH_EMP("21","清洗机-空框请求"), TASK_WASH_EMP("21","清洗机-空框请求"),
TASK_WASH_FULL_AUTO("22","清洗机-满料请求自动"),//去半成品入库:参数不全也去异常处理位 TASK_WASH_FULL_AUTO("22","清洗机-满料请求自动"),//去半成品入库:参数不全也去异常处理位

View File

@@ -81,7 +81,6 @@ public class LogServiceImpl implements LogService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log logDto) { public void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log logDto) {
MethodSignature signature = (MethodSignature) joinPoint.getSignature(); MethodSignature signature = (MethodSignature) joinPoint.getSignature();

View File

@@ -15,7 +15,7 @@
1 = 1 and mater.material_type_id = '1528555445302726656' 1 = 1 and mater.material_type_id = '1528555445302726656'
<if test="query.material_code != null and query.material_code != ''"> <if test="query.material_code != null and query.material_code != ''">
AND (mater.material_code LIKE '%${query.material_code}%' or AND (mater.material_code LIKE '%${query.material_code}%' or
mater.material_name LIKE '%${query.material_code}%') or mater.material_name LIKE '%${query.material_code}%' or
mater.material_spec LIKE '%${query.material_code}%') mater.material_spec LIKE '%${query.material_code}%')
</if> </if>
order by mater.material_code ASC order by mater.material_code ASC

View File

@@ -35,7 +35,7 @@ public enum IOSEnum {
//订单/发货单 状态 //订单/发货单 状态
ORDER_STATUS(MapOf.of("生成", "10", "提交", "20", "发货中", "30", "确认", "99")), ORDER_STATUS(MapOf.of("生成", "10", "提交", "20", "发货中", "30", "确认", "99")),
//锁定类型 //锁定类型
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","拼盘锁","5","其他锁","99")), LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","拼盘锁","5","移库锁","10","其他锁","99")),
// 海柔半成品出入库类型 // 海柔半成品出入库类型
BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001")), BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001")),
// 半成品出入类型 // 半成品出入类型

View File

@@ -0,0 +1,42 @@
package org.nl.wms.storage_manage;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.MapOf;
import org.nl.modules.common.exception.BadRequestException;
import java.util.Map;
/*
* @author ZZQ
* @Date 2023/5/4 20:11
*/
@AllArgsConstructor
@Getter
public enum MoveInvEnum {
//单据类型
BILL_TYPE(MapOf.of("手工移库", "1")),
//单据状态
BILL_STATUS(MapOf.of("生成", "10", "移库中", "20","取消", "30", "完成", "99")),
CREATE_MODE(MapOf.of("PC产生", "01", "终端产生", "02", "外部接口产生", "03", "内部调度产生", "04"));
private Map<String, String> code;
public String code(String desc) {
String code = this.getCode().get(desc);
if (StringUtils.isNotEmpty(code)) {
return code;
}
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
}
public String check(String code) {
for (Map.Entry<String, String> entry : this.getCode().entrySet()) {
if (entry.getValue().equals("code")) {
return entry.getValue();
}
}
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
}
}

View File

@@ -1,8 +1,25 @@
package org.nl.wms.storage_manage.productmanage.controller.moveInv; package org.nl.wms.storage_manage.productmanage.controller.moveInv;
import org.springframework.web.bind.annotation.RequestMapping; import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RestController; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.common.TableDataInfo;
import org.nl.common.anno.Log;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.storage_manage.productmanage.service.check.IStIvtCheckmstCpService;
import org.nl.wms.storage_manage.productmanage.service.check.dto.CheckQueryMst;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dto.MoveInvQuery;
import org.nl.wms.storage_manage.semimanage.service.moveInv.IStIvtMoveinvBcpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* <p> * <p>
@@ -13,8 +30,42 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2023-05-04 * @since 2023-05-04
*/ */
@RestController @RestController
@RequestMapping("/stIvtMoveinvCp") @RequestMapping("api/stIvtMoveinvCp")
public class StIvtMoveinvCpController { public class StIvtMoveinvCpController {
@Autowired
private IStIvtMoveinvCpService moveinvcpService;
@Autowired
private IStIvtMoveinvdtlCpService moveinvdtlCpService;
@GetMapping
@Log("查询盘点单主表")
//("查询盘点单主表")
public ResponseEntity<Object> query(MoveInvQuery query, PageQuery page) {
return new ResponseEntity<>(TableDataInfo.build(moveinvcpService.page(page.build(StIvtMoveinvCp.class),query.build())), HttpStatus.OK);
}
@PostMapping
@Log("创建盘点单")
//("创建盘点单")
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
moveinvcpService.create(whereJson);
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}
@PostMapping("/getMoveDtl")
@Log("查询盘点明细")
//("查询盘点明细")
public ResponseEntity<Object> getCheckDtl(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(TableDataInfo.build(moveinvdtlCpService.listJoinTask(whereJson.getString("moveinv_id"))),HttpStatus.OK);
}
@PostMapping("/update")
@Log("更新单据")
//("查询盘点明细")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
moveinvcpService.update(whereJson);
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
}
} }

View File

@@ -1,8 +1,23 @@
package org.nl.wms.storage_manage.productmanage.controller.moveInv; package org.nl.wms.storage_manage.productmanage.controller.moveInv;
import org.springframework.web.bind.annotation.RequestMapping; import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.RestController; import com.alibaba.fastjson.JSONObject;
import org.nl.common.TableDataInfo;
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.MapOf;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.function.Consumer;
/** /**
* <p> * <p>
@@ -16,5 +31,15 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/stIvtMoveinvdtlCp") @RequestMapping("/stIvtMoveinvdtlCp")
public class StIvtMoveinvdtlCpController { public class StIvtMoveinvdtlCpController {
@Autowired
private IStIvtMoveinvdtlCpService moveinvdtlCpService;
@PostMapping("/task/{option}")
public ResponseEntity<Object> optionTask(@RequestBody JSONObject form, @PathVariable String option){
moveinvdtlCpService.taskOption(form,option);
return new ResponseEntity<>(HttpStatus.OK);
};
} }

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv; package org.nl.wms.storage_manage.productmanage.service.moveInv;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp;
@@ -12,5 +13,21 @@ import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvC
* @since 2023-05-04 * @since 2023-05-04
*/ */
public interface IStIvtMoveinvCpService extends IService<StIvtMoveinvCp> { public interface IStIvtMoveinvCpService extends IService<StIvtMoveinvCp> {
/**
* 新增
* @param form
*/
void create(JSONObject form);
/**
* 更新
* @param form
*/
void update(JSONObject form);
/**
* 任务回调处理
* @param form
*/
void taskOperate(JSONObject form);
} }

View File

@@ -1,8 +1,12 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv; package org.nl.wms.storage_manage.productmanage.service.moveInv;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 移库单明细表 服务类 * 移库单明细表 服务类
@@ -13,4 +17,7 @@ import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvd
*/ */
public interface IStIvtMoveinvdtlCpService extends IService<StIvtMoveinvdtlCp> { public interface IStIvtMoveinvdtlCpService extends IService<StIvtMoveinvdtlCp> {
List<Map> listJoinTask(String moveinv_id);
void taskOption(JSONObject form,String option);
} }

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.dao; package org.nl.wms.storage_manage.productmanage.service.moveInv.dao;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -26,6 +27,7 @@ public class StIvtMoveinvCp implements Serializable {
/** /**
* 移库单标识 * 移库单标识
*/ */
@TableId(value = "moveinv_id")
private String moveinv_id; private String moveinv_id;
/** /**
@@ -66,12 +68,12 @@ public class StIvtMoveinvCp implements Serializable {
/** /**
* 总数量 * 总数量
*/ */
private BigDecimal total_qty; private Integer total_qty;
/** /**
* 明细数 * 明细数
*/ */
private BigDecimal detail_count; private Integer dtl_count;
/** /**
* 单据状态 * 单据状态
@@ -91,63 +93,33 @@ public class StIvtMoveinvCp implements Serializable {
/** /**
* 制单人 * 制单人
*/ */
private String input_optid; private String create_id;
/** /**
* 制单人姓名 * 制单人姓名
*/ */
private String input_optname; private String create_name;
/** /**
* 制单时间 * 制单时间
*/ */
private String input_time; private String create_time;
/** /**
* 修改人 * 修改人
*/ */
private String update_optid; private String update_id;
/** /**
* 修改人姓名 * 修改人姓名
*/ */
private String update_optname; private String update_name;
/** /**
* 修改时间 * 修改时间
*/ */
private LocalDateTime update_time; private LocalDateTime update_time;
/**
* 确认人
*/
private String confirm_optid;
/**
* 确认人姓名
*/
private String confirm_optname;
/**
* 确认时间
*/
private String confirm_time;
/**
* 确认说明
*/
private String confirm_info;
/**
* 部门ID
*/
private String sysdeptid;
/**
* 公司ID
*/
private String syscompanyid;
/** /**
* 是否删除 * 是否删除
*/ */

View File

@@ -1,5 +1,6 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.dao; package org.nl.wms.storage_manage.productmanage.service.moveInv.dao;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@@ -16,7 +17,6 @@ import java.math.BigDecimal;
* @since 2023-05-04 * @since 2023-05-04
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false)
@TableName("st_ivt_moveinvdtl_cp") @TableName("st_ivt_moveinvdtl_cp")
public class StIvtMoveinvdtlCp implements Serializable { public class StIvtMoveinvdtlCp implements Serializable {
@@ -25,6 +25,7 @@ public class StIvtMoveinvdtlCp implements Serializable {
/** /**
* 移库单明细标识 * 移库单明细标识
*/ */
@TableId(value = "moveinvdtl_id")
private String moveinvdtl_id; private String moveinvdtl_id;
/** /**
@@ -35,7 +36,9 @@ public class StIvtMoveinvdtlCp implements Serializable {
/** /**
* 明细序号 * 明细序号
*/ */
private BigDecimal seq_no; private Integer seq_no;
private String sale_id;
/** /**
* 转出库区标识 * 转出库区标识
@@ -72,6 +75,11 @@ public class StIvtMoveinvdtlCp implements Serializable {
*/ */
private String material_id; private String material_id;
/**
* 物料标识
*/
private String material_code;
/** /**
* 批次 * 批次
*/ */
@@ -140,18 +148,13 @@ public class StIvtMoveinvdtlCp implements Serializable {
/** /**
* 执行状态 * 执行状态
*/ */
private String work_status; private String bill_status;
/** /**
* 任务标识 * 任务标识
*/ */
private String task_id; private String task_id;
/**
* 存储载具标识
*/
private String storagevehicle_id;
/** /**
* 存储载具编码 * 存储载具编码
*/ */

View File

@@ -3,6 +3,9 @@ package org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 移库单明细表 Mapper 接口 * 移库单明细表 Mapper 接口
@@ -13,4 +16,5 @@ import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvd
*/ */
public interface StIvtMoveinvdtlCpMapper extends BaseMapper<StIvtMoveinvdtlCp> { public interface StIvtMoveinvdtlCpMapper extends BaseMapper<StIvtMoveinvdtlCp> {
List<Map> listJoinTask(String moveinv_id);
} }

View File

@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper"> <mapper namespace="org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper">
<select id="listJoinTask" resultType="java.util.Map">
SELECT
st_ivt_moveinvdtl_cp.*,
sch_base_task.task_code,
sch_base_task.task_status
FROM
st_ivt_moveinvdtl_cp
LEFT JOIN sch_base_task ON st_ivt_moveinvdtl_cp.task_id = sch_base_task.task_id
where moveinv_id = #{moveinv_id}
</select>
</mapper> </mapper>

View File

@@ -0,0 +1,35 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.dto;
import lombok.Data;
import org.nl.common.domain.query.BaseQuery;
import org.nl.common.domain.query.QParam;
import org.nl.common.enums.QueryTEnum;
import org.nl.wms.storage_manage.productmanage.service.check.dao.StIvtCheckmstCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp;
/*
* @author ZZQ
* @Date 2023/5/4 19:49
*/
@Data
public class MoveInvQuery extends BaseQuery<StIvtMoveinvCp> {
private String stor_id;
private String bill_status;
private String bill_type;
private String bill_code;
private Boolean is_delete = false;
@Override
public void paramMapping() {
super.doP.put("bill_code", QParam.builder().k(new String[]{"bill_code"}).type(QueryTEnum.LK).build());
}
}

View File

@@ -1,14 +1,50 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.impl; package org.nl.wms.storage_manage.productmanage.service.moveInv.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.MapOf;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.CHECKEnum;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.IVTEnum;
import org.nl.wms.storage_manage.MoveInvEnum;
import org.nl.wms.storage_manage.productmanage.service.check.dao.StIvtCheckdtlCp;
import org.nl.wms.storage_manage.productmanage.service.check.dao.StIvtCheckmstCp;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvCpService; import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvCpMapper; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvCpMapper;
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/** /**
* <p> * <p>
* 移库单主表 服务实现类 * {"buss_type":"","stor_code":"F102","dtl_num":1,"bill_code":"","stor_id":"1528627995269533696","stor_name":"紫铜成品仓库","create_mode":"","remark":"","tableData":[{"sale_id":"1688802358693335040","ivt_level":"1","stor_id":"1528627995269533696","ivt_qty":15000,"sect_code":"KQ001","stockrecord_id":"1688821672087523328","quality_scode":"01","warehousing_qty":0,"storagevehicle_code":"4_0660698902","struct_id":"1668543869077295104","qty_unit_name":"个\\只","struct_code":"L07-02-02","material_name":"90度等径承口弯头\\L22-TW\\ESNA0100037","class_name":"紫铜管件S","is_active":true,"qty_unit_id":"16","canuse_qty":15000,"product_area":"A1","instorage_time":"2023-08-08 16:01:07","sect_id":"1528631043496742912","struct_name":"7排2列2层","material_id":"1684134839965585408","pcsn":"2023-08-08","sect_name":"成品库区","frozen_qty":0,"unit_weight":34.89,"material_code":"24018346S","status":"01","base_qty":15000,"turnin_struct_code":"L01-02-01"}],"check_type":"32","status":"10"}
* </p> * </p>
* *
* @author generator * @author generator
@@ -17,4 +53,223 @@ import org.springframework.stereotype.Service;
@Service @Service
public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper, StIvtMoveinvCp> implements IStIvtMoveinvCpService { public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper, StIvtMoveinvCp> implements IStIvtMoveinvCpService {
@Autowired
private IStIvtMoveinvdtlCpService moveinvdtlCpService;
@Autowired
private IStIvtStructattrService structattrService;
@Autowired
private IStIvtStructivtCpService iStIvtStructivtCpService;
@Override
@Transactional
public void create(JSONObject form) {
JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
// 调用主表 插入/更新方法
StIvtMoveinvCp mst = new StIvtMoveinvCp();
// 新增
mst.setMoveinv_id(IdUtil.getStringId());
mst.setBill_code(CodeUtil.getNewCode("MOVE_CODE"));
mst.setBuss_type(form.getString("buss_type"));
mst.setBill_type(form.getString("buss_type"));
mst.setStor_id(form.getString("stor_id"));
mst.setStor_name(form.getString("stor_name"));
mst.setStor_code(form.getString("stor_code"));
mst.setBiz_date(DateUtil.today());
mst.setBill_status(MoveInvEnum.BILL_STATUS.code("生成"));
mst.setDtl_count(form.getInteger("dtl_num"));
mst.setCreate_id(SecurityUtils.getCurrentUserId());
mst.setCreate_name(SecurityUtils.getCurrentNickName());
mst.setCreate_time(DateUtil.now());
mst.setIs_delete(false);
mst.setTotal_qty(mst.getDtl_count());
mst.setRemark(form.getString("remark"));
//调用明细表 插入方法
List<StIvtMoveinvdtlCp> itemList = new ArrayList<>();
Set<String> lockStructList = new HashSet<>();
for (int i = 0; i < rows.size(); i++) {
JSONObject item = rows.getJSONObject(i);
StIvtMoveinvdtlCp moveinvdtlCp = new StIvtMoveinvdtlCp();
moveinvdtlCp.setMoveinv_id(mst.getMoveinv_id());
moveinvdtlCp.setMoveinvdtl_id(IdUtil.getStringId());
moveinvdtlCp.setSeq_no(i+1);
moveinvdtlCp.setBill_status(mst.getBill_status());
material: {
moveinvdtlCp.setIs_active(true);
moveinvdtlCp.setIvt_level(IVTEnum.IVT_LEVEL.code("一级"));
moveinvdtlCp.setIs_issued(true);
moveinvdtlCp.setMaterial_id(item.getString("material_id"));
moveinvdtlCp.setMaterial_code(item.getString("material_code"));
moveinvdtlCp.setQty(item.getBigDecimal("canuse_qty"));
moveinvdtlCp.setPcsn(item.getString("pcsn"));
moveinvdtlCp.setQty_unit_id(item.getString("qty_unit_id"));
moveinvdtlCp.setQty_unit_name(item.getString("qty_unit_name"));
moveinvdtlCp.setQuality_scode(item.getString("quality_scode"));
moveinvdtlCp.setStoragevehicle_code(item.getString("storagevehicle_code"));
}
target: {
moveinvdtlCp.setTurnin_sect_code(item.getString("sect_code"));
moveinvdtlCp.setTurnin_sect_id(item.getString("sect_id"));
moveinvdtlCp.setTurnin_sect_name(item.getString("sect_name"));
moveinvdtlCp.setTurnin_struct_code(item.getString("turnin_struct_code"));
moveinvdtlCp.setTurnin_struct_name(item.getString("turnin_struct_name"));
moveinvdtlCp.setTurnin_struct_id(item.getString("turnin_struct_id"));
}
source:{
moveinvdtlCp.setTurnout_sect_code(item.getString("sect_code"));
moveinvdtlCp.setTurnout_sect_id(item.getString("sect_id"));
moveinvdtlCp.setTurnout_sect_name(item.getString("sect_name"));
moveinvdtlCp.setTurnout_struct_code(item.getString("struct_code"));
moveinvdtlCp.setTurnout_struct_name(item.getString("struct_name"));
moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id"));
}
itemList.add(moveinvdtlCp);
lockStructList.add(moveinvdtlCp.getTurnin_struct_code());
lockStructList.add(moveinvdtlCp.getTurnout_struct_code());
}
if (lockStructList.size()<rows.size()*2){
throw new BadRequestException("不允许选择相同货位进行分配");
}
this.save(mst);
moveinvdtlCpService.saveBatch(itemList);
structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁"))
.set(StIvtStructattr::getInv_code,mst.getBill_code())
.in(StIvtStructattr::getStruct_code, lockStructList)
);
}
@Override
@Transactional
public void update(JSONObject form) {
JSONArray rows = form.getJSONArray("tableData");
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
List<StIvtMoveinvdtlCp> dtlList = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>().eq("moveinv_id", form.getString("moveinv_id")));
//调用明细表 插入方法
Set<String> unLockStructList = new HashSet<>();
for (StIvtMoveinvdtlCp cp : dtlList) {
unLockStructList.add(cp.getTurnin_struct_code());
unLockStructList.add(cp.getTurnout_struct_code());
}
structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
.set(StIvtStructattr::getInv_code,"")
.in(StIvtStructattr::getStruct_code, unLockStructList)
);
List<StIvtMoveinvdtlCp> itemList = new ArrayList<>();
Set<String> lockStructList = new HashSet<>();
for (int i = 0; i < rows.size(); i++) {
JSONObject item = rows.getJSONObject(i);
StIvtMoveinvdtlCp moveinvdtlCp = JSONObject.parseObject(JSON.toJSONString(item), StIvtMoveinvdtlCp.class);
source:{
moveinvdtlCp.setTurnout_struct_code(item.getString("struct_code"));
moveinvdtlCp.setTurnout_struct_name(item.getString("struct_name"));
moveinvdtlCp.setTurnout_struct_id(item.getString("struct_id"));
}
itemList.add(moveinvdtlCp);
lockStructList.add(moveinvdtlCp.getTurnin_struct_code());
lockStructList.add(moveinvdtlCp.getTurnout_struct_code());
}
if (lockStructList.size()<rows.size()*2){
throw new BadRequestException("不允许选择相同货位进行分配");
}
moveinvdtlCpService.updateBatchById(itemList);
structattrService.update(
new UpdateWrapper<StIvtStructattr>().lambda()
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("移库锁"))
.set(StIvtStructattr::getInv_code,form.getString("bill_code"))
.in(StIvtStructattr::getStruct_code, lockStructList)
);
}
@Override
public void taskOperate(JSONObject form) {
String task_id = form.getString("task_id");
String status = form.getString("status");
StIvtMoveinvdtlCp dtl = moveinvdtlCpService.getOne(new QueryWrapper<StIvtMoveinvdtlCp>().eq("task_id", task_id));
StIvtMoveinvCp mst = this.getById(dtl.getMoveinv_id());
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
moveinvdtlCpService.update(new UpdateWrapper<StIvtMoveinvdtlCp>()
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成")).eq("moveinvdtl_id",dtl.getMoveinvdtl_id()));
List<StIvtMoveinvdtlCp> list = moveinvdtlCpService.list(new QueryWrapper<StIvtMoveinvdtlCp>()
.eq("moveinv_id", dtl.getMoveinv_id())
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("完成")));
if (list.size() == 0) {
this.update(new UpdateWrapper<StIvtMoveinvCp>()
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成"))
.eq("moveinv_id",dtl.getMoveinv_id()));
}
//减出库。加入库
JSONObject ivtOutParam = new JSONObject();
ivtOutParam.put("struct_id", dtl.getTurnout_struct_id());
ivtOutParam.put("material_id", dtl.getMaterial_id());
ivtOutParam.put("pcsn", dtl.getPcsn());
ivtOutParam.put("quality_scode", dtl.getQuality_scode());
ivtOutParam.put("ivt_level", dtl.getIvt_level());
ivtOutParam.put("change_qty", dtl.getQty());
ivtOutParam.put("change_type", ChangeIvtUtil.SUB_SUBIVT_QTY);
ivtOutParam.put("sale_id", dtl.getSale_id());
ivtOutParam.put("bill_code",mst.getBill_code());
ivtOutParam.put("inv_id",mst.getMoveinv_id());
ivtOutParam.put("bill_type_scode",mst.getBill_type());
iStIvtStructivtCpService.UpdateIvt(ivtOutParam);
// 解锁仓位
structattrService.update(
new StIvtStructattr()
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
.setInv_id("")
.setInv_type("")
.setInv_code(""),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dtl.getTurnout_struct_id())
);
//加入库
JSONObject ivtInParam = new JSONObject();
ivtInParam.put("struct_id", dtl.getTurnin_struct_id());
ivtInParam.put("material_id", dtl.getMaterial_id());
ivtInParam.put("pcsn", dtl.getPcsn());
ivtInParam.put("quality_scode", dtl.getQuality_scode());
ivtInParam.put("ivt_level", dtl.getIvt_level());
ivtInParam.put("change_qty", dtl.getQty());
ivtInParam.put("change_type", ChangeIvtUtil.ADD_SUBIVT_QTY);
ivtInParam.put("sale_id", dtl.getSale_id());
ivtInParam.put("bill_code",mst.getBill_code());
ivtInParam.put("inv_id",mst.getMoveinv_id());
ivtInParam.put("bill_type_scode",mst.getBill_type());
iStIvtStructivtCpService.UpdateIvt(ivtInParam);
structattrService.update(
new StIvtStructattr()
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
.setInv_id("")
.setInv_type("")
.setStoragevehicle_code(dtl.getStoragevehicle_code())
.setInv_code(""),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dtl.getTurnin_struct_id())
);
}
// if (status.equals(AcsTaskEnum.STATUS_CANNEL.getCode())) {
// structattrService.update(
// new StIvtStructattr()
// .setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
// .setInv_id("")
// .setInv_type("")
// .setInv_code(""),
// new QueryWrapper<StIvtStructattr>().lambda()
// .in(StIvtStructattr::getStruct_id, dtl.getTurnin_struct_id(),dtl.getTurnout_struct_id())
// );
// }
}
} }

View File

@@ -1,11 +1,28 @@
package org.nl.wms.storage_manage.productmanage.service.moveInv.impl; package org.nl.wms.storage_manage.productmanage.service.moveInv.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
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.MapOf;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.MoveInvEnum;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService; import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.StIvtMoveinvdtlCp;
import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper; import org.nl.wms.storage_manage.productmanage.service.moveInv.dao.mapper.StIvtMoveinvdtlCpMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
/** /**
* <p> * <p>
* 移库单明细表 服务实现类 * 移库单明细表 服务实现类
@@ -17,4 +34,51 @@ import org.springframework.stereotype.Service;
@Service @Service
public class StIvtMoveinvdtlCpServiceImpl extends ServiceImpl<StIvtMoveinvdtlCpMapper, StIvtMoveinvdtlCp> implements IStIvtMoveinvdtlCpService { public class StIvtMoveinvdtlCpServiceImpl extends ServiceImpl<StIvtMoveinvdtlCpMapper, StIvtMoveinvdtlCp> implements IStIvtMoveinvdtlCpService {
@Autowired
private ISchBaseTaskService taskService;
@Override
public List<Map> listJoinTask(String moveinv_id) {
if (StringUtils.isEmpty(moveinv_id)){
throw new BadRequestException("移库单主单据id不能为空");
}
return this.baseMapper.listJoinTask(moveinv_id);
}
@Override
public void taskOption(JSONObject form, String option) {
StIvtMoveinvdtlCp moveinvdtl = this.getById(form.getString("moveinvdtl_id"));
switch (option){
case "immediateNotifyAcs":
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_CP_MOVE)
.acs_task_type(AcsTaskEnum.ACS_TASK_TYPE_RT.getCode())
.task_group_id(IdUtil.getStringId())
.point_code1(form.getString("turnout_struct_code"))
.point_code3(form.getString("turnin_struct_code"))
.vehicle_code(form.getString("storagevehicle_code"))
.product_area("A1")
.callback((Consumer<String>) moveinvdtl::setTask_id)
.build();
BussEventMulticaster.Publish(event);
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("移库中"));
break;
case "forceFinish":
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("完成"));
break;
case "cannel":
String task_id = moveinvdtl.getTask_id();
SchBaseTask task = taskService.getById(task_id);
if (task.getTask_status().equals(TaskStatusEnum.ISSUE.getCode())||task.getTask_status().equals(TaskStatusEnum.EXECUTING.getCode())){
throw new BadRequestException("当前移库任务正在执行中,不允许取消");
}
moveinvdtl.setBill_status(MoveInvEnum.BILL_STATUS.code("取消"));
moveinvdtl.setTask_id("");
break;
}
this.updateById(moveinvdtl);
taskService.operation(MapOf.of("method_name",option,"task_id",form.getString("task_id")));
}
} }

View File

@@ -103,6 +103,14 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
// 减冻结、减库存 // 减冻结、减库存
subFrozenSubQty(json); subFrozenSubQty(json);
break; break;
case ChangeIvtUtil.SUB_SUBIVT_QTY:
// 减冻结、减库存
subSubQty(json);
break;
case ChangeIvtUtil.ADD_SUBIVT_QTY:
// 减冻结、减库存
AddQty(json);
break;
default: default:
throw new BadRequestException("变动类型异常!"); throw new BadRequestException("变动类型异常!");
} }
@@ -445,7 +453,86 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
param.put("result_qty", ivt_qty); param.put("result_qty", ivt_qty);
insetIvtChange(param); insetIvtChange(param);
} }
private void subSubQty(JSONObject json) {
// 找到对应库存
StIvtStructivtCp ivtDao = new StIvtStructivtCp();
if (ObjectUtil.isEmpty(json.getString("sale_id"))) {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getPcsn, json.getString("pcsn"))
);
} else {
ivtDao = this.getOne(
new QueryWrapper<StIvtStructivtCp>().lambda()
.eq(StIvtStructivtCp::getStruct_id, json.getString("struct_id"))
.eq(StIvtStructivtCp::getMaterial_id, json.getString("material_id"))
.eq(StIvtStructivtCp::getSale_id,json.getString("sale_id"))
);
}
if (ObjectUtil.isEmpty(ivtDao)) throw new BadRequestException("库存异常,请检查!");
// 库存数
double ivt_qty = NumberUtil.sub(ivtDao.getIvt_qty().doubleValue(), json.getDoubleValue("change_qty"));
if (ivt_qty == 0) {
// 删除
this.removeById(ivtDao.getStockrecord_id());
} else {
ivtDao.setIvt_qty(BigDecimal.valueOf(ivt_qty));
ivtDao.setCanuse_qty(BigDecimal.valueOf(ivt_qty));
this.updateById(ivtDao);
}
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
param.put("change_type_scode", ChangeIvtUtil.SUB_SUBIVT_QTY);
param.put("inv_id", json.getString("inv_id"));
param.put("bill_type_scode", json.getString("bill_type_scode"));
param.put("bill_code", json.getString("bill_code"));
param.put("change_qty", json.getBigDecimal("change_qty"));
param.put("result_qty", ivt_qty);
insetIvtChange(param);
}
private void AddQty(JSONObject json) {
// 为空插入
StIvtStructattr attrDao = iStIvtStructattrService.getById(json.getString("struct_id"));
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getById(json.getString("material_id"));
StIvtStructivtCp dao = new StIvtStructivtCp();
dao.setStockrecord_id(org.nl.common.utils.IdUtil.getStringId());
dao.setStruct_id(attrDao.getStruct_id());
dao.setStruct_code(attrDao.getStruct_code());
dao.setStruct_name(attrDao.getStruct_name());
dao.setMaterial_id(materDao.getMaterial_id());
dao.setQuality_scode(json.getString("quality_scode"));
dao.setIvt_level(json.getString("ivt_level"));
dao.setIs_active(true);
dao.setPcsn(json.getString("pcsn"));
dao.setFrozen_qty(BigDecimal.valueOf(0));
dao.setCanuse_qty(json.getBigDecimal("change_qty"));
dao.setIvt_qty(json.getBigDecimal("change_qty"));
dao.setQty_unit_id(materDao.getBase_unit_id());
dao.setSale_id(json.getString("sale_id"));
dao.setProduct_area(json.getString("product_area"));
dao.setStor_id(json.getString("stor_id"));
dao.setUnit_weight(materDao.getNet_weight());
dao.setBill_type(json.getString("bill_type_scode"));
this.save(dao);
// 插入库存变动记录
JSONObject param = JSONObject.parseObject(JSON.toJSONString(dao));
param.put("change_type_scode", ChangeIvtUtil.ADD_SUBIVT_QTY);
param.put("change_qty", json.getBigDecimal("change_qty"));
param.put("inv_id", json.getString("inv_id"));
param.put("bill_type_scode", json.getString("bill_type_scode"));
param.put("bill_code", json.getString("bill_code"));
param.put("result_qty", 0);
insetIvtChange(param);
}
/* /*
校验数据 校验数据
*/ */

View File

@@ -31,6 +31,15 @@ public class ChangeIvtUtil {
* 减冻结、减库存 * 减冻结、减库存
*/ */
public static final String SUBFROZEN_SUBIVT_QTY = "6"; public static final String SUBFROZEN_SUBIVT_QTY = "6";
/**
* 减库存
*/
public static final String SUB_SUBIVT_QTY = "7";
/**
* 加库存
*/
public static final String ADD_SUBIVT_QTY = "8";
} }

View File

@@ -58,7 +58,7 @@
and mst.bill_code = #{query.bill_code} and mst.bill_code = #{query.bill_code}
</if> </if>
</where> </where>
GROUP BY mst.bill_code
order by create_time DESC order by create_time DESC
</select> </select>

View File

@@ -76,6 +76,7 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) { public Object pageQuery(YlIostorInvQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize()); Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery); List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery);
TableDataInfo<Map> build = TableDataInfo.build(mst_detail); TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
build.setTotalElements(page.getTotal()); build.setTotalElements(page.getTotal());
return build; return build;

View File

@@ -11,6 +11,7 @@ import org.nl.wms.storage_manage.pda.service.PdaStBcpInService;
import org.nl.wms.storage_manage.productmanage.service.check.IStIvtCheckmstCpService; import org.nl.wms.storage_manage.productmanage.service.check.IStIvtCheckmstCpService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpOutService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpOutService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
import org.nl.wms.storage_manage.productmanage.service.moveInv.IStIvtMoveinvCpService;
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.iostorInv.IStIvtIostorinvBcpOutService; import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpOutService;
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService; import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
@@ -66,6 +67,10 @@ public enum TASKEnum implements FunctionStrategy<String, JSONObject> {
IStIvtCheckmstCpService bean = SpringContextHolder.getBean(IStIvtCheckmstCpService.class); IStIvtCheckmstCpService bean = SpringContextHolder.getBean(IStIvtCheckmstCpService.class);
bean.taskOperate(form); bean.taskOperate(form);
}), }),
CP_MOVE_TASK(type -> AcsTaskEnum.TASK_STRUCT_CP_MOVE.getCode().equals(type), form -> {
IStIvtMoveinvCpService bean = SpringContextHolder.getBean(IStIvtMoveinvCpService.class);
bean.taskOperate(form);
}),
POINT_FINISH_TASK(type -> AcsTaskEnum.TASK_WASH_FULL_QZ.getCode().equals(type), form -> { POINT_FINISH_TASK(type -> AcsTaskEnum.TASK_WASH_FULL_QZ.getCode().equals(type), form -> {
ISchBasePointService bean = SpringContextHolder.getBean(ISchBasePointService.class); ISchBasePointService bean = SpringContextHolder.getBean(ISchBasePointService.class);
bean.taskOperate(form); bean.taskOperate(form);

View File

@@ -7,8 +7,13 @@ INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`,
-- 移库单
INSERT INTO `hl_one_mes`.`sys_code_rule_detail`(`id`, `type`, `init_value`, `current_value`, `max_value`, `step`, `fillchar`, `format`, `length`, `sort_num`, `remark`, `code_rule_id`, `is_active`, `is_delete`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('d29d467457c945da9c69e3ad2d036f86', '01', 'PD', 'PD', '', '', '', '', NULL, 0, '', 'd3911293b92841e2800dcb115c01970e', '1', '0', 0, '', '2021-09-23 10:58:20', 0, '', '');
-- 字典添加手工移库
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699305837757075456', 'ST_INV_MOVE_TYPE', '移库类型', '手工移库', '1', 1, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:17:37', '1694303357524643840', '管理员', '2023-09-06 14:17:37');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310839531704320', 'MOVE_BILL_STATUS', '移库单状态', '完成', '99', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:30', '1694303357524643840', '管理员', '2023-09-06 14:37:30');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310801569058816', 'MOVE_BILL_STATUS', '移库单状态', '移库中', '20', 2, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:37:21', '1694303357524643840', '管理员', '2023-09-06 14:37:21');
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1699310669570117632', 'MOVE_BILL_STATUS', '移库单状态', '生成', '10', 1, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-06 14:36:49', '1694303357524643840', '管理员', '2023-09-06 14:36:49');

View File

@@ -39,16 +39,16 @@
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<el-button <!-- <el-button-->
slot="right" <!-- slot="right"-->
class="filter-item" <!-- class="filter-item"-->
type="success" <!-- type="success"-->
icon="el-icon-position" <!-- icon="el-icon-position"-->
size="mini" <!-- size="mini"-->
@click="synchronize()" <!-- @click="synchronize()"-->
> <!-- >-->
同步 <!-- 同步-->
</el-button> <!-- </el-button>-->
<el-button <el-button
slot="right" slot="right"
class="filter-item" class="filter-item"

View File

@@ -0,0 +1,345 @@
<!--suppress ALL -->
<template>
<el-dialog
title="移库单新增"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
@open="open"
@close="close"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button
icon="el-icon-check"
size="mini"
:loading="crud.cu === 2"
type="primary"
@click="crud.submitCU"
>保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form
ref="form"
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
:inline="true"
:model="form"
:rules="rules"
size="mini"
label-width="85px"
label-suffix=":"
>
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
<el-form-item label="单据号" prop="bill_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label>
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
</el-form-item>
<el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
<el-select
v-model="form.stor_id"
clearable
placeholder="仓库"
class="filter-item"
style="width: 210px"
:disabled="crud.status.view > 0"
@change="storChange"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型" prop="buss_type">
<el-select
v-model="form.buss_type"
clearable
placeholder="业务类型"
style="width: 210px"
class="filter-item"
:disabled="crud.status.cu > 1"
>
<el-option
v-for="item in dict.ST_INV_MOVE_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态" prop="bill_status">
<el-select
v-model="form.bill_status"
placeholder="单据状态"
class="filter-item"
disabled
>
<el-option
v-for="item in dict.MOVE_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input
v-model.trim="form.remark"
style="width: 380px;"
rows="2"
type="textarea"
:disabled="crud.status.view > 0"
/>
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span">移库单明细</span>
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
>
添加移库物料
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="queryDtl()"
>
自动分配
</el-button>
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form.tableData"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column prop="seq_no" label="序号" width="50" align="center" />
<el-table-column prop="turnout_sect_name" label="移库库区" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" >
<template slot-scope="scope">
<el-input v-show="isedit" v-model="scope.row.turnin_struct_code" clearable style="width: 150px" @clear="scope.row.turnin_struct_code='',scope.row.turnin_struct_name=''">
<el-button slot="append" icon="el-icon-plus" @click="queryStruct(scope.$index,scope.row)" ></el-button>
</el-input>
<span v-show="!isedit">{{ scope.row.turnin_struct_code }}</span>
</template>
</el-table-column>
<el-table-column prop="task_code" label="任务编号" align="center" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="100" fixed="right">
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
/>
</template>
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
<AddStruct :dialog-show.sync="structShow" @structChanged="structChanged" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import AddDtl from '@/views/wms/storage_manage/product/productCheck/StructIvt'
import AddStruct from '@/views/wms/storage_manage/product/moveInv/AddStruct'
import moveInv from '@/views/wms/storage_manage/product/moveInv/moveInv'
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
status: '10',
dtl_num: '0',
buss_type: '',
remark: '',
isedit: false,
create_mode: '',
tableData: []
}
export default {
name: 'AddDialog',
components: { AddDtl,AddStruct },
mixins: [crud(), form(defaultForm)],
props: {
dialogShow: {
type: Boolean,
default: false
}
},
dicts: ['MOVE_BILL_STATUS', 'ST_INV_MOVE_TYPE', 'check_dtl_status', 'product_area'],
data() {
return {
dialogVisible: false,
dtlShow: false,
structShow: false,
flagnow: false,
nowrow: {},
nowindex: '',
storlist: [],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
],
check_type: [
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
// 查询原材料库的仓库
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
this.storlist = res.content
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
this.isedit = true
moveInv.getMoveDtl({ 'moveinv_id': this.form.moveinv_id }).then(res => {
this.form.tableData = res.content
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToAdd]() {
this.isedit = true
},
[CRUD.HOOK.afterToView]() {
this.isedit = false
moveInv.getMoveDtl({ 'moveinv_id': this.form.moveinv_id }).then(res => {
this.form.tableData = res.content
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
storChange(row) {
this.storlist.forEach((item) => {
if (item.stor_id === row) {
this.form.stor_code = item.stor_code
this.form.stor_name = item.stor_name
}
})
},
async queryDtl() {
this.dtlShow = true
},
async queryStruct(index,row) {
this.nowindex = index
this.nowrow = row
this.structShow = true
},
structChanged(rows){
console.log(rows[0].struct_code)
this.$set(this.nowrow,'turnin_struct_code',rows[0].struct_code)
this.$set(this.nowrow,'turnin_struct_name',rows[0].struct_name)
this.$set(this.nowrow,'turnin_struct_id',rows[0].struct_id)
this.form.tableData.splice(this.nowindex, 1, this.nowrow)
},
tableChanged(rows) {
const tablemap = new Map()
rows.forEach((item) => {
if (this.form.tableData.length !== 0) {
this.flagnow = false
for (let i = 0; i < this.form.tableData.length; i++) {
if ((this.form.tableData[i].struct_code === item.struct_code) && (this.form.tableData[i].material_code === item.material_code)) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.status = '01'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
} else {
item.status = '01'
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
}
})
for (const value of tablemap.values()) {
value.base_qty = value.canuse_qty
this.form.tableData.push(value)
}
this.form.dtl_num = this.form.tableData.length
},
deleteRow(index, rows) {
rows.splice(index, 1)
this.nowindex = ''
this.nowrow = {}
this.form.dtl_num = this.form.tableData.length
},
[CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
padding: 4px 4px;
}
</style>

View File

@@ -0,0 +1,173 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<el-row>
<el-col :span="6">
<!-- 搜索 -->
<el-cascader
placeholder="库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.struct_code"
clearable
size="mini"
placeholder="货位号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="6">
<el-input
v-model="query.remark"
clearable
size="mini"
placeholder="物料"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="110px" />
<el-table-column show-overflow-tooltip prop="base_qty" label="桶数" :formatter="crud.formatNum0" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
<el-table-column show-overflow-tooltip prop="storage_qty" :formatter="crud.formatNum3" label="重量" width="110px" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
<el-button slot="left" type="primary" @click="submit">保存</el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'AddDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/getStructIvt',
query: {
struct_code: '',
remark: '',
sect_id: '',
stor_id: ''
},
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
opendtlParam: '',
sects: [],
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
this.sects = res.content
})
this.crud.toQuery()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选载具物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
}
}
}
</script>

View File

@@ -0,0 +1,181 @@
<!--suppress ALL -->
<template>
<el-dialog
title="库位选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
width="1000px"
@close="close"
@open="open"
>
<el-row>
<!-- <el-col :span="6">-->
<!-- &lt;!&ndash; 搜索 &ndash;&gt;-->
<!-- <el-cascader-->
<!-- placeholder="库区"-->
<!-- :options="sects"-->
<!-- :props="{ checkStrictly: true }"-->
<!-- clearable-->
<!-- @change="sectQueryChange"-->
<!-- />-->
<!-- </el-col>-->
<el-col :span="6">
<el-input
v-model="query.struct_code"
clearable
size="mini"
placeholder="货位号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<!-- <el-col :span="6">-->
<!-- <el-input-->
<!-- v-model="query.remark"-->
<!-- clearable-->
<!-- size="mini"-->
<!-- placeholder="物料"-->
<!-- style="width: 200px;"-->
<!-- class="filter-item"-->
<!-- @keyup.enter.native="crud.toQuery"-->
<!-- />-->
<!-- </el-col>-->
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" width="110px" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" width="110px" />
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" width="110px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
<el-table-column show-overflow-tooltip prop="is_used" :formatter="formatBoolean" label="是否启用" width="110px" />
<el-table-column show-overflow-tooltip prop="lock_type" label="锁定类型" width="150px" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button slot="left" type="info"@click="dialogVisible = false">关闭</el-button>
<el-button slot="left" type="primary" @click="submit">保存</el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
export default {
name: 'AddStruct',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '仓位', idField: 'struct_id', url: '/api/structattr',
query: {
struct_code: '',
remark: '',
sect_id: '1528631043496742912',
stor_id: '1528627995269533696'
},
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: String
}
},
data() {
return {
dialogVisible: false,
opendtlParam: '',
sects: [],
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
openParam: {
handler(newValue, oldValue) {
this.opendtlParam = newValue
}
}
},
methods: {
open() {
crudSectattr.getSect({ is_materialstore: '1' }).then(res => {
this.sects = res.content
})
this.crud.toQuery()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
sectQueryChange(val) {
if (val.length === 1) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = ''
}
if (val.length === 0) {
this.crud.query.sect_id = ''
this.crud.query.stor_id = ''
}
if (val.length === 2) {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
},
formatBoolean: function(row, column) {
var ret = ''
if (row[column.property] === true) {
ret = '是' // 根据自己的需求设定
} else {
ret = '否'
}
return ret
},
submit() {
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选载具物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('structChanged', this.rows)
}
}
}
</script>

View File

@@ -0,0 +1,232 @@
<template>
<el-dialog
v-loading.fullscreen.lock="fullscreenLoading"
append-to-body
:visible.sync="dialogVisible2"
destroy-on-close
:show-close="false"
fullscreen
@close="close"
>
<span slot="title" class="dialog-footer">
<div class="crud-opts2">
<span class="el-dialog__title2">移库单任务操作</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button slot="left" type="info" @click="dialogVisible2 = false">关闭</el-button>
</span>
</div>
</span>
<div class="crud-opts2">
<span class="role-span">入库单据任务项</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="sendTask()"
>
下发
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="confirmTask()"
>
强制完成
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="delTask()"
>
取消任务
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="this.openParam"
style="width: 100%;"
max-height="300"
border
highlight-current-row
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
>
<el-table-column prop="seq_no" label="序号" width="50" align="center" />
<el-table-column prop="turnout_sect_name" label="移库库区" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
<el-table-column prop="qty" label="数量" align="center" :formatter="crud.formatNum0" />
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
<el-table-column prop="turnout_struct_code" label="移出货位" align="center" />
<el-table-column prop="turnin_struct_code" label="移入货位" align="center" />
<el-table-column prop="task_code" label="任务编号" align="center" />
<el-table-column prop="task_status" label="任务状态" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
export default {
name: 'MoveTaskDialog',
components: {},
mixins: [crud()],
dicts: ['SCH_TASK_TYPE_DTL', 'task_status', 'PCS_SAL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Array,
default: () => { return [] }
}
},
data() {
return {
dialogVisible2: false,
dis_row: null,
dis_del: true,
dis_send: true,
dis_confirm: true,
fullscreenLoading: false,
form: {
tableMater: [],
dtl_row: null,
checked: '1'
},
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible2 = newValue
}
}
},
methods: {
close() {
this.$emit('update:dialogShow', false)
this.form.tableMater = []
this.form.checked = '1'
this.form.dtl_row = null
this.$emit('AddChanged')
},
clcikRow(row) {
this.form.dtl_row = row
},
delTask() {
this.fullscreenLoading = true
crudProductIn.delTask({ 'iostorinvdis_id': this.dis_row.iostorinvdis_id }).then(res => {
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
sendTask() {
console.log(this.form.dtl_row)
// this.fullscreenLoading = true
// crudProductIn.sendTask({ 'task_id': this.dis_row.task_id }).then(res => {
// this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
// this.fullscreenLoading = false
// this.queryTableDdis()
// this.initFlag()
// }).catch(() => {
// this.fullscreenLoading = false
// })
},
confirmTask() {
this.fullscreenLoading = true
crudProductIn.confirmTask({ 'task_id': this.dis_row.task_id }).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.fullscreenLoading = false
this.queryTableDdis()
this.initFlag()
}).catch(() => {
this.fullscreenLoading = false
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
queryTableDdis() {
if (this.form.dtl_row !== null) {
crudProductIn.getIosInvDis({ 'iostorinvdtl_id': this.form.dtl_row.iostorinvdtl_id }).then(res => {
this.form.tableMater = res
}).catch(() => {
this.form.tableMater = []
})
}
},
formatStatus(row) {
return this.dict.label.task_status[row.task_status]
},
formatType(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.task_type]
},
initFlag() {
this.dis_del = true
this.dis_send = true
this.dis_confirm = true
},
formatBaseType(row) {
return this.dict.label.PCS_SAL_TYPE[row.base_bill_type]
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,362 @@
<!--suppress ALL -->
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-input
v-model="query.bill_code"
size="mini"
clearable
placeholder="移库单号"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="所属仓库">
<el-select
v-model="query.stor_id"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in storlist"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
/>
</el-form-item>
<el-form-item label="生成方式">
<el-select
v-model="query.create_mode"
clearable
size="mini"
placeholder="生成方式"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_CREATE_MODE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="单据状态">
<el-select
v-model="query.bill_status"
clearable
size="mini"
placeholder="单据状态"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.MOVE_BILL_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="业务类型">
<el-select
v-model="query.bill_type"
clearable
filterable
size="mini"
placeholder="业务类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.ST_INV_MOVE_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation/>
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
@click="taskOpen"
>
任务作业
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
:disabled="confirm_flag"
icon="el-icon-check"
size="mini"
@click="confirm"
>
强制完成
</el-button>
<!--<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
:disabled="downdtl_flag"
size="mini"
@click="downdtl"
>
导出Excel
</el-button>-->
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
:max-height="590"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
:highlight-current-row="true"
@selection-change="crud.selectionChangeHandler"
@current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column
v-permission="['admin','check:del','check:edit']"
label="操作"
width="160"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:disabled-edit="canUd(scope.row)"
:disabled-dle="canUd(scope.row)"
/>
</template>
</el-table-column>
<el-table-column :selectable="checkboxT" type="selection" width="55"/>
<el-table-column prop="bill_code" min-width="130" label="单据号">
<template slot-scope="scope">
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.bill_code }}</el-link>
</template>
</el-table-column>
<el-table-column :formatter="stateFormat" min-width="100" prop="bill_status" label="单据状态"/>
<el-table-column prop="stor_name" label="仓库" min-width="100"/>
<el-table-column prop="bill_type" :formatter="bill_typeFormat" min-width="100" label="业务类型"/>
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" min-width="100"/>
<el-table-column label="明细数" align="center" prop="dtl_count" min-width="100"/>
<el-table-column prop="biz_date" min-width="135" label="业务日期"/>
<el-table-column prop="create_time" min-width="135" label="创建日期"/>
</el-table>
<!--分页组件-->
<pagination/>
</div>
<AddDialog @AddChanged="querytable"/>
<MoveTaskDialog :dialog-show.sync="taskShow" :open-param="taskOpenParam" />
</div>
</template>
<script>
import check from '@/views/wms/storage_manage/product/moveInv/moveInv'
import CRUD, {crud, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/storage_manage/product/moveInv/AddDialog'
import MoveTaskDialog from '@/views/wms/storage_manage/product/moveInv/MoveTaskDialog'
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
import {download} from '@/api/data'
import {downloadFile} from '@/utils'
export default {
name: 'moveInv',
components: {AddDialog, MoveTaskDialog, crudOperation, rrOperation, udOperation, pagination},
cruds() {
return CRUD({
title: '用户',
props: {
// 每页数据条数f
size: 20
},
idField: 'moveinv_id', url: 'api/stIvtMoveinvCp', crudMethod: {...check},
optShow: {
add: true,
edit: false,
del: false,
reset: true,
download: false
}
})
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['MOVE_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_MOVE_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
permission: {
add: ['admin', 'check:add'],
edit: ['admin', 'check:edit'],
del: ['admin', 'check:del']
},
check_flag: true,
downdtl_flag: true,
confirm_flag: true,
currentRow: null,
storlist: [],
taskOpenParam:[],
taskShow: false
}
},
mounted: function () {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;'
}
},
created() {
crudStorattr.getStor({'stor_type': '4'}).then(res => {
this.storlist = res.content
})
},
methods: {
canUd(row) {
return row.bill_status !== '10'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.buss_type = ''
this.handleCurrentChange(null)
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
} else {
this.handleCurrentChange(null)
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(current) {
if (current !== null) {
this.currentRow = current
this.downdtl_flag = false
if (current.status === '10' || current.status === '30') {
this.check_flag = false
} else {
this.check_flag = true
}
if (current.status === '30' && current.is_nok) {
this.confirm_flag = false
} else {
this.confirm_flag = true
}
}
},
stateFormat(row) {
return this.dict.label.MOVE_BILL_STATUS[row.bill_status]
},
bill_typeFormat(row) {
return this.dict.label.ST_INV_MOVE_TYPE[row.bill_type]
},
create_modeFormat(row) {
return this.dict.label.ST_CREATE_MODE[row.create_mode]
},
is_nokFormat(row) {
if (row.is_nok) {
return '异常'
} else {
return '正常'
}
},
handleCurrentChange(current) {
if (current === null) {
this.confirm_flag = true
this.check_flag = true
this.downdtl_flag = true
this.currentRow = null
}
},
checkboxT(row) {
return row.bill_status !== '99'
},
taskOpen() {
check.getMoveDtl({ 'moveinv_id': this.currentRow.moveinv_id }).then(res => {
this.taskOpenParam = res.content
})
this.taskShow = true
},
confirm() {
if (this.currentRow !== null) {
this.$refs.child2.setForm(this.currentRow)
}
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
download('/api/check/download', {check_id: this.currentRow.check_id}).then(result => {
downloadFile(result, this.currentRow.check_code + '盘点数据', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
}
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 10px;
}
</style>

View File

@@ -0,0 +1,49 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/stIvtMoveinvCp',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/stIvtMoveinvCp/delete',
method: 'post',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/stIvtMoveinvCp/update',
method: 'post',
data
})
}
export function getMoveDtl(data) {
return request({
url: '/api/stIvtMoveinvCp/getMoveDtl',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/stIvtCheckmstCp/getStructIvt',
method: 'get',
params
})
}
export default {
add,
edit,
del,
getMoveDtl,
getStructIvt
}

View File

@@ -62,7 +62,7 @@
class="filter-item" class="filter-item"
> >
<el-option <el-option
v-for="item in dict.ST_INV_RAW_IN_TYPE" v-for="item in dict.ST_INV_CP_IN_TYPE"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@@ -281,7 +281,7 @@ export default {
name: 'AddDialog', name: 'AddDialog',
components: { MaterDtl, BillDtl }, components: { MaterDtl, BillDtl },
mixins: [crud(), form(defaultForm)], mixins: [crud(), form(defaultForm)],
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'], dicts: ['IO_BILL_STATUS', 'ST_INV_CP_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
props: { props: {
dialogShow: { dialogShow: {
type: Boolean, type: Boolean,

View File

@@ -137,7 +137,7 @@
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120px" /> <el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120px" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="130px" /> <el-table-column show-overflow-tooltip prop="material_name" label="物料名称" width="130px" />
<el-table-column show-overflow-tooltip prop="canuse_qty" :formatter="crud.formatNum3" label="数量" width="80px" /> <el-table-column show-overflow-tooltip prop="canuse_qty" :formatter="crud.formatNum3" label="数量" width="80px" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" width="70px" sortable /> <el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" width="90px" sortable />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="85px" /> <el-table-column show-overflow-tooltip prop="struct_code" label="货位" width="85px" />
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重" width="85px" /> <el-table-column show-overflow-tooltip prop="unit_weight" label="单重" width="85px" />
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" fixed="right"> <el-table-column v-if="crud.status.cu > 0" align="center" label="操作" fixed="right">