add:三线半成品移库
This commit is contained in:
@@ -44,6 +44,7 @@ public enum AcsTaskEnum {
|
|||||||
TASK_STRUCT_BCP_EMPOUT("17","半成品-空托盘出库"),
|
TASK_STRUCT_BCP_EMPOUT("17","半成品-空托盘出库"),
|
||||||
TASK_STRUCT_CP_MOVE("18","成品-移库"),
|
TASK_STRUCT_CP_MOVE("18","成品-移库"),
|
||||||
TASK_STRUCT_BCP_MOVE("19","半成品-移库"),
|
TASK_STRUCT_BCP_MOVE("19","半成品-移库"),
|
||||||
|
TASK_STRUCT_BCP_HR_MOVE("20","三线半成品-移库"),
|
||||||
|
|
||||||
TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"),
|
TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"),
|
||||||
TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"),
|
TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"),
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckmstHrBcpS
|
|||||||
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvEmpBcpService;
|
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvEmpBcpService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpInService;
|
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpInService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpOutService;
|
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpOutService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvHrBcpService;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@@ -101,6 +102,10 @@ public enum TASKEnum implements FunctionStrategy<String, JSONObject> {
|
|||||||
IStIvtIostorinvEmpBcpService bean = SpringContextHolder.getBean(IStIvtIostorinvEmpBcpService.class);
|
IStIvtIostorinvEmpBcpService bean = SpringContextHolder.getBean(IStIvtIostorinvEmpBcpService.class);
|
||||||
bean.taskOperateOut(form);
|
bean.taskOperateOut(form);
|
||||||
}),
|
}),
|
||||||
|
HR_BCP_EMP_MOVE_TASK(type -> AcsTaskEnum.TASK_STRUCT_BCP_HR_MOVE.getCode().equals(type), form -> {
|
||||||
|
IStIvtMoveinvHrBcpService bean = SpringContextHolder.getBean(IStIvtMoveinvHrBcpService.class);
|
||||||
|
bean.taskOperate(form);
|
||||||
|
}),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.controller.moveIvt;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvdtlHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dto.MoveInvHrBcpQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单主表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/stIvtMoveinvHrBcp")
|
||||||
|
public class StIvtMoveinvHrBcpController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtMoveinvHrBcpService moveinvHrBcpService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtMoveinvdtlHrBcpService iStIvtMoveinvdtlHrBcpService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询移库主表")
|
||||||
|
//("查询盘点单主表")
|
||||||
|
public ResponseEntity<Object> query(MoveInvHrBcpQuery query, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(moveinvHrBcpService.page(page.build(StIvtMoveinvHrBcp.class),query.build())), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("创建移库单")
|
||||||
|
//("创建盘点单")
|
||||||
|
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||||
|
moveinvHrBcpService.create(whereJson);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getMoveDtl")
|
||||||
|
@Log("查询盘点明细")
|
||||||
|
//("查询盘点明细")
|
||||||
|
public ResponseEntity<Object> getCheckDtl(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(iStIvtMoveinvdtlHrBcpService.listJoinTask(whereJson.getString("moveinv_id"))), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
@Log("更新单据")
|
||||||
|
//("查询盘点明细")
|
||||||
|
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||||
|
moveinvHrBcpService.update(whereJson);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
@Log("取消单据")
|
||||||
|
//("查询盘点明细")
|
||||||
|
public ResponseEntity<Object> cancel(@RequestBody JSONObject whereJson) {
|
||||||
|
moveinvHrBcpService.cancel(whereJson);
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.controller.moveIvt;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvdtlHrBcpService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单明细表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/stIvtMoveinvdtlHrBcp")
|
||||||
|
public class StIvtMoveinvdtlHrBcpController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtMoveinvdtlHrBcpService iStIvtMoveinvdtlHrBcpService;
|
||||||
|
|
||||||
|
@PostMapping("/task/{option}")
|
||||||
|
public ResponseEntity<Object> optionTask(@RequestBody JSONObject form, @PathVariable String option){
|
||||||
|
iStIvtMoveinvdtlHrBcpService.taskOption(form,option);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@ import org.nl.common.anno.Log;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.utils.ListOf;
|
import org.nl.common.utils.ListOf;
|
||||||
import org.nl.common.utils.MapOf;
|
import org.nl.common.utils.MapOf;
|
||||||
|
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StIvtStructivtBcpVo;
|
import org.nl.wms.storage_manage.semimanage.service.structIvt.dto.StIvtStructivtBcpVo;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
||||||
@@ -59,6 +60,13 @@ public class StIvtStructivtHrBcpController {
|
|||||||
return new ResponseEntity<>(bcpService.getBcpIvt(query, page), HttpStatus.OK);
|
return new ResponseEntity<>(bcpService.getBcpIvt(query, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getBcpMoveIvt")
|
||||||
|
@Log("查询可用的半成品库存(移库)")
|
||||||
|
//("查询可用的半成品库存")
|
||||||
|
public ResponseEntity<Object> getBcpIvt(StructIvtYLQuery query, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(bcpService.getBcpMoveIvt(query, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/getBcpIvtInfo")
|
@PostMapping("/getBcpIvtInfo")
|
||||||
@Log("查询可用的半成品库存")
|
@Log("查询可用的半成品库存")
|
||||||
//("查询可用的半成品库存")
|
//("查询可用的半成品库存")
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ public class StIvtIostorinvHrBcpInServiceImpl extends ServiceImpl<StIvtIostorinv
|
|||||||
//分配货位。下发任务,更新主单据状态。更新明细任务
|
//分配货位。下发任务,更新主单据状态。更新明细任务
|
||||||
StIvtSectattr sect = sectattrService.getOne(
|
StIvtSectattr sect = sectattrService.getOne(
|
||||||
new QueryWrapper<StIvtSectattr>().lambda()
|
new QueryWrapper<StIvtSectattr>().lambda()
|
||||||
.eq(StIvtSectattr::getSect_name, "海柔半成品库区")
|
.eq(StIvtSectattr::getSect_code, "HKQ001")
|
||||||
);
|
);
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("sect_id", sect.getSect_id());
|
jo.put("sect_id", sect.getSect_id());
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvHrBcp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单主表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface IStIvtMoveinvHrBcpService extends IService<StIvtMoveinvHrBcp> {
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param form
|
||||||
|
*/
|
||||||
|
void create(JSONObject form);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param form
|
||||||
|
*/
|
||||||
|
void update(JSONObject form);
|
||||||
|
|
||||||
|
void cancel(JSONObject form);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务回调处理
|
||||||
|
* @param form
|
||||||
|
*/
|
||||||
|
void taskOperate(JSONObject form);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvdtlHrBcp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单明细表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface IStIvtMoveinvdtlHrBcpService extends IService<StIvtMoveinvdtlHrBcp> {
|
||||||
|
|
||||||
|
List<Map> listJoinTask(String moveinv_id);
|
||||||
|
|
||||||
|
void taskOption(JSONObject form, String option);
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单主表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_moveinv_hr_bcp")
|
||||||
|
public class StIvtMoveinvHrBcp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移库单标识
|
||||||
|
*/
|
||||||
|
@TableId(value = "moveinv_id")
|
||||||
|
private String moveinv_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据编号
|
||||||
|
*/
|
||||||
|
private String bill_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
private String buss_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型
|
||||||
|
*/
|
||||||
|
private String bill_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务日期
|
||||||
|
*/
|
||||||
|
private String biz_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库标识
|
||||||
|
*/
|
||||||
|
private String stor_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String stor_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库名称
|
||||||
|
*/
|
||||||
|
private String stor_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
private BigDecimal total_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细数
|
||||||
|
*/
|
||||||
|
private Integer dtl_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据状态
|
||||||
|
*/
|
||||||
|
private String bill_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成方式
|
||||||
|
*/
|
||||||
|
private String create_mode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单人
|
||||||
|
*/
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单人姓名
|
||||||
|
*/
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制单时间
|
||||||
|
*/
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人
|
||||||
|
*/
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人姓名
|
||||||
|
*/
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门ID
|
||||||
|
*/
|
||||||
|
private String sysdeptid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
private String syscompanyid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Boolean is_delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车间标识
|
||||||
|
*/
|
||||||
|
private String product_area;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单明细表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_moveinvdtl_hr_bcp")
|
||||||
|
public class StIvtMoveinvdtlHrBcp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移库单明细标识
|
||||||
|
*/
|
||||||
|
@TableId(value = "moveinvdtl_id")
|
||||||
|
private String moveinvdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移库单标识
|
||||||
|
*/
|
||||||
|
private String moveinv_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细序号
|
||||||
|
*/
|
||||||
|
private Integer seq_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出库区标识
|
||||||
|
*/
|
||||||
|
private String turnout_sect_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出库区编码
|
||||||
|
*/
|
||||||
|
private String turnout_sect_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出库区名称
|
||||||
|
*/
|
||||||
|
private String turnout_sect_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出仓位标识
|
||||||
|
*/
|
||||||
|
private String turnout_struct_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出仓位编码
|
||||||
|
*/
|
||||||
|
private String turnout_struct_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转出仓位名称
|
||||||
|
*/
|
||||||
|
private String turnout_struct_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
private String material_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品质类型
|
||||||
|
*/
|
||||||
|
private String quality_scode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存等级
|
||||||
|
*/
|
||||||
|
private String ivt_level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可用
|
||||||
|
*/
|
||||||
|
private Boolean is_active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位标识
|
||||||
|
*/
|
||||||
|
private String qty_unit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位名称
|
||||||
|
*/
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private BigDecimal qty;
|
||||||
|
/**
|
||||||
|
* 单重
|
||||||
|
*/
|
||||||
|
private BigDecimal unit_weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入库区标识
|
||||||
|
*/
|
||||||
|
private String turnin_sect_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入库区编码
|
||||||
|
*/
|
||||||
|
private String turnin_sect_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入库区名称
|
||||||
|
*/
|
||||||
|
private String turnin_sect_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入仓位标识
|
||||||
|
*/
|
||||||
|
private String turnin_struct_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入仓位编码
|
||||||
|
*/
|
||||||
|
private String turnin_struct_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入仓位名称
|
||||||
|
*/
|
||||||
|
private String turnin_struct_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行状态
|
||||||
|
*/
|
||||||
|
private String bill_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务标识
|
||||||
|
*/
|
||||||
|
private String task_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具标识
|
||||||
|
*/
|
||||||
|
private String storagevehicle_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具编码
|
||||||
|
*/
|
||||||
|
private String storagevehicle_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已下发
|
||||||
|
*/
|
||||||
|
private Boolean is_issued;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单据明细标识
|
||||||
|
*/
|
||||||
|
private String source_billdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单据类型
|
||||||
|
*/
|
||||||
|
private String source_bill_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单编号
|
||||||
|
*/
|
||||||
|
private String source_bill_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单表名
|
||||||
|
*/
|
||||||
|
private String source_bill_table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvHrBcp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单主表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface StIvtMoveinvHrBcpMapper extends BaseMapper<StIvtMoveinvHrBcp> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvdtlHrBcp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单明细表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface StIvtMoveinvdtlHrBcpMapper extends BaseMapper<StIvtMoveinvdtlHrBcp> {
|
||||||
|
|
||||||
|
List<Map> listJoinTask(String moveinv_id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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.semimanagehr.service.moveInv.dao.mapper.StIvtMoveinvHrBcpMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!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.semimanagehr.service.moveInv.dao.mapper.StIvtMoveinvdtlHrBcpMapper">
|
||||||
|
<select id="listJoinTask" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
st_ivt_moveinvdtl_hr_bcp.*,
|
||||||
|
sch_base_task.task_code,
|
||||||
|
sch_base_task.task_status
|
||||||
|
FROM
|
||||||
|
st_ivt_moveinvdtl_hr_bcp
|
||||||
|
LEFT JOIN sch_base_task ON st_ivt_moveinvdtl_hr_bcp.task_id = sch_base_task.task_id
|
||||||
|
where
|
||||||
|
moveinv_id = #{moveinv_id}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.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.semimanagehr.service.moveInv.dao.StIvtMoveinvHrBcp;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @author ZZQ
|
||||||
|
* @Date 2023/5/4 19:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MoveInvHrBcpQuery extends BaseQuery<StIvtMoveinvHrBcp> {
|
||||||
|
|
||||||
|
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,455 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nl.common.enums.AcsTaskEnum;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
|
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.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||||
|
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.util.ChangeIvtUtil;
|
||||||
|
import org.nl.wms.storage_manage.semimanage.service.moveInv.dao.StIvtMoveinvdtlBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvdtlHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvdtlHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.mapper.StIvtMoveinvHrBcpMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtflowHrService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单主表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtMoveinvHrBcpServiceImpl extends ServiceImpl<StIvtMoveinvHrBcpMapper, StIvtMoveinvHrBcp> implements IStIvtMoveinvHrBcpService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtMoveinvdtlHrBcpService iStIvtMoveinvdtlHrBcpService; // 移库明细服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructattrService structattrService; // 仓位服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructivtflowHrService iStIvtStructivtflowService; // 库存变动服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructivtHrBcpService iStIvtStructivtHrBcpService; //库存服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService taskService; // 任务服务
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void create(JSONObject form) {
|
||||||
|
JSONArray rows = form.getJSONArray("tableData");
|
||||||
|
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||||
|
|
||||||
|
// 调用主表 插入/更新方法
|
||||||
|
StIvtMoveinvHrBcp mst = new StIvtMoveinvHrBcp();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
mst.setMoveinv_id(IdUtil.getStringId());
|
||||||
|
mst.setBill_code(CodeUtil.getNewCode("BCP_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.setRemark(form.getString("remark"));
|
||||||
|
|
||||||
|
//调用明细表 插入方法
|
||||||
|
List<StIvtMoveinvdtlHrBcp> itemList = new ArrayList<>();
|
||||||
|
Set<String> lockInStructList = new HashSet<>();
|
||||||
|
Set<String> lockOutStructList = new HashSet<>();
|
||||||
|
BigDecimal total = new BigDecimal(0);
|
||||||
|
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject item = rows.getJSONObject(i);
|
||||||
|
|
||||||
|
if (StringUtils.isEmpty(item.getString("turnin_struct_id"))){
|
||||||
|
throw new BadRequestException("移入货位没有配置齐全");
|
||||||
|
}
|
||||||
|
|
||||||
|
StIvtMoveinvdtlHrBcp moveinvdtlCp = new StIvtMoveinvdtlHrBcp();
|
||||||
|
moveinvdtlCp.setMoveinv_id(mst.getMoveinv_id());
|
||||||
|
moveinvdtlCp.setMoveinvdtl_id(IdUtil.getStringId());
|
||||||
|
moveinvdtlCp.setSeq_no(i+1);
|
||||||
|
moveinvdtlCp.setBill_status(mst.getBill_status());
|
||||||
|
moveinvdtlCp.setSource_bill_type(item.getString("bill_type"));
|
||||||
|
|
||||||
|
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.setUnit_weight(item.getBigDecimal("unit_weight"));
|
||||||
|
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"));
|
||||||
|
}
|
||||||
|
|
||||||
|
total.add(moveinvdtlCp.getQty());
|
||||||
|
itemList.add(moveinvdtlCp);
|
||||||
|
lockInStructList.add(moveinvdtlCp.getTurnin_struct_code());
|
||||||
|
lockOutStructList.add(moveinvdtlCp.getTurnout_struct_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lockInStructList.size()!=lockOutStructList.size()){
|
||||||
|
throw new BadRequestException("不允许选择相同货位进行分配");
|
||||||
|
}
|
||||||
|
|
||||||
|
lockInStructList.addAll(lockOutStructList);
|
||||||
|
|
||||||
|
//校验点位有没有锁定
|
||||||
|
List<StIvtStructattr> list = structattrService.list(new QueryWrapper<StIvtStructattr>()
|
||||||
|
.in("struct_code", lockInStructList)
|
||||||
|
.nested(i -> i.eq("is_used", false)
|
||||||
|
.or()
|
||||||
|
.gt("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))));
|
||||||
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
|
throw new BadRequestException("选择点位已经锁定禁用:"+list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
|
||||||
|
mst.setTotal_qty(total);
|
||||||
|
this.save(mst);
|
||||||
|
iStIvtMoveinvdtlHrBcpService.saveBatch(itemList);
|
||||||
|
lockInStructList.addAll(lockOutStructList);
|
||||||
|
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, lockInStructList)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(JSONObject form) {
|
||||||
|
JSONArray rows = form.getJSONArray("tableData");
|
||||||
|
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||||
|
|
||||||
|
List<StIvtMoveinvdtlHrBcp> dtlList = iStIvtMoveinvdtlHrBcpService.list(new QueryWrapper<StIvtMoveinvdtlHrBcp>().eq("moveinv_id", form.getString("moveinv_id")));
|
||||||
|
//调用明细表 插入方法
|
||||||
|
Set<String> unLockStructList = new HashSet<>();
|
||||||
|
for (StIvtMoveinvdtlHrBcp 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<StIvtMoveinvdtlHrBcp> itemList = new ArrayList<>();
|
||||||
|
Set<String> lockOutStructList = new HashSet<>();
|
||||||
|
Set<String> lockInStructList = new HashSet<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject item = rows.getJSONObject(i);
|
||||||
|
StIvtMoveinvdtlHrBcp moveinvdtlCp = JSONObject.parseObject(JSON.toJSONString(item), StIvtMoveinvdtlHrBcp.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);
|
||||||
|
lockInStructList.add(moveinvdtlCp.getTurnin_struct_code());
|
||||||
|
lockOutStructList.add(moveinvdtlCp.getTurnout_struct_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lockOutStructList.size()!=lockInStructList.size()){
|
||||||
|
throw new BadRequestException("不允许选择相同货位进行分配");
|
||||||
|
}
|
||||||
|
|
||||||
|
lockInStructList.addAll(lockOutStructList);
|
||||||
|
//校验点位有没有锁定
|
||||||
|
List<StIvtStructattr> list = structattrService.list(new QueryWrapper<StIvtStructattr>()
|
||||||
|
.in("struct_code", lockInStructList)
|
||||||
|
.nested(i -> i.eq("is_used", false)
|
||||||
|
.or()
|
||||||
|
.gt("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))));
|
||||||
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
|
throw new BadRequestException("选择点位已经锁定禁用:"+list.stream().map(StIvtStructattr::getStruct_code).collect(Collectors.joining(",")));
|
||||||
|
}
|
||||||
|
|
||||||
|
iStIvtMoveinvdtlHrBcpService.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, lockInStructList)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void cancel(JSONObject form) {
|
||||||
|
List<StIvtMoveinvdtlHrBcp> dtlList = iStIvtMoveinvdtlHrBcpService.list(new QueryWrapper<StIvtMoveinvdtlHrBcp>().eq("moveinv_id", form.getString("moveinv_id")));
|
||||||
|
|
||||||
|
//调用明细表 插入方法
|
||||||
|
Set<String> unLockStructList = new HashSet<>();
|
||||||
|
|
||||||
|
for (StIvtMoveinvdtlHrBcp cp : dtlList) {
|
||||||
|
if (cp.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))||cp.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("移库中"))){
|
||||||
|
throw new BadRequestException("存在已完成明细不允许直接取消单据");
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
);
|
||||||
|
|
||||||
|
iStIvtMoveinvdtlHrBcpService.update(new UpdateWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.set("bill_status",MoveInvEnum.BILL_STATUS.code("取消"))
|
||||||
|
.set("task_id","").eq("moveinv_id", form.getString("moveinv_id")));
|
||||||
|
|
||||||
|
this.update(new UpdateWrapper<StIvtMoveinvHrBcp>()
|
||||||
|
.set("bill_status",MoveInvEnum.BILL_STATUS.code("取消"))
|
||||||
|
.set("update_name",SecurityUtils.getCurrentUsername())
|
||||||
|
.set("update_id",SecurityUtils.getCurrentUserId())
|
||||||
|
.set("update_time",DateUtil.now())
|
||||||
|
.eq("moveinv_id", form.getString("moveinv_id")));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void taskOperate(JSONObject form) {
|
||||||
|
AcsTaskEnum status = AcsTaskEnum.getType(form.getString("status"),"status_");
|
||||||
|
|
||||||
|
List<StIvtMoveinvdtlHrBcp> dtls = iStIvtMoveinvdtlHrBcpService.list(new QueryWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.eq("task_id", form.getString("task_id")));
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(dtls)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
StIvtMoveinvHrBcp mst = this.getById(dtls.get(0).getMoveinv_id());
|
||||||
|
|
||||||
|
switch (status){
|
||||||
|
case STATUS_START:
|
||||||
|
mst.setBill_status(MoveInvEnum.BILL_STATUS.code("移库中"));
|
||||||
|
mst.setUpdate_time(DateUtil.now());
|
||||||
|
mst.setUpdate_name("acs");
|
||||||
|
this.updateById(mst);
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
taskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_id, form.getString("task_id"))
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.EXECUTING.getCode())
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case STATUS_FINISH:
|
||||||
|
|
||||||
|
StIvtStructattr one = structattrService.getOne(new QueryWrapper<StIvtStructattr>()
|
||||||
|
.eq("struct_id", dtls.get(0).getTurnin_struct_id())
|
||||||
|
.eq("storagevehicle_code", dtls.get(0).getStoragevehicle_code()));
|
||||||
|
|
||||||
|
if (one==null){
|
||||||
|
for (StIvtMoveinvdtlHrBcp dtl : dtls) {
|
||||||
|
if (!dtl.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))){
|
||||||
|
//新增库存
|
||||||
|
StIvtStructivtHrBcp ivtDao = StIvtStructivtHrBcp.builder()
|
||||||
|
.struct_id(dtl.getTurnin_struct_id())
|
||||||
|
.struct_code(dtl.getTurnin_struct_code())
|
||||||
|
.struct_name(dtl.getTurnin_struct_name())
|
||||||
|
.material_id(dtl.getMaterial_id())
|
||||||
|
.quality_scode(dtl.getQuality_scode())
|
||||||
|
.pcsn(dtl.getPcsn())
|
||||||
|
.ivt_level(dtl.getIvt_level())
|
||||||
|
.is_active(dtl.getIs_active())
|
||||||
|
.qty_unit_id("2")
|
||||||
|
.instorage_time(DateUtil.now())
|
||||||
|
.stor_id(mst.getStor_id())
|
||||||
|
.canuse_qty(dtl.getQty())
|
||||||
|
.workshop_id(mst.getProduct_area())
|
||||||
|
.unit_weight(dtl.getUnit_weight())
|
||||||
|
.build();
|
||||||
|
新增库存: {
|
||||||
|
iStIvtStructivtHrBcpService.save(ivtDao);
|
||||||
|
// 插入库存变动记录
|
||||||
|
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||||
|
param.put("change_type", ChangeIvtUtil.ADD_SUBIVT_QTY);
|
||||||
|
param.put("change_qty", ivtDao.getCanuse_qty());
|
||||||
|
param.put("result_qty", ivtDao.getCanuse_qty());
|
||||||
|
param.put("bill_code",mst.getBill_code());
|
||||||
|
param.put("inv_id",mst.getMoveinv_id());
|
||||||
|
param.put("bill_type_scode",IOSEnum.IO_TYPE.code("移库"));
|
||||||
|
iStIvtStructivtflowService.insetIvtChange(param);
|
||||||
|
//维护载具
|
||||||
|
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_code, dtl.getTurnin_struct_code())
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.set(StIvtStructattr::getIs_emptyvehicle,false)
|
||||||
|
.set(StIvtStructattr::getInv_code, "")
|
||||||
|
.set(StIvtStructattr::getStoragevehicle_code, dtl.getStoragevehicle_code()));
|
||||||
|
}
|
||||||
|
|
||||||
|
减库存:{
|
||||||
|
iStIvtStructivtHrBcpService.remove(new QueryWrapper<StIvtStructivtHrBcp>().eq("struct_id", dtl.getTurnout_struct_id()));
|
||||||
|
ivtDao.setStruct_id(dtl.getTurnout_struct_id());
|
||||||
|
ivtDao.setStruct_code(dtl.getTurnout_struct_code());
|
||||||
|
ivtDao.setStruct_name(dtl.getTurnout_struct_name());
|
||||||
|
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||||
|
param.put("change_type", ChangeIvtUtil.SUB_SUBIVT_QTY);
|
||||||
|
param.put("change_qty", dtl.getQty());
|
||||||
|
param.put("result_qty", 0);
|
||||||
|
param.put("bill_code",mst.getBill_code());
|
||||||
|
param.put("inv_id",mst.getMoveinv_id());
|
||||||
|
param.put("bill_type_scode",IOSEnum.IO_TYPE.code("移库"));
|
||||||
|
iStIvtStructivtflowService.insetIvtChange(param);
|
||||||
|
//维护载具
|
||||||
|
structattrService.update(new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_code, dtl.getTurnout_struct_code())
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.set(StIvtStructattr::getInv_code,"")
|
||||||
|
.set(StIvtStructattr::getIs_emptyvehicle,false)
|
||||||
|
.set(StIvtStructattr::getStoragevehicle_code, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解锁仓位
|
||||||
|
structattrService.update(
|
||||||
|
new StIvtStructattr()
|
||||||
|
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.setInv_id("")
|
||||||
|
.setInv_type("")
|
||||||
|
.setStoragevehicle_code("")
|
||||||
|
.setInv_code(""),
|
||||||
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_id, dtls.get(0).getTurnout_struct_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
structattrService.update(
|
||||||
|
new StIvtStructattr()
|
||||||
|
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.setInv_id(mst.getMoveinv_id())
|
||||||
|
.setInv_type(IOSEnum.IO_TYPE.code("移库"))
|
||||||
|
.setStoragevehicle_code(dtls.get(0).getStoragevehicle_code())
|
||||||
|
.setInv_code(mst.getBill_code()),
|
||||||
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_id, dtls.get(0).getTurnin_struct_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
//更新明细
|
||||||
|
iStIvtMoveinvdtlHrBcpService.update(new UpdateWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.set("bill_status", MoveInvEnum.BILL_STATUS.code("完成"))
|
||||||
|
.in("moveinvdtl_id",dtls.stream().map(StIvtMoveinvdtlHrBcp::getMoveinvdtl_id).collect(Collectors.toList())));
|
||||||
|
|
||||||
|
//更新主单据
|
||||||
|
List<StIvtMoveinvdtlHrBcp> list = iStIvtMoveinvdtlHrBcpService.list(new QueryWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.eq("moveinv_id", mst.getMoveinv_id())
|
||||||
|
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("完成"))
|
||||||
|
.ne("bill_status", MoveInvEnum.BILL_STATUS.code("取消")));
|
||||||
|
|
||||||
|
if (list.size() == 0) {
|
||||||
|
this.update(new UpdateWrapper<StIvtMoveinvHrBcp>()
|
||||||
|
.set("bill_status",MoveInvEnum.BILL_STATUS.code("完成"))
|
||||||
|
.set("update_time", DateUtil.now())
|
||||||
|
.set("update_name", SecurityUtils.getCurrentUsername())
|
||||||
|
.set("update_id",SecurityUtils.getCurrentUserId())
|
||||||
|
.eq("moveinv_id",mst.getMoveinv_id()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
taskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_id, form.getString("task_id"))
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case STATUS_CANNEL:
|
||||||
|
//更新明细
|
||||||
|
iStIvtMoveinvdtlHrBcpService.update(new UpdateWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.set("bill_status", MoveInvEnum.BILL_STATUS.code("生成"))
|
||||||
|
.set("task_id","")
|
||||||
|
.in("moveinvdtl_id",dtls.stream().map(StIvtMoveinvdtlHrBcp::getMoveinvdtl_id).collect(Collectors.toList())));
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
taskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_id, form.getString("task_id"))
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode())
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.moveInv.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
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 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.semimanagehr.service.moveInv.IStIvtMoveinvHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.IStIvtMoveinvdtlHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.StIvtMoveinvdtlHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.moveInv.dao.mapper.StIvtMoveinvdtlHrBcpMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 移库单明细表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtMoveinvdtlHrBcpServiceImpl extends ServiceImpl<StIvtMoveinvdtlHrBcpMapper, StIvtMoveinvdtlHrBcp> implements IStIvtMoveinvdtlHrBcpService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService taskService; // 任务服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtMoveinvHrBcpService iStIvtMoveinvHrBcpService; // 主表服务
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> listJoinTask(String moveinv_id) {
|
||||||
|
if (StringUtils.isEmpty(moveinv_id)){
|
||||||
|
throw new BadRequestException("移库单主单据id不能为空");
|
||||||
|
}
|
||||||
|
return this.baseMapper.listJoinTask(moveinv_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void taskOption(JSONObject form, String option) {
|
||||||
|
List<StIvtMoveinvdtlHrBcp> list = this.list(new QueryWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.eq("moveinv_id", form.getString("moveinv_id"))
|
||||||
|
.eq("turnout_struct_code", form.getString("turnout_struct_code")));
|
||||||
|
|
||||||
|
List<StIvtMoveinvdtlHrBcp> collect = list.stream().filter(a -> a.getBill_status().equals(MoveInvEnum.BILL_STATUS.code("完成"))).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(collect)){
|
||||||
|
throw new BadRequestException("当前明细存在正在执行的单据");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
|
||||||
|
switch (option){
|
||||||
|
|
||||||
|
case "immediateNotifyAcs":
|
||||||
|
// 下发任务
|
||||||
|
StIvtMoveinvdtlHrBcp moveinvdtlCp = list.get(0);
|
||||||
|
PointEvent event = PointEvent.builder()
|
||||||
|
.type(AcsTaskEnum.TASK_STRUCT_BCP_HR_MOVE)
|
||||||
|
.acs_task_type(AcsTaskEnum.ACS_TASK_TYPE_NON_WEIGHING_TASK_OF_PS20.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("A3")
|
||||||
|
.callback((Consumer<String>) moveinvdtlCp::setTask_id)
|
||||||
|
.build();
|
||||||
|
BussEventMulticaster.Publish(event);
|
||||||
|
|
||||||
|
// 更新明细
|
||||||
|
this.update(new UpdateWrapper<StIvtMoveinvdtlHrBcp>()
|
||||||
|
.set("task_id",moveinvdtlCp.getTask_id())
|
||||||
|
.set("bill_status", MoveInvEnum.BILL_STATUS.code("移库中"))
|
||||||
|
.eq("moveinv_id", form.getString("moveinv_id")));
|
||||||
|
break;
|
||||||
|
case "forceFinish":
|
||||||
|
param.put("task_id", form.getString("task_id"));
|
||||||
|
param.put("status", "2");
|
||||||
|
iStIvtMoveinvHrBcpService.taskOperate(param);
|
||||||
|
break;
|
||||||
|
case "cancel":
|
||||||
|
param.put("task_id", form.getString("task_id"));
|
||||||
|
param.put("status", "3");
|
||||||
|
iStIvtMoveinvHrBcpService.taskOperate(param);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.semimanagehr.service.structIvt;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
||||||
@@ -29,4 +30,6 @@ public interface IStIvtStructivtHrBcpService extends IService<StIvtStructivtHrBc
|
|||||||
Object getBcpIvt(StructIvtHrBcpQuery query, PageQuery page);
|
Object getBcpIvt(StructIvtHrBcpQuery query, PageQuery page);
|
||||||
|
|
||||||
List<Map> getBcpIvtInfo(JSONObject jo);
|
List<Map> getBcpIvtInfo(JSONObject jo);
|
||||||
|
|
||||||
|
Object getBcpMoveIvt(StructIvtYLQuery query, PageQuery page);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dto.StructIvtHrBcpQuery;
|
||||||
@@ -36,4 +37,6 @@ public interface StIvtStructivtHrBcpMapper extends BaseMapper<StIvtStructivtHrBc
|
|||||||
List<Map> getPdaBcpMaterialIvt(JSONObject jo);
|
List<Map> getPdaBcpMaterialIvt(JSONObject jo);
|
||||||
|
|
||||||
StIvtStructivtBcp queryIvtOutOne(JSONObject json);
|
StIvtStructivtBcp queryIvtOutOne(JSONObject json);
|
||||||
|
|
||||||
|
List<Map> getBcpMoveIvt(@Param("query") StructIvtYLQuery query);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,4 +242,44 @@
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getBcpMoveIvt" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
ivt.*,
|
||||||
|
mu.unit_name AS qty_unit_name,
|
||||||
|
mb.material_code,
|
||||||
|
mb.material_name,
|
||||||
|
sa.sect_id,
|
||||||
|
sa.sect_code,
|
||||||
|
sa.sect_name,
|
||||||
|
sa.struct_id,
|
||||||
|
sa.struct_code,
|
||||||
|
sa.struct_name,
|
||||||
|
sa.storagevehicle_code,
|
||||||
|
class.class_name
|
||||||
|
FROM
|
||||||
|
st_ivt_structivt_hr_bcp ivt
|
||||||
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||||
|
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||||
|
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||||
|
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||||
|
<where>
|
||||||
|
ivt.canuse_qty > 0
|
||||||
|
AND
|
||||||
|
sa.lock_type = '0'
|
||||||
|
<if test="query.material_search != null and query.material_search != ''">
|
||||||
|
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||||
|
</if>
|
||||||
|
<if test="query.sect_id != null and query.sect_id != ''">
|
||||||
|
and sa.sect_id = #{query.sect_id}
|
||||||
|
</if>
|
||||||
|
<if test="query.struct_id != null and query.struct_id != ''">
|
||||||
|
and sa.struct_id = #{query.struct_id}
|
||||||
|
</if>
|
||||||
|
and sa.struct_code IN
|
||||||
|
<foreach collection="query.struct_search" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package org.nl.wms.storage_manage.semimanagehr.service.structIvt.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
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.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
import org.nl.wms.storage_manage.semimanage.service.structIvt.dao.StIvtStructivtBcp;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.IStIvtStructivtHrBcpService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
import org.nl.wms.storage_manage.semimanagehr.service.structIvt.dao.StIvtStructivtHrBcp;
|
||||||
@@ -59,4 +61,13 @@ public class StIvtStructivtHrBcpServiceImpl extends ServiceImpl<StIvtStructivtHr
|
|||||||
public List<Map> getBcpIvtInfo(JSONObject jo) {
|
public List<Map> getBcpIvtInfo(JSONObject jo) {
|
||||||
return this.baseMapper.getBcpIvtInfo(jo);
|
return this.baseMapper.getBcpIvtInfo(jo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getBcpMoveIvt(StructIvtYLQuery query, PageQuery pageQuery) {
|
||||||
|
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||||
|
List<Map> mst_detail = this.baseMapper.getBcpMoveIvt(query);
|
||||||
|
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||||
|
build.setTotalElements(page.getTotal());
|
||||||
|
return build;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,362 @@
|
|||||||
|
<!--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">单 据 号:</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">仓 库:</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.view > 0"
|
||||||
|
>
|
||||||
|
<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">备 注:</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="unit_weight" label="单重(g)" align="center" :formatter="crud.formatNum2" />
|
||||||
|
<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" width="190" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-show="isedit" v-model="scope.row.turnin_struct_code" clearable style="width: 170px" disabled @clear="structClear(scope.row)">
|
||||||
|
<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.row, 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/semiproducthr/semiproductHrMoveIvt/StructIvt'
|
||||||
|
import AddStruct from '@/views/wms/storage_manage/semiproducthr/semiproductHrMoveIvt/AddStruct'
|
||||||
|
import moveInv from '@/views/wms/storage_manage/semiproducthr/semiproductHrMoveIvt/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', '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': '5' }).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
|
||||||
|
},
|
||||||
|
structClear(row){
|
||||||
|
this.form.tableData.forEach((a,index)=>{
|
||||||
|
if (a.struct_code === row.struct_code){
|
||||||
|
this.$set(a,'turnin_struct_code',"")
|
||||||
|
this.$set(a,'turnin_struct_name',"")
|
||||||
|
this.$set(a,'turnin_struct_id',"")
|
||||||
|
this.form.tableData.splice(index, 1, a)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
structChanged(rows){
|
||||||
|
this.form.tableData.forEach((a,index)=>{
|
||||||
|
if (a.struct_code === this.nowrow.struct_code){
|
||||||
|
this.$set(a,'turnin_struct_code',rows[0].struct_code)
|
||||||
|
this.$set(a,'turnin_struct_name',rows[0].struct_name)
|
||||||
|
this.$set(a,'turnin_struct_id',rows[0].struct_id)
|
||||||
|
this.form.tableData.splice(index, 1, a)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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(row, rows) {
|
||||||
|
var indexSet = []
|
||||||
|
let filter = rows.filter(a=>{
|
||||||
|
return a.turnout_struct_code !== row.turnout_struct_code
|
||||||
|
});
|
||||||
|
this.form.tableData = filter
|
||||||
|
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>
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
<!--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="stor_name" label="仓库" width="180px" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" width="180px" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" width="180px" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" width="180px" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="is_used" :formatter="formatBoolean" label="是否启用" width="180px" />
|
||||||
|
</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: '1686284674680360960',
|
||||||
|
stor_id: '15286279952695336963',
|
||||||
|
is_used: true,
|
||||||
|
lock_type: '0',
|
||||||
|
emptyvehicle: true,
|
||||||
|
is_emptyvehicle: false
|
||||||
|
},
|
||||||
|
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>
|
||||||
|
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
<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 :formatter="stateFormat" prop="bill_status" label="明细状态" width="120" 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 :formatter="formatStatus" prop="task_status" label="任务状态" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud } from '@crud/crud'
|
||||||
|
import moveInv from '@/views/wms/storage_manage/semiproducthr/semiproductHrMoveIvt/moveInv'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MoveTaskDialog',
|
||||||
|
components: {},
|
||||||
|
mixins: [crud()],
|
||||||
|
dicts: ['task_status', 'MOVE_BILL_STATUS'],
|
||||||
|
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
|
||||||
|
},
|
||||||
|
refreshMethod() {
|
||||||
|
moveInv.getMoveDtl({ 'moveinv_id': this.form.dtl_row.moveinv_id }).then(res => {
|
||||||
|
this.openParam = res.content
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delTask() {
|
||||||
|
moveInv.moveTAskOption(this.form.dtl_row, 'cancel').then(res => {
|
||||||
|
this.refreshMethod()
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sendTask() {
|
||||||
|
moveInv.moveTAskOption(this.form.dtl_row, 'immediateNotifyAcs').then(res => {
|
||||||
|
this.refreshMethod()
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
confirmTask() {
|
||||||
|
moveInv.moveTAskOption(this.form.dtl_row, 'forceFinish').then(res => {
|
||||||
|
this.refreshMethod()
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
tableRowClassName({ row, rowIndex }) {
|
||||||
|
row.index = rowIndex
|
||||||
|
},
|
||||||
|
stateFormat(row) {
|
||||||
|
return this.dict.label.MOVE_BILL_STATUS[row.bill_status]
|
||||||
|
},
|
||||||
|
formatStatus(row) {
|
||||||
|
return this.dict.label.task_status[row.task_status]
|
||||||
|
},
|
||||||
|
initFlag() {
|
||||||
|
this.dis_del = true
|
||||||
|
this.dis_send = true
|
||||||
|
this.dis_confirm = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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>
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="库存选择"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1200px"
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<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="日期">
|
||||||
|
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库区/货位">
|
||||||
|
<el-input
|
||||||
|
v-model="query.struct_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="库区/货位"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material_search"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="物料"
|
||||||
|
style="width: 230px;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<rrOperation/>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation/>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
@selection-change="crud.selectionChangeHandler"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="70" prop="sect_code" label="库区"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
|
||||||
|
<!-- <el-table-column show-overflow-tooltip width="100" prop="bill_type" label="入库类型" :formatter="formatBillType"/>-->
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" width="150" label="物料编号"/>
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="150" prop="class_name" label="物料类别"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="100" prop="canuse_qty" label="数量"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="100" prop="unit_weight" label="单重(g)"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="100" prop="storagevehicle_code" label="载具号"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||||
|
import qs from 'qs'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||||
|
import moveInv from '@/views/wms/storage_manage/semiproducthr/semiproductHrMoveIvt/moveInv'
|
||||||
|
import {getProductIvt} from "./moveInv";
|
||||||
|
import {setUserInfo} from "../../../../../store/modules/user";
|
||||||
|
|
||||||
|
|
||||||
|
const start = new Date()
|
||||||
|
export default {
|
||||||
|
name: 'AddDtl',
|
||||||
|
components: {crudOperation, rrOperation, pagination, DateRangePicker},
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '半成品可用库存',
|
||||||
|
url: '/api/bcp/hr/getBcpIvt',
|
||||||
|
crudMethod: {},
|
||||||
|
optShow: {
|
||||||
|
reset: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
dicts: ['ST_INV_BCP_HR_IN_TYPE'],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
rows: [],
|
||||||
|
tableData: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
if (rowIndex % 2 === 0) {
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.query.struct_search = []
|
||||||
|
this.query.size = 10
|
||||||
|
},
|
||||||
|
formatBillType(row, column) {
|
||||||
|
return this.dict.label.ST_INV_BCP_HR_IN_TYPE[row.bill_type]
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
//struct_code
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
var structs = ''
|
||||||
|
this.$refs.multipleTable.selection.forEach(a =>{
|
||||||
|
structs=a.struct_code+","+structs
|
||||||
|
})
|
||||||
|
moveInv.getProductIvt({'struct_search':structs,'size':999,'page':0}).then(res => {
|
||||||
|
this.rows = res.content
|
||||||
|
var i =1;
|
||||||
|
this.rows.forEach(a => {
|
||||||
|
a.seq_no=i
|
||||||
|
a.turnout_sect_name = a.sect_name
|
||||||
|
a.turnout_struct_code = a.struct_code
|
||||||
|
a.qty = a.canuse_qty
|
||||||
|
i++
|
||||||
|
})
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
<!--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="cancel"
|
||||||
|
>
|
||||||
|
取消单据
|
||||||
|
</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)"
|
||||||
|
:is-visiable-del="false"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :selectable="checkboxT" type="selection" width="55"/>
|
||||||
|
<el-table-column prop="bill_code" min-width="160" 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="160"/>
|
||||||
|
<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/semiproducthr/semiproductHrMoveIvt/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/semiproducthr/semiproductHrMoveIvt/AddDialog'
|
||||||
|
import MoveTaskDialog from '@/views/wms/storage_manage/semiproducthr/semiproductHrMoveIvt/MoveTaskDialog'
|
||||||
|
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
|
||||||
|
import {download} from '@/api/data'
|
||||||
|
import {downloadFile} from '@/utils'
|
||||||
|
import {cancel} from "./moveInv";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'moveInv',
|
||||||
|
components: {AddDialog, MoveTaskDialog, crudOperation, rrOperation, udOperation, pagination},
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '用户',
|
||||||
|
props: {
|
||||||
|
// 每页数据条数f
|
||||||
|
size: 20
|
||||||
|
},
|
||||||
|
idField: 'moveinv_id', url: 'api/stIvtMoveinvHrBcp', 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': '5'}).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.bill_status === '10' ) {
|
||||||
|
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
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
check.cancel(this.currentRow).then(res => {
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
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>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/stIvtMoveinvHrBcp',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/stIvtMoveinvHrBcp/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/stIvtMoveinvHrBcp/update',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getMoveDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtMoveinvHrBcp/getMoveDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getStructIvt(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtCheckmstBcp/getStructIvt',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProductIvt(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/hr/getBcpMoveIvt',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function moveTAskOption(params, option) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtMoveinvdtlHrBcp/task/' + option,
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function cancel(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtMoveinvHrBcp/cancel',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
del,
|
||||||
|
getMoveDtl,
|
||||||
|
cancel,
|
||||||
|
getStructIvt,
|
||||||
|
moveTAskOption,
|
||||||
|
getProductIvt
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user