add:入库
This commit is contained in:
@@ -67,6 +67,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List query(MenuQuery query, PageQuery page) {
|
public List query(MenuQuery query, PageQuery page) {
|
||||||
|
page.setSort("menu_sort DESC");
|
||||||
if (StringUtils.isNotEmpty(query.getBlurry())){
|
if (StringUtils.isNotEmpty(query.getBlurry())){
|
||||||
query.setPid(null);
|
query.setPid(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,4 +61,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
|||||||
* @param points
|
* @param points
|
||||||
*/
|
*/
|
||||||
void changeLock(JSONObject points);
|
void changeLock(JSONObject points);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务锁
|
||||||
|
* @param list 点位集合
|
||||||
|
* @param lock_ype 锁定类型
|
||||||
|
*/
|
||||||
|
void lockPoint(List<SchBasePoint> list, String lock_ype);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
|
|||||||
import org.nl.wms.util.PointUtils;
|
import org.nl.wms.util.PointUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -204,4 +205,14 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
this.updateBatchById(pointList);
|
this.updateBatchById(pointList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void lockPoint(List<SchBasePoint> list, String lock_ype) {
|
||||||
|
list.forEach(row -> {
|
||||||
|
row.setPoint_status(lock_ype);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.updateBatchById(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,10 +32,105 @@ public class StIvtIostorinvController {
|
|||||||
return new ResponseEntity<>(iStIvtIostorinvService.pageQuery(query,page), HttpStatus.OK);
|
return new ResponseEntity<>(iStIvtIostorinvService.pageQuery(query,page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增入库单")
|
||||||
|
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.create(whereJson);
|
||||||
|
return new ResponseEntity<>( HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改入库单")
|
||||||
|
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.update(whereJson);
|
||||||
|
return new ResponseEntity<>( HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除入库单")
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
|
||||||
|
iStIvtIostorinvService.delete(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/queryBoxMater")
|
@PostMapping("/queryBoxMater")
|
||||||
@Log("查询入库单")
|
@Log("查询入库单")
|
||||||
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONObject whereJson){
|
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONObject whereJson){
|
||||||
return new ResponseEntity<>(iStIvtIostorinvService.queryBoxMater(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(iStIvtIostorinvService.queryBoxMater(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getInDtl")
|
||||||
|
@Log("查询新增入库单明细")
|
||||||
|
public ResponseEntity<Object> getInDtl(@RequestBody JSONObject whereJson){
|
||||||
|
return new ResponseEntity<>(iStIvtIostorinvService.getInDtl(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getIosDtl")
|
||||||
|
@Log("查询明细")
|
||||||
|
public ResponseEntity<Object> getIosDtl(@RequestBody JSONObject whereJson){
|
||||||
|
return new ResponseEntity<>(iStIvtIostorinvService.getIosDtl(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getIosDis")
|
||||||
|
@Log("查询分配明细")
|
||||||
|
public ResponseEntity<Object> getIosDis(@RequestBody JSONObject whereJson){
|
||||||
|
return new ResponseEntity<>(iStIvtIostorinvService.getIosDis(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/autoDivPoint")
|
||||||
|
@Log("自动分配点位")
|
||||||
|
public ResponseEntity<Object> autoDivPoint(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.autoDivPoint(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/unDivPoint")
|
||||||
|
@Log("取消分配")
|
||||||
|
public ResponseEntity<Object> unDivPoint(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.unDivPoint(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/setPoint")
|
||||||
|
@Log("设置起点")
|
||||||
|
public ResponseEntity<Object> setPoint(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.setPoint(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getIosDisTask")
|
||||||
|
@Log("获取明细任务")
|
||||||
|
public ResponseEntity<Object> getIosDisTask(@RequestBody JSONObject whereJson){
|
||||||
|
return new ResponseEntity<>(iStIvtIostorinvService.getIosDisTask(whereJson),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delTask")
|
||||||
|
@Log("删除任务")
|
||||||
|
public ResponseEntity<Object> delTask(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.delTask(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/issueTask")
|
||||||
|
@Log("下发任务")
|
||||||
|
public ResponseEntity<Object> issueTask(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.issueTask(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/confirmTask")
|
||||||
|
@Log("完成任务")
|
||||||
|
public ResponseEntity<Object> confirmTask(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.confirmTask(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/confirm")
|
||||||
|
@Log("强制确认单据")
|
||||||
|
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson){
|
||||||
|
iStIvtIostorinvService.confirm(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,23 +15,29 @@ import java.util.Map;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum IOSEnum {
|
public enum IOSEnum {
|
||||||
|
//是否
|
||||||
|
IS_NOTANDYES(MapOf.of("否", "0", "是", "1")),
|
||||||
|
|
||||||
//出入库类型
|
//出入库类型
|
||||||
IO_TYPE(MapOf.of("入库", "0", "出库", "1","移库", "2")),
|
IO_TYPE(MapOf.of("入库", "0", "出库", "1","移库", "2")),
|
||||||
|
|
||||||
//出入单据状态
|
//出入单据主表/明细状态
|
||||||
BILL_STATUS(MapOf.of("生成", "10", "提交", "20","分配中", "30","分配完","40","完成","99")),
|
BILL_STATUS(MapOf.of("生成", "10", "提交", "20","分配中", "30","分配完","40","完成","99")),
|
||||||
|
|
||||||
|
//出入单据分配状态
|
||||||
|
WORK_STATUS(MapOf.of("未生成", "10", "生成", "20","执行中", "30","完成","99")),
|
||||||
|
|
||||||
//出入单创建方式
|
//出入单创建方式
|
||||||
CREATE_MODE(MapOf.of("PC产生", "10", "终端产生", "20","外部接口产生", "30")),
|
CREATE_MODE(MapOf.of("PC产生", "10", "终端产生", "20","外部接口产生", "30")),
|
||||||
|
|
||||||
//出入任务执行状态
|
|
||||||
WORK_STATUS(MapOf.of("未生成", "10", "生成", "20","执行中", "30","完成","99")),
|
|
||||||
|
|
||||||
//入库单据类型
|
//入库单据类型
|
||||||
IN_TYPE(MapOf.of("手工入库", "99")),
|
IN_TYPE(MapOf.of("手工入库", "99")),
|
||||||
|
|
||||||
//出库单据类型
|
//出库单据类型
|
||||||
OUT_TYPE(MapOf.of("手工出库", "99")),
|
OUT_TYPE(MapOf.of("手工出库", "99")),
|
||||||
|
|
||||||
|
//点位锁定类型
|
||||||
|
LOCK_TYPE(MapOf.of("未锁定", "00","入库锁", "10","出库锁", "20")),
|
||||||
;
|
;
|
||||||
|
|
||||||
private Map<String, String> code;
|
private Map<String, String> code;
|
||||||
|
|||||||
@@ -30,4 +30,131 @@ public interface IStIvtIostorinvService extends IService<StIvtIostorinv> {
|
|||||||
* @return 、
|
* @return 、
|
||||||
*/
|
*/
|
||||||
JSONArray queryBoxMater(JSONObject whereJson);
|
JSONArray queryBoxMater(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增入库单
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* bill_status, bill_type, biz_date, create_mode, detail_count, remark, stor_id, total_qty
|
||||||
|
* tableData: [明细]
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void create(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改入库单
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* mst: {}
|
||||||
|
* tableData: [明细]
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void update(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除入库单
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void delete(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询新增入库单明细
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* iostorinv_id
|
||||||
|
* }
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getInDtl(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询查询明
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* iostorinv_id
|
||||||
|
* }
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getIosDtl(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分配明细
|
||||||
|
* @param whereJson
|
||||||
|
* {
|
||||||
|
* iostorinvdtl_id
|
||||||
|
* }
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getIosDis(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动分配点位
|
||||||
|
* @param whereJson {
|
||||||
|
* dtl_row: {明细}
|
||||||
|
* sect_id:
|
||||||
|
* stor_id:
|
||||||
|
* storage_qty:
|
||||||
|
* point_code
|
||||||
|
* checked
|
||||||
|
* tableMater:[分配明细]
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void autoDivPoint(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消分配
|
||||||
|
* @param whereJson 明细
|
||||||
|
*/
|
||||||
|
void unDivPoint(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置起点
|
||||||
|
* @param whereJson{
|
||||||
|
* 明细
|
||||||
|
* point_code
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void setPoint(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细任务
|
||||||
|
* @param whereJson {
|
||||||
|
* 明细,
|
||||||
|
* checked:是否显示未完成任务
|
||||||
|
* }
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getIosDisTask(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务
|
||||||
|
* @param whereJson {
|
||||||
|
* 分配明细
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void delTask(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发任务
|
||||||
|
* @param whereJson {
|
||||||
|
* 分配明细
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void issueTask(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成任务
|
||||||
|
* @param whereJson {
|
||||||
|
* 分配明细
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void confirmTask(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 强制确认单据
|
||||||
|
* @param whereJson {
|
||||||
|
* iostorinv_id
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void confirm(JSONObject whereJson);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单分配表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入分配明细
|
||||||
|
* @param collect {出入库明细}
|
||||||
|
*/
|
||||||
|
void insetDis(List<JSONObject> collect);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分配明细
|
||||||
|
* @param whereJson {iostorinvdtl_id iostorinv_id}
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getIosDis(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细任务
|
||||||
|
* @param whereJson {
|
||||||
|
* iostorinvdtl_id:
|
||||||
|
* checked: 是否显示全部任务
|
||||||
|
* }
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
JSONArray getIosDisTask(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单明细表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
public interface IStIvtIostorinvdtlService extends IService<StIvtIostorinvdtl> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入明细
|
||||||
|
* @param iostorinv_id 、
|
||||||
|
* @param tableDataList 、
|
||||||
|
* @return 、
|
||||||
|
*/
|
||||||
|
ArrayList<StIvtIostorinvdtl> insertDtl(String iostorinv_id, List<JSONObject> tableDataList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单据明细
|
||||||
|
* @param {iostorinv_id} 、
|
||||||
|
* @return JSONArray 、
|
||||||
|
*/
|
||||||
|
JSONArray getIosDtl(JSONObject param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单分配表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_iostorinvdis")
|
||||||
|
@Builder
|
||||||
|
public class StIvtIostorinvdis implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入单分配标识
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String iostorinvdis_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入单标识
|
||||||
|
*/
|
||||||
|
private String iostorinv_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入单明细标识
|
||||||
|
*/
|
||||||
|
private String iostorinvdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细序号
|
||||||
|
*/
|
||||||
|
private BigDecimal seq_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库区标识
|
||||||
|
*/
|
||||||
|
private String sect_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库区编码
|
||||||
|
*/
|
||||||
|
private String sect_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库区名称
|
||||||
|
*/
|
||||||
|
private String sect_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位标识
|
||||||
|
*/
|
||||||
|
private String struct_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位编码
|
||||||
|
*/
|
||||||
|
private String struct_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位名称
|
||||||
|
*/
|
||||||
|
private String struct_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品质类型
|
||||||
|
*/
|
||||||
|
private String quality_scode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行状态
|
||||||
|
*/
|
||||||
|
private String work_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务标识
|
||||||
|
*/
|
||||||
|
private String task_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具标识
|
||||||
|
*/
|
||||||
|
private String storagevehicle_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具编码
|
||||||
|
*/
|
||||||
|
private String storagevehicle_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已下发
|
||||||
|
*/
|
||||||
|
private Boolean is_issued;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位标识
|
||||||
|
*/
|
||||||
|
private String qty_unit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位名称
|
||||||
|
*/
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划数量
|
||||||
|
*/
|
||||||
|
private BigDecimal plan_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际数量
|
||||||
|
*/
|
||||||
|
private BigDecimal real_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入点位标识
|
||||||
|
*/
|
||||||
|
private String point_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱号
|
||||||
|
*/
|
||||||
|
private String box_no;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单明细表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_iostorinvdtl")
|
||||||
|
public class StIvtIostorinvdtl implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入单明细标识
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String iostorinvdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出入单标识
|
||||||
|
*/
|
||||||
|
private String iostorinv_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细序号
|
||||||
|
*/
|
||||||
|
private BigDecimal seq_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品质类型
|
||||||
|
*/
|
||||||
|
private String quality_scode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据明细状态
|
||||||
|
*/
|
||||||
|
private String bill_status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位标识
|
||||||
|
*/
|
||||||
|
private String qty_unit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位名称
|
||||||
|
*/
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划数量
|
||||||
|
*/
|
||||||
|
private BigDecimal plan_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际数量
|
||||||
|
*/
|
||||||
|
private BigDecimal real_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单据明细标识
|
||||||
|
*/
|
||||||
|
private String source_billdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单据类型
|
||||||
|
*/
|
||||||
|
private String source_bill_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单编号
|
||||||
|
*/
|
||||||
|
private String source_bill_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源单表名
|
||||||
|
*/
|
||||||
|
private String source_bill_table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础单据明细标识
|
||||||
|
*/
|
||||||
|
private String base_billdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础单据类型
|
||||||
|
*/
|
||||||
|
private String base_bill_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础单编号
|
||||||
|
*/
|
||||||
|
private String base_bill_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础单表名
|
||||||
|
*/
|
||||||
|
private String base_bill_table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已分配数量
|
||||||
|
*/
|
||||||
|
private BigDecimal assign_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未分配数量
|
||||||
|
*/
|
||||||
|
private BigDecimal unassign_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱号
|
||||||
|
*/
|
||||||
|
private String box_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源交货单
|
||||||
|
*/
|
||||||
|
private String vbeln;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源交货单行
|
||||||
|
*/
|
||||||
|
private String posnr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货幅宽
|
||||||
|
*/
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单分配表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分配明细
|
||||||
|
* @param whereJson {iostorinvdtl_id, iostorinv_id}
|
||||||
|
* @return List<JSONObject>
|
||||||
|
*/
|
||||||
|
List<JSONObject> getIosDis(JSONObject whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细任务
|
||||||
|
* @param whereJson {
|
||||||
|
* iostorinvdtl_id:
|
||||||
|
* iostorinv_id:
|
||||||
|
* checked: 是否显示全部任务
|
||||||
|
* }
|
||||||
|
* @return List<JSONObject>
|
||||||
|
*/
|
||||||
|
List<JSONObject> getIosDisTask(JSONObject whereJson);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单明细表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
public interface StIvtIostorinvdtlMapper extends BaseMapper<StIvtIostorinvdtl> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细
|
||||||
|
* @param param {iostorinv_id}
|
||||||
|
* @return List<JSONObject>
|
||||||
|
*/
|
||||||
|
List<JSONObject> getIosDtl(JSONObject param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?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.ios.service.iostorInv.dao.mapper.StIvtIostorinvdisMapper">
|
||||||
|
|
||||||
|
<select id="getIosDis" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
dis.*,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
sub.sap_pcsn
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN md_base_material mater ON mater.material_id = dis.material_id
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
|
||||||
|
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||||
|
AND dis.iostorinv_id = #{iostorinv_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="iostorinvdtl_id != null and iostorinvdtl_id != ''">
|
||||||
|
AND dis.iostorinvdtl_id = #{iostorinvdtl_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
order by dis.seq_no ASC
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getIosDisTask" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
dis.*,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
sub.sap_pcsn,
|
||||||
|
task.task_status,
|
||||||
|
task.task_code,
|
||||||
|
point.point_name
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN md_base_material mater ON mater.material_id = dis.material_id
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
|
||||||
|
LEFT JOIN sch_base_task task ON dis.task_id = task.task_id
|
||||||
|
LEFT JOIN sch_base_point point ON point.point_code = dis.point_id
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
|
||||||
|
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||||
|
AND dis.iostorinv_id = #{iostorinv_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="iostorinvdtl_id != null and iostorinvdtl_id != ''">
|
||||||
|
AND dis.iostorinvdtl_id = #{iostorinvdtl_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="checked == true ">
|
||||||
|
AND task.task_status != '07'
|
||||||
|
</if>
|
||||||
|
|
||||||
|
order by dis.seq_no ASC
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?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.ios.service.iostorInv.dao.mapper.StIvtIostorinvdtlMapper">
|
||||||
|
|
||||||
|
<select id="getIosDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
dtl.*,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
sub.sap_pcsn
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdtl dtl
|
||||||
|
LEFT JOIN md_base_material mater ON mater.material_id = dtl.material_id
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dtl.pcsn
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
|
||||||
|
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||||
|
AND dtl.iostorinv_id = #{iostorinv_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
order by dtl.seq_no ASC
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1,24 +1,43 @@
|
|||||||
package org.nl.wms.storage_manage.ios.service.iostorInv.impl;
|
package org.nl.wms.storage_manage.ios.service.iostorInv.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import oracle.sql.ROWID;
|
|
||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.CodeUtil;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.config.IdUtil;
|
||||||
import org.nl.wms.pdm.subpackage.service.IPdmBiSubpackagerelationService;
|
import org.nl.wms.pdm.subpackage.service.IPdmBiSubpackagerelationService;
|
||||||
import org.nl.wms.pdm.subpackage.service.dao.PdmBiSubpackagerelation;
|
import org.nl.wms.pdm.subpackage.service.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||||
|
import org.nl.wms.storage_manage.ios.enums.IOSEnum;
|
||||||
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdtlService;
|
||||||
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
||||||
import org.nl.wms.storage_manage.ios.service.iostorInv.dto.IostorInvQuery;
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dto.IostorInvQuery;
|
||||||
|
import org.nl.wms.storage_manage.ios.util.IosInRuleService;
|
||||||
|
import org.nl.wms.storage_manage.ios.util.dto.RuleDto;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -37,10 +56,25 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPdmBiSubpackagerelationService iPdmBiSubpackagerelationService; // 子卷包装关系服务
|
private IPdmBiSubpackagerelationService iPdmBiSubpackagerelationService; // 子卷包装关系服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvdtlService iStIvtIostorinvdtlService; // 出入库明细服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvdisService iStIvtIostorinvdisService; // 出入库分配明细服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IosInRuleService iosInRuleService; // 入库分配规则服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService iSchBasePointService; // 点位服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService iSchBaseTaskService; // 任务服务
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object pageQuery(IostorInvQuery query, PageQuery pageQuery) {
|
public Object pageQuery(IostorInvQuery query, PageQuery pageQuery) {
|
||||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||||
page.setOrderBy("create_time DESC");
|
page.setOrderBy("input_time DESC");
|
||||||
List<Map> mst_detail = this.baseMapper.getPageQuery(query, pageQuery);
|
List<Map> mst_detail = this.baseMapper.getPageQuery(query, pageQuery);
|
||||||
|
|
||||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||||
@@ -65,4 +99,448 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
|||||||
|
|
||||||
return JSONArray.parseArray(JSONObject.toJSONString(resultList));
|
return JSONArray.parseArray(JSONObject.toJSONString(resultList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void create(JSONObject whereJson) {
|
||||||
|
|
||||||
|
// 组织主表数据
|
||||||
|
StIvtIostorinv mstDao = StIvtIostorinv.builder()
|
||||||
|
.iostorinv_id(IdUtil.getStringId())
|
||||||
|
.bill_code(CodeUtil.getNewCode("IN_IVN_CODE"))
|
||||||
|
.bill_status(IOSEnum.BILL_STATUS.code("生成"))
|
||||||
|
.create_mode(IOSEnum.CREATE_MODE.code("PC产生"))
|
||||||
|
.io_type(IOSEnum.IO_TYPE.code("入库"))
|
||||||
|
.input_optid(SecurityUtils.getCurrentUserId())
|
||||||
|
.input_optname(SecurityUtils.getCurrentNickName())
|
||||||
|
.input_time(DateUtil.now())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
updateMst(mstDao, whereJson);
|
||||||
|
|
||||||
|
this.save(mstDao);
|
||||||
|
|
||||||
|
// 组织插入明细、分配的数据
|
||||||
|
JSONArray tableData = whereJson.getJSONArray("tableData");
|
||||||
|
|
||||||
|
ArrayList<JSONObject> dtlList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < tableData.size(); i++) {
|
||||||
|
JSONObject json = tableData.getJSONObject(i);
|
||||||
|
|
||||||
|
JSONObject dtl = new JSONObject();
|
||||||
|
dtl.put("material_code",json.getString("product_name"));
|
||||||
|
dtl.put("pcsn",json.getString("container_name"));
|
||||||
|
dtl.put("plan_qty",json.getString("net_weight"));
|
||||||
|
dtl.put("box_no",json.getString("package_box_sn"));
|
||||||
|
dtlList.add(dtl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入明细
|
||||||
|
iStIvtIostorinvdtlService.insertDtl(mstDao.getIostorinv_id(), dtlList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(JSONObject whereJson) {
|
||||||
|
StIvtIostorinv mstDao = this.getById(whereJson.getString("iostorinv_id"));
|
||||||
|
|
||||||
|
// 组织主表数据
|
||||||
|
updateMst(mstDao, whereJson);
|
||||||
|
|
||||||
|
mstDao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||||
|
mstDao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||||
|
mstDao.setUpdate_time(DateUtil.now());
|
||||||
|
this.updateById(mstDao);
|
||||||
|
|
||||||
|
// 组织插入明细、分配的数据
|
||||||
|
JSONArray tableData = whereJson.getJSONArray("tableData");
|
||||||
|
|
||||||
|
ArrayList<JSONObject> dtlList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < tableData.size(); i++) {
|
||||||
|
JSONObject json = tableData.getJSONObject(i);
|
||||||
|
|
||||||
|
JSONObject dtl = new JSONObject();
|
||||||
|
dtl.put("material_code",json.getString("product_name"));
|
||||||
|
dtl.put("pcsn",json.getString("container_name"));
|
||||||
|
dtl.put("plan_qty",json.getString("net_weight"));
|
||||||
|
dtl.put("box_no",json.getString("package_box_sn"));
|
||||||
|
dtlList.add(dtl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入明细
|
||||||
|
iStIvtIostorinvdtlService.insertDtl(mstDao.getIostorinv_id(), dtlList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
for (Long id : ids) {
|
||||||
|
this.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinv>().lambda()
|
||||||
|
.set(StIvtIostorinv::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"))
|
||||||
|
.eq(StIvtIostorinv::getIostorinv_id, id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getInDtl(JSONObject whereJson) {
|
||||||
|
|
||||||
|
// 查询明细
|
||||||
|
List<JSONObject> dtlDaoList = iStIvtIostorinvdtlService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtl>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtl::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||||
|
).stream()
|
||||||
|
.map(row -> JSON.parseObject(JSONObject.toJSONString(row)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
dtlDaoList.forEach(row -> {
|
||||||
|
row.put("package_box_sn",row.getString("box_no"));
|
||||||
|
});
|
||||||
|
|
||||||
|
// 调用查询子卷包装关系服务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("data",JSON.parseArray(JSONArray.toJSONString(dtlDaoList)));
|
||||||
|
|
||||||
|
return queryBoxMater(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDtl(JSONObject whereJson) {
|
||||||
|
return iStIvtIostorinvdtlService.getIosDtl(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDis(JSONObject whereJson) {
|
||||||
|
return iStIvtIostorinvdisService.getIosDis(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void autoDivPoint(JSONObject whereJson) {
|
||||||
|
// 明细
|
||||||
|
JSONObject dtl_row = whereJson.getJSONObject("dtl_row");
|
||||||
|
|
||||||
|
// 校验是否需要分配
|
||||||
|
if (!dtl_row.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("生成")))
|
||||||
|
throw new BadRequestException("此明细不需要分配!");
|
||||||
|
|
||||||
|
// 找到一个可用点位
|
||||||
|
|
||||||
|
SchBasePoint pointDao = new SchBasePoint();
|
||||||
|
if (ObjectUtil.isEmpty(whereJson.getString("struct_code"))) {
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("sect_id",whereJson.getString("sect_id"));
|
||||||
|
param.put("stor_id",whereJson.getString("stor_id"));
|
||||||
|
param.put("type", RuleDto.PRODUCTION_IN_1);
|
||||||
|
|
||||||
|
pointDao = iosInRuleService.getOnePoint(param);
|
||||||
|
} else {
|
||||||
|
pointDao = iSchBasePointService.getById(whereJson.getString("point_code"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("未找到可用点位!");
|
||||||
|
|
||||||
|
// 更新所有分配明细
|
||||||
|
iStIvtIostorinvdisService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.set(StIvtIostorinvdis::getSect_id, "1")
|
||||||
|
.set(StIvtIostorinvdis::getSect_code, pointDao.getRegion_code())
|
||||||
|
.set(StIvtIostorinvdis::getSect_name, pointDao.getRegion_name())
|
||||||
|
.set(StIvtIostorinvdis::getStruct_id, "1")
|
||||||
|
.set(StIvtIostorinvdis::getStruct_code, pointDao.getPoint_code())
|
||||||
|
.set(StIvtIostorinvdis::getStruct_name, pointDao.getPoint_name())
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, dtl_row.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// 更新同一木箱明细状态
|
||||||
|
iStIvtIostorinvdtlService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdtl>().lambda()
|
||||||
|
.set(StIvtIostorinvdtl::getBill_status, IOSEnum.BILL_STATUS.code("分配完"))
|
||||||
|
.eq(StIvtIostorinvdtl::getIostorinv_id, dtl_row.getString("iostorinv_id"))
|
||||||
|
.eq(StIvtIostorinvdtl::getBox_no, dtl_row.getString("box_no"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新主表状态
|
||||||
|
this.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinv>().lambda()
|
||||||
|
.set(StIvtIostorinv::getUpdate_optid,SecurityUtils.getCurrentUserId())
|
||||||
|
.set(StIvtIostorinv::getUpdate_optname,SecurityUtils.getCurrentNickName())
|
||||||
|
.set(StIvtIostorinv::getUpdate_time,DateUtil.now())
|
||||||
|
.set(StIvtIostorinv::getDis_optid, SecurityUtils.getCurrentUserId())
|
||||||
|
.set(StIvtIostorinv::getDis_optname,SecurityUtils.getCurrentNickName())
|
||||||
|
.set(StIvtIostorinv::getDis_time,DateUtil.now())
|
||||||
|
.eq(StIvtIostorinv::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||||
|
);
|
||||||
|
updateMstStatus(whereJson.getString("iostorinv_id"));
|
||||||
|
|
||||||
|
// 锁定点位/解锁点位
|
||||||
|
ArrayList<SchBasePoint> paramList = new ArrayList<>();
|
||||||
|
paramList.add(pointDao);
|
||||||
|
iSchBasePointService.lockPoint(paramList,IOSEnum.LOCK_TYPE.code("入库锁"));
|
||||||
|
|
||||||
|
// 更新库存
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void unDivPoint(JSONObject whereJson) {
|
||||||
|
|
||||||
|
// 校验是否需要分配
|
||||||
|
if (!whereJson.getString("bill_status").equals(IOSEnum.BILL_STATUS.code("分配完")))
|
||||||
|
throw new BadRequestException("此明细不需要取消分配!");
|
||||||
|
|
||||||
|
// 点位编码
|
||||||
|
String point_code = iStIvtIostorinvdisService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
).get(0).getStruct_code();
|
||||||
|
|
||||||
|
|
||||||
|
// 更新分配明细
|
||||||
|
iStIvtIostorinvdisService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.set(StIvtIostorinvdis::getSect_id, "")
|
||||||
|
.set(StIvtIostorinvdis::getSect_code, "")
|
||||||
|
.set(StIvtIostorinvdis::getSect_name, "")
|
||||||
|
.set(StIvtIostorinvdis::getStruct_id, "")
|
||||||
|
.set(StIvtIostorinvdis::getStruct_code, "")
|
||||||
|
.set(StIvtIostorinvdis::getStruct_name, "")
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新同一木箱明细状态
|
||||||
|
iStIvtIostorinvdtlService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdtl>().lambda()
|
||||||
|
.set(StIvtIostorinvdtl::getBill_status, IOSEnum.BILL_STATUS.code("生成"))
|
||||||
|
.eq(StIvtIostorinvdtl::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||||
|
.eq(StIvtIostorinvdtl::getBox_no, whereJson.getString("box_no"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新主表状态
|
||||||
|
this.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinv>().lambda()
|
||||||
|
.set(StIvtIostorinv::getDis_optid, "")
|
||||||
|
.set(StIvtIostorinv::getDis_optname,"")
|
||||||
|
.set(StIvtIostorinv::getDis_time,"")
|
||||||
|
.eq(StIvtIostorinv::getIostorinv_id, whereJson.getString("iostorinv_id"))
|
||||||
|
);
|
||||||
|
updateMstStatus(whereJson.getString("iostorinv_id"));
|
||||||
|
|
||||||
|
// 锁定点位/解锁点位
|
||||||
|
ArrayList<SchBasePoint> paramList = new ArrayList<>();
|
||||||
|
paramList.add(iSchBasePointService.getById(point_code));
|
||||||
|
iSchBasePointService.lockPoint(paramList,IOSEnum.LOCK_TYPE.code("未锁定"));
|
||||||
|
|
||||||
|
// 更新库存
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void setPoint(JSONObject whereJson) {
|
||||||
|
|
||||||
|
// 校验入库点
|
||||||
|
SchBasePoint pointDao = iSchBasePointService.getOne(
|
||||||
|
new QueryWrapper<SchBasePoint>().lambda()
|
||||||
|
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
|
||||||
|
);
|
||||||
|
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("入库点不存在!");
|
||||||
|
|
||||||
|
// 生成任务
|
||||||
|
|
||||||
|
// 更新分配明细
|
||||||
|
iStIvtIostorinvdisService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.set(StIvtIostorinvdis::getPoint_id, pointDao.getPoint_code())
|
||||||
|
.set(StIvtIostorinvdis::getWork_status, IOSEnum.WORK_STATUS.code("生成"))
|
||||||
|
.set(StIvtIostorinvdis::getTask_id, "")
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDisTask(JSONObject whereJson) {
|
||||||
|
return iStIvtIostorinvdisService.getIosDisTask(whereJson);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delTask(JSONObject whereJson) {
|
||||||
|
// 校验任务是否为生成
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
||||||
|
if (!taskDao.getTask_status().equals("20")) throw new BadRequestException("请检查任务状态!");
|
||||||
|
|
||||||
|
// 删除任务
|
||||||
|
taskDao.setIs_delete(true);
|
||||||
|
iSchBaseTaskService.updateById(taskDao);
|
||||||
|
|
||||||
|
// 更新分配明细
|
||||||
|
iStIvtIostorinvdisService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.set(StIvtIostorinvdis::getWork_status, IOSEnum.WORK_STATUS.code("未生成"))
|
||||||
|
.set(StIvtIostorinvdis::getTask_id, "")
|
||||||
|
.set(StIvtIostorinvdis::getPoint_id, "")
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, whereJson.getString("iostorinvdtl_id"))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void issueTask(JSONObject whereJson) {
|
||||||
|
// 校验任务是否为生成
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
||||||
|
if (!taskDao.getTask_status().equals("20")) throw new BadRequestException("请检查任务状态!");
|
||||||
|
|
||||||
|
// 调用下发方法
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void confirmTask(JSONObject whereJson) {
|
||||||
|
// 更新任务为完成
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status, "07")
|
||||||
|
.eq(SchBaseTask::getTask_id, whereJson.getString("task_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新分配明细状态
|
||||||
|
iStIvtIostorinvdisService.update(
|
||||||
|
new UpdateWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.set(StIvtIostorinvdis::getWork_status, IOSEnum.WORK_STATUS.code("完成"))
|
||||||
|
.eq(StIvtIostorinvdis::getTask_id, whereJson.getString("task_id"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新明细状态
|
||||||
|
updateDtlStatus(whereJson.getString("iostorinvdtl_id"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void confirm(JSONObject whereJson) {
|
||||||
|
StIvtIostorinv mstDao = this.getById(whereJson.getString("iostorinv_id"));
|
||||||
|
|
||||||
|
// 调用方法
|
||||||
|
updateIvt(mstDao.getIostorinv_id());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新主表状态
|
||||||
|
* @param iostorinv_id 、
|
||||||
|
*/
|
||||||
|
private void updateMstStatus(String iostorinv_id) {
|
||||||
|
StIvtIostorinv mstDao = this.getById(iostorinv_id);
|
||||||
|
|
||||||
|
// 查询所有明细是否都为完成、分配中、分配完
|
||||||
|
List<StIvtIostorinvdtl> dtlDaoList = iStIvtIostorinvdtlService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtl>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtl::getIostorinv_id, iostorinv_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
boolean is_confirm = dtlDaoList.stream()
|
||||||
|
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")));
|
||||||
|
|
||||||
|
boolean is_div = dtlDaoList.stream()
|
||||||
|
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")));
|
||||||
|
|
||||||
|
boolean is_create = dtlDaoList.stream()
|
||||||
|
.allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("生成")));
|
||||||
|
|
||||||
|
if (is_confirm) {
|
||||||
|
// 都为完成
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||||
|
} else {
|
||||||
|
if (is_div) {
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||||
|
} else {
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("分配中"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_create) {
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateById(mstDao);
|
||||||
|
|
||||||
|
if (is_confirm) updateIvt(mstDao.getIostorinv_id());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新明细状态
|
||||||
|
* @param iostorinvdtl_id 、
|
||||||
|
*/
|
||||||
|
private void updateDtlStatus(String iostorinvdtl_id) {
|
||||||
|
|
||||||
|
StIvtIostorinvdtl dtlDao = iStIvtIostorinvdtlService.getById(iostorinvdtl_id);
|
||||||
|
|
||||||
|
// 查询所有分配明细是否都为完成
|
||||||
|
List<StIvtIostorinvdis> disDao = iStIvtIostorinvdisService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdis>().lambda()
|
||||||
|
.eq(StIvtIostorinvdis::getIostorinvdtl_id, iostorinvdtl_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 判断是否都为完成
|
||||||
|
boolean is_confirm = disDao.stream()
|
||||||
|
.allMatch(row -> row.getWork_status().equals(IOSEnum.WORK_STATUS.code("完成")));
|
||||||
|
|
||||||
|
if (is_confirm) {
|
||||||
|
// 更新明细为完成
|
||||||
|
dtlDao.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||||
|
iStIvtIostorinvdtlService.updateById(dtlDao);
|
||||||
|
|
||||||
|
updateMstStatus(dtlDao.getIostorinv_id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新库存
|
||||||
|
* @param iostorinv_id 、
|
||||||
|
*/
|
||||||
|
private void updateIvt(String iostorinv_id) {
|
||||||
|
// 更新主表状态为完成
|
||||||
|
StIvtIostorinv mstDao = this.getById(iostorinv_id);
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||||
|
mstDao.setConfirm_optid(SecurityUtils.getCurrentUserId());
|
||||||
|
mstDao.setConfirm_optname(SecurityUtils.getCurrentNickName());
|
||||||
|
mstDao.setConfirm_time(DateUtil.now());
|
||||||
|
this.updateById(mstDao);
|
||||||
|
|
||||||
|
// 更新库存
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织主表数据
|
||||||
|
* @param mstDao /
|
||||||
|
* @param whereJson /
|
||||||
|
*/
|
||||||
|
private void updateMst(StIvtIostorinv mstDao, JSONObject whereJson) {
|
||||||
|
mstDao.setBuss_type(whereJson.getString("bill_type"));
|
||||||
|
mstDao.setBill_type(whereJson.getString("bill_type"));
|
||||||
|
mstDao.setBiz_date(whereJson.getString("biz_date").substring(0,10));
|
||||||
|
mstDao.setStor_id(whereJson.getString("stor_id"));
|
||||||
|
mstDao.setStor_code(whereJson.getString("stor_code"));
|
||||||
|
mstDao.setStor_name(whereJson.getString("stor_name"));
|
||||||
|
mstDao.setSource_id(whereJson.getString("source_id"));
|
||||||
|
mstDao.setSource_name(whereJson.getString("source_name"));
|
||||||
|
mstDao.setSource_type(whereJson.getString("source_type"));
|
||||||
|
mstDao.setTotal_qty(whereJson.getBigDecimal("total_qty"));
|
||||||
|
mstDao.setDetail_count(whereJson.getBigDecimal("detail_count"));
|
||||||
|
mstDao.setRemark(whereJson.getString("remark"));
|
||||||
|
mstDao.setSyscompanyid("1");
|
||||||
|
mstDao.setSysdeptid("1");
|
||||||
|
mstDao.setIs_delete(false);
|
||||||
|
mstDao.setIs_upload(false);
|
||||||
|
mstDao.setIs_writeoff(false);
|
||||||
|
mstDao.setUpload_mes(false);
|
||||||
|
mstDao.setUpload_sap(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.config.IdUtil;
|
||||||
|
import org.nl.wms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdisMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单分配表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisMapper, StIvtIostorinvdis> implements IStIvtIostorinvdisService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void insetDis(List<JSONObject> collect) {
|
||||||
|
|
||||||
|
ArrayList<StIvtIostorinvdis> disDaoList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < collect.size(); i++) {
|
||||||
|
JSONObject json = collect.get(i);
|
||||||
|
|
||||||
|
StIvtIostorinvdis disDao = StIvtIostorinvdis.builder()
|
||||||
|
.iostorinvdis_id(IdUtil.getStringId())
|
||||||
|
.iostorinv_id(json.getString("iostorinv_id"))
|
||||||
|
.iostorinvdtl_id(json.getString("iostorinvdtl_id"))
|
||||||
|
.seq_no(BigDecimal.valueOf(i))
|
||||||
|
.sect_id(json.getString("sect_id"))
|
||||||
|
.sect_code(json.getString("sect_code"))
|
||||||
|
.sect_name(json.getString("sect_name"))
|
||||||
|
.struct_id(json.getString("struct_id"))
|
||||||
|
.struct_code(json.getString("struct_code"))
|
||||||
|
.struct_name(json.getString("struct_name"))
|
||||||
|
.material_id(json.getString("material_id"))
|
||||||
|
.pcsn(json.getString("pcsn"))
|
||||||
|
.quality_scode(json.getString("quality_scode"))
|
||||||
|
.work_status(IOSEnum.WORK_STATUS.code("未生成"))
|
||||||
|
.task_id(json.getString("task_id"))
|
||||||
|
.storagevehicle_id(json.getString("storagevehicle_id"))
|
||||||
|
.storagevehicle_code(json.getString("box_no"))
|
||||||
|
.is_issued(false)
|
||||||
|
.qty_unit_id(json.getString("qty_unit_id"))
|
||||||
|
.qty_unit_name(json.getString("qty_unit_name"))
|
||||||
|
.plan_qty(json.getBigDecimal("plan_qty"))
|
||||||
|
.real_qty(json.getBigDecimal("real_qty"))
|
||||||
|
.box_no(json.getString("box_no"))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
disDaoList.add(disDao);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveBatch(disDaoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDis(JSONObject whereJson) {
|
||||||
|
return JSON.parseArray(JSONArray.toJSONString(this.baseMapper.getIosDis(whereJson)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDisTask(JSONObject whereJson) {
|
||||||
|
return JSON.parseArray(JSONArray.toJSONString(this.baseMapper.getIosDisTask(whereJson)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.service.iostorInv.impl;
|
||||||
|
|
||||||
|
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.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.config.IdUtil;
|
||||||
|
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||||
|
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
|
||||||
|
import org.nl.wms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdtlService;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||||
|
import org.nl.wms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvdtlMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 出入库单明细表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtIostorinvdtlServiceImpl extends ServiceImpl<StIvtIostorinvdtlMapper, StIvtIostorinvdtl> implements IStIvtIostorinvdtlService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMdBaseMaterialService iMdBaseMaterialService; // 物料服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvService iStIvtIostorinvService; // 出入库主表服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvdisService iStIvtIostorinvdisService; // 出入库分配服务
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public ArrayList<StIvtIostorinvdtl> insertDtl(String iostorinv_id, List<JSONObject> tableDataList) {
|
||||||
|
|
||||||
|
// 查询所有对应物料集合
|
||||||
|
List<MdBaseMaterial> materialList = iMdBaseMaterialService.list(
|
||||||
|
new QueryWrapper<MdBaseMaterial>().lambda()
|
||||||
|
.in(MdBaseMaterial::getMaterial_code,
|
||||||
|
tableDataList.stream()
|
||||||
|
.map(row -> row.getString("material_code"))
|
||||||
|
.collect(Collectors.toSet())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
ArrayList<StIvtIostorinvdtl> dtlDaoList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 先删除
|
||||||
|
this.remove(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtl>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtl::getIostorinv_id, iostorinv_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 插入明细
|
||||||
|
for (int i = 0; i < tableDataList.size(); i++) {
|
||||||
|
JSONObject json = tableDataList.get(i);
|
||||||
|
|
||||||
|
MdBaseMaterial materDao = materialList.stream()
|
||||||
|
.filter(row -> row.getMaterial_code().equals(json.getString("material_code")))
|
||||||
|
.collect(Collectors.toList()).get(0);
|
||||||
|
if (ObjectUtil.isEmpty(materDao)) throw new BadRequestException("物料不存在"+json.getString("material_code"));
|
||||||
|
|
||||||
|
StIvtIostorinvdtl dtlDao = StIvtIostorinvdtl.builder()
|
||||||
|
.iostorinvdtl_id(IdUtil.getStringId())
|
||||||
|
.iostorinv_id(iostorinv_id)
|
||||||
|
.seq_no(BigDecimal.valueOf(i))
|
||||||
|
.material_id(materDao.getMaterial_id())
|
||||||
|
.pcsn(json.getString("pcsn"))
|
||||||
|
.quality_scode("00")
|
||||||
|
.bill_status(IOSEnum.BILL_STATUS.code("生成"))
|
||||||
|
.qty_unit_id("1")
|
||||||
|
.qty_unit_name("KG")
|
||||||
|
.plan_qty(json.getBigDecimal("plan_qty"))
|
||||||
|
.source_billdtl_id(json.getString("source_billdtl_id"))
|
||||||
|
.source_bill_type(json.getString("source_bill_type"))
|
||||||
|
.source_bill_code(json.getString("source_bill_code"))
|
||||||
|
.source_bill_table(json.getString("source_bill_table"))
|
||||||
|
.base_billdtl_id(json.getString("base_billdtl_id"))
|
||||||
|
.base_bill_type(json.getString("base_bill_type"))
|
||||||
|
.base_bill_code(json.getString("base_bill_code"))
|
||||||
|
.base_bill_table(json.getString("base_bill_table"))
|
||||||
|
.remark(json.getString("remark"))
|
||||||
|
.assign_qty(BigDecimal.valueOf(0))
|
||||||
|
.unassign_qty(json.getBigDecimal("plan_qty"))
|
||||||
|
.box_no(json.getString("box_no"))
|
||||||
|
.vbeln(json.getString("vbeln"))
|
||||||
|
.posnr(json.getString("posnr"))
|
||||||
|
.width(json.getString("width")).build();
|
||||||
|
dtlDaoList.add(dtlDao);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.saveBatch(dtlDaoList);
|
||||||
|
|
||||||
|
// 插入分配明细
|
||||||
|
StIvtIostorinv mstDao = iStIvtIostorinvService.getById(iostorinv_id);
|
||||||
|
if (mstDao.getIo_type().equals(IOSEnum.IO_TYPE.code("入库"))) {
|
||||||
|
iStIvtIostorinvdisService.insetDis(dtlDaoList.stream()
|
||||||
|
.map(row -> JSON.parseObject(JSONObject.toJSONString(row)))
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dtlDaoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getIosDtl(JSONObject param) {
|
||||||
|
return JSON.parseArray(JSONArray.toJSONString(this.baseMapper.getIosDtl(param)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 入库分配规则 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-10
|
||||||
|
*/
|
||||||
|
public interface IosInRuleService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个可用点位
|
||||||
|
* @param param
|
||||||
|
* {
|
||||||
|
* sect_id: 区域,
|
||||||
|
* stor_id: 仓库,
|
||||||
|
* ...等等
|
||||||
|
* type: 规则类型
|
||||||
|
* }
|
||||||
|
* @return SchBasePoint:点位
|
||||||
|
*/
|
||||||
|
SchBasePoint getOnePoint(JSONObject param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.util.dto;
|
||||||
|
|
||||||
|
public class RuleDto {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 入库分配:
|
||||||
|
* 按照仓库、区域、找到一个点位
|
||||||
|
*/
|
||||||
|
public static final String PRODUCTION_IN_1 = "in_1";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.wms.storage_manage.ios.util.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.storage_manage.ios.util.IosInRuleService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 入库分配规则 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-11-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class IosInRuleServiceImpl implements IosInRuleService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public SchBasePoint getOnePoint(JSONObject param) {
|
||||||
|
String type = param.getString("type");
|
||||||
|
|
||||||
|
return new SchBasePoint();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -122,10 +122,31 @@ security:
|
|||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: false
|
map-underscore-to-camel-case: false
|
||||||
|
call-setters-on-nulls: true
|
||||||
jdbc-type-for-null: null
|
jdbc-type-for-null: null
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
mapper-locations:
|
mapper-locations:
|
||||||
- classpath:org.nl.**.mapper/*.xml
|
- classpath:/org/nl/**/mapper/**/*.xml
|
||||||
global-config:
|
global-config:
|
||||||
db-config:
|
db-config:
|
||||||
id-type: INPUT
|
id-type: INPUT
|
||||||
|
jetcache:
|
||||||
|
statIntervalMinutes: 15
|
||||||
|
areaInCacheName: false
|
||||||
|
local:
|
||||||
|
default:
|
||||||
|
type: linkedhashmap
|
||||||
|
keyConvertor: fastjson
|
||||||
|
remote:
|
||||||
|
default:
|
||||||
|
type: redis
|
||||||
|
keyConvertor: fastjson2
|
||||||
|
broadcastChannel: projectA
|
||||||
|
valueEncoder: java
|
||||||
|
valueDecoder: java
|
||||||
|
poolConfig:
|
||||||
|
minIdle: 5
|
||||||
|
maxIdle: 20
|
||||||
|
maxTotal: 50
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 6379
|
||||||
|
|||||||
@@ -205,7 +205,9 @@ export default {
|
|||||||
bill_btn: false,
|
bill_btn: false,
|
||||||
mater_btn: false,
|
mater_btn: false,
|
||||||
materType: '',
|
materType: '',
|
||||||
storlist: [],
|
storlist: [
|
||||||
|
{ 'stor_id': '1010101', 'stor_name': '测试仓库' }
|
||||||
|
],
|
||||||
rules: {
|
rules: {
|
||||||
stor_id: [
|
stor_id: [
|
||||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||||
@@ -237,6 +239,9 @@ export default {
|
|||||||
},
|
},
|
||||||
[CRUD.HOOK.afterToEdit]() {
|
[CRUD.HOOK.afterToEdit]() {
|
||||||
// 获取入库单明细
|
// 获取入库单明细
|
||||||
|
inBill.getInDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||||
|
this.form.tableData = res
|
||||||
|
})
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.afterToAdd]() {
|
[CRUD.HOOK.afterToAdd]() {
|
||||||
this.bill_btn = false
|
this.bill_btn = false
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<span class="crud-opts-right2">
|
<span class="crud-opts-right2">
|
||||||
<!--左侧插槽-->
|
<!--左侧插槽-->
|
||||||
<slot name="left">
|
<slot name="left">
|
||||||
<el-button
|
<!--<el-button
|
||||||
:loading="allDivBtn"
|
:loading="allDivBtn"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
@click="allDivStruct()"
|
@click="allDivStruct()"
|
||||||
>
|
>
|
||||||
全部分配
|
全部分配
|
||||||
</el-button>
|
</el-button>-->
|
||||||
</slot>
|
</slot>
|
||||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="divPoint()"
|
@click="setPoint()"
|
||||||
>
|
>
|
||||||
设置起点
|
设置起点
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -237,7 +237,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
/* crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
|
/* crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -258,13 +258,9 @@ export default {
|
|||||||
},
|
},
|
||||||
clcikRow(row) {
|
clcikRow(row) {
|
||||||
this.form.dtl_row = row
|
this.form.dtl_row = row
|
||||||
/*crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
|
inBill.getIosDis(row).then(res => {
|
||||||
this.openParam = res
|
|
||||||
this.form.dtl_row = res[row.index]
|
|
||||||
})
|
|
||||||
crudRawAssist.getDisDtl(row).then(res => {
|
|
||||||
this.form.tableMater = res
|
this.form.tableMater = res
|
||||||
})*/
|
})
|
||||||
},
|
},
|
||||||
tableRowClassName({ row, rowIndex }) {
|
tableRowClassName({ row, rowIndex }) {
|
||||||
row.index = rowIndex
|
row.index = rowIndex
|
||||||
@@ -295,20 +291,58 @@ export default {
|
|||||||
this.form.tableMater[i].sect_name = row.sect_name
|
this.form.tableMater[i].sect_name = row.sect_name
|
||||||
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
||||||
}
|
}
|
||||||
/* crudRawAssist.divStruct(this.form).then(res => {
|
/* crudRawAssist.divStruct(this.form).then(res => {
|
||||||
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||||
this.openParam = res
|
this.openParam = res
|
||||||
})
|
})
|
||||||
this.form.tableMater = []
|
this.form.tableMater = []
|
||||||
})*/
|
})*/
|
||||||
},
|
},
|
||||||
divPoint() {
|
setPoint() {
|
||||||
|
if (!this.form.dtl_row) {
|
||||||
|
this.crud.notify('请选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!this.form.point_code) {
|
||||||
|
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.form.dtl_row.point_code = this.form.point_code
|
||||||
|
inBill.setPoint(this.form.dtl_row).then(res => {
|
||||||
|
|
||||||
|
})
|
||||||
},
|
},
|
||||||
allDivStruct() {
|
allDivStruct() {
|
||||||
},
|
},
|
||||||
divStruct() {
|
divStruct() {
|
||||||
|
if (!this.form.dtl_row) {
|
||||||
|
this.crud.notify('请选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 判断是手工分配还是自动分配
|
||||||
|
if (this.form.checked === true) {
|
||||||
|
if (!this.sect_id) {
|
||||||
|
this.crud.notify('请先选择区域!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.divBtn = true
|
||||||
|
this.form.sect_id = this.sect_id
|
||||||
|
this.form.stor_id = this.stor_id
|
||||||
|
inBill.autoDivPoint(this.form).then(res => {
|
||||||
|
|
||||||
|
}).finally(() => {
|
||||||
|
this.divBtn = false
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
unDivStruct() {
|
unDivStruct() {
|
||||||
|
if (!this.form.dtl_row) {
|
||||||
|
this.crud.notify('请选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
inBill.unDivPoint(this.form.dtl_row).then(res => {
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,20 +35,11 @@
|
|||||||
@row-click="clcikRow"
|
@row-click="clcikRow"
|
||||||
>
|
>
|
||||||
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
|
|
||||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" />
|
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
|
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||||
<el-table-column
|
|
||||||
show-overflow-tooltip
|
|
||||||
prop="assign_qty"
|
|
||||||
:formatter="crud.formatNum3"
|
|
||||||
label="已分配数量"
|
|
||||||
align="center"
|
|
||||||
/>
|
|
||||||
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量" align="center" />
|
|
||||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
|
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -80,7 +71,7 @@
|
|||||||
type="warning"
|
type="warning"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="reIssueTask()"
|
@click="issueTask()"
|
||||||
>
|
>
|
||||||
下发
|
下发
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -117,7 +108,7 @@
|
|||||||
<el-table-column width="230" prop="box_no" label="木箱码" align="center" />
|
<el-table-column width="230" prop="box_no" label="木箱码" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="struct_code" label="分配货位" align="center" />
|
<el-table-column show-overflow-tooltip prop="struct_code" label="分配货位" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="work_status" label="指令状态" :formatter="statusFormat" align="center" />
|
<el-table-column show-overflow-tooltip prop="task_status" label="指令状态" :formatter="statusFormat" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="task_code" label="指令操作号" align="center" />
|
<el-table-column show-overflow-tooltip prop="task_code" label="指令操作号" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="point_code" label="入库点位编码" align="center" />
|
<el-table-column show-overflow-tooltip prop="point_code" label="入库点位编码" align="center" />
|
||||||
<el-table-column show-overflow-tooltip prop="point_name" label="入库点位名称" align="center" />
|
<el-table-column show-overflow-tooltip prop="point_name" label="入库点位名称" align="center" />
|
||||||
@@ -174,23 +165,68 @@ export default {
|
|||||||
this.form.dtl_row = null
|
this.form.dtl_row = null
|
||||||
this.$emit('AddChanged')
|
this.$emit('AddChanged')
|
||||||
},
|
},
|
||||||
delTask() {
|
|
||||||
},
|
|
||||||
statusFormat(row, column) {
|
|
||||||
return this.dict.label.TASK_STATUS[row.work_status]
|
|
||||||
},
|
|
||||||
confirmTask() {
|
|
||||||
},
|
|
||||||
reIssueTask() {
|
|
||||||
},
|
|
||||||
checkedChange(val) {
|
|
||||||
},
|
|
||||||
clcikRow(row, column, event) {
|
clcikRow(row, column, event) {
|
||||||
this.form.dtl_row = row
|
this.form.dtl_row = row
|
||||||
row.checked = this.form.checked
|
row.checked = this.form.checked
|
||||||
/* crudRawAssist.queryTask(row).then(res => {
|
inBill.getIosDisTask(row).then(res => {
|
||||||
this.form.tableMater = res
|
this.form.tableMater = res
|
||||||
})*/
|
})
|
||||||
|
},
|
||||||
|
delTask() {
|
||||||
|
if (!this.dis_row) {
|
||||||
|
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this.dis_row.work_status !== '20') {
|
||||||
|
this.crud.notify('只能对状态为生成的任务进行删除!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
inBill.delTask(this.dis_row).then(rea => {
|
||||||
|
this.form.dtl_row.checked = this.form.checked
|
||||||
|
inBill.getIosDisTask(this.form.dtl_row).then(res => {
|
||||||
|
this.form.tableMater = res
|
||||||
|
this.crud.notify('删除成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
issueTask() {
|
||||||
|
if (!this.dis_row) {
|
||||||
|
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this.dis_row.work_status !== '20') {
|
||||||
|
this.crud.notify('只能对状态为生成的任务进行下发!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
inBill.issueTask(this.dis_row).then(rea => {
|
||||||
|
this.form.dtl_row.checked = this.form.checked
|
||||||
|
inBill.getIosDisTask(this.form.dtl_row).then(res => {
|
||||||
|
this.form.tableMater = res
|
||||||
|
this.crud.notify('下发成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
confirmTask() {
|
||||||
|
if (!this.dis_row) {
|
||||||
|
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (this.dis_row.work_status === '99' || this.dis_row.work_status === '00') {
|
||||||
|
this.crud.notify('只能已生成或下发进行中的任务完成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
inBill.confirmTask(this.dis_row).then(rea => {
|
||||||
|
this.form.dtl_row.checked = this.form.checked
|
||||||
|
inBill.getIosDisTask(this.form.dtl_row).then(res => {
|
||||||
|
this.form.tableMater = res
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
checkedChange(val) {
|
||||||
|
},
|
||||||
|
statusFormat(row, column) {
|
||||||
|
return this.dict.label.TASK_STATUS[row.work_status]
|
||||||
},
|
},
|
||||||
clcikDisRow(row, column, event) {
|
clcikDisRow(row, column, event) {
|
||||||
this.dis_row = row
|
this.dis_row = row
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
:disabled="true"
|
:disabled="true"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.INANDOUT_BILL_TYPE"
|
v-for="item in dict.ST_INV_IN_TYPE"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -103,9 +103,9 @@
|
|||||||
:highlight-current-row="true"
|
:highlight-current-row="true"
|
||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
@current-change="handleDtlCurrentChange"
|
@current-change="handleDtlCurrentChange"
|
||||||
|
@row-click="clcikRow"
|
||||||
>
|
>
|
||||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
|
|
||||||
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
|
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||||
@@ -152,13 +152,14 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { crud } from '@crud/crud'
|
import { crud } from '@crud/crud'
|
||||||
|
import inBill from '@/views/wms/storage_manage/ios/inbill/inbill'
|
||||||
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ViewDialog',
|
name: 'ViewDialog',
|
||||||
components: { },
|
components: { },
|
||||||
mixins: [crud()],
|
mixins: [crud()],
|
||||||
dicts: ['IO_BILL_STATUS', 'WORK_STATUS', 'TASK_STATUS'],
|
dicts: ['IO_BILL_STATUS', 'WORK_STATUS', 'TASK_STATUS', 'ST_INV_IN_TYPE'],
|
||||||
props: {
|
props: {
|
||||||
dialogShow: {
|
dialogShow: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -242,18 +243,14 @@ export default {
|
|||||||
this.currentDis = current
|
this.currentDis = current
|
||||||
},
|
},
|
||||||
queryTableDtl() {
|
queryTableDtl() {
|
||||||
/* checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
inBill.getIosDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||||
this.tableDtl = res
|
this.tableDtl = res
|
||||||
})*/
|
})
|
||||||
},
|
},
|
||||||
queryTableDdis() {
|
clcikRow(row) {
|
||||||
/*if (this.currentdtl !== null) {
|
inBill.getIosDisTask(row).then(res => {
|
||||||
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
|
this.tabledis = res
|
||||||
this.tabledis = res
|
})
|
||||||
}).catch(() => {
|
|
||||||
this.tabledis = []
|
|
||||||
})
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,93 @@ export function queryBoxMater(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, queryBoxMater }
|
export function getInDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/getInDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIosDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/getIosDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIosDis(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/getIosDis',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function autoDivPoint(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/autoDivPoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function unDivPoint(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/unDivPoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setPoint(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/setPoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getIosDisTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/getIosDisTask',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/delTask',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function issueTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/issueTask',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirmTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/confirmTask',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirm(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/stIvtIostorinv/inBill/confirm',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, queryBoxMater, getInDtl, getIosDtl, getIosDis,
|
||||||
|
autoDivPoint, unDivPoint, setPoint, getIosDisTask, delTask, issueTask, confirmTask, confirm }
|
||||||
|
|||||||
@@ -325,7 +325,9 @@ export default {
|
|||||||
this.viewShow = true
|
this.viewShow = true
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
|
inBill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||||
|
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
stateFormat(row, column) {
|
stateFormat(row, column) {
|
||||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||||
@@ -334,12 +336,20 @@ export default {
|
|||||||
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||||
},
|
},
|
||||||
divOpen() {
|
divOpen() {
|
||||||
|
inBill.getIosDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||||
|
this.openParam = res
|
||||||
|
this.divShow = true
|
||||||
|
})
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
this.onSelectAll()
|
this.onSelectAll()
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
taskOpen() {
|
taskOpen() {
|
||||||
|
inBill.getIosDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||||
|
this.openParam = res
|
||||||
|
this.taskShow = true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user