opt: 入库管理
This commit is contained in:
@@ -44,6 +44,15 @@ public interface IStructattrService extends IService<Structattr> {
|
||||
*/
|
||||
Structattr findByCode(String code);
|
||||
|
||||
/**
|
||||
* 根据库区标识查询
|
||||
*
|
||||
* @param id id
|
||||
* @return Structattr
|
||||
*/
|
||||
List<Structattr> findBySectId(String id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -88,6 +89,12 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Structattr> findBySectId(String id) {
|
||||
return structattrMapper.selectList(new LambdaQueryWrapper<>(Structattr.class)
|
||||
.eq(Structattr::getSect_id,id));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Structattr dto) {
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package org.nl.wms.warehouse_management.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/19
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/in/rawAssist")
|
||||
@Slf4j
|
||||
public class RawAssistIStorController {
|
||||
|
||||
@Resource
|
||||
private IRawAssistIStorService iRawAssistIStorService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询入库单据")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iRawAssistIStorService.pageQuery(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除出入库单")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
iRawAssistIStorService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getBillDtl")
|
||||
@Log("查询入库单来源")
|
||||
public ResponseEntity<Object> getBillDtl(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iRawAssistIStorService.getBillDtl(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping()
|
||||
@Log("新增入库单")
|
||||
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.insertDtl(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改入库单")
|
||||
public ResponseEntity<Object> update(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/getIODtl")
|
||||
@Log("查询出入库单明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iRawAssistIStorService.getIODtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisDtl")
|
||||
@Log("查询入库分配载具明细")
|
||||
public ResponseEntity<Object> getDisDtl(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(iRawAssistIStorService.getDisDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/divStruct")
|
||||
@Log("分配货位")
|
||||
public ResponseEntity<Object> divStruct(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.divStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/allDivStruct")
|
||||
@Log("全部分配货位")
|
||||
public ResponseEntity<Object> allDivStruct(@RequestBody JSONObject whereJson) {
|
||||
iRawAssistIStorService.allDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/unDivStruct")
|
||||
@Log("取消分配货位")
|
||||
public ResponseEntity<Object> unDivStruct(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.unDivStruct(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/divPoint")
|
||||
@Log("设置起点")
|
||||
public ResponseEntity<Object> divPoint(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.divPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTask")
|
||||
@Log("查询任务")
|
||||
public ResponseEntity<Object> queryTask(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(iRawAssistIStorService.queryTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTask")
|
||||
@Log("变更任务")
|
||||
public ResponseEntity<Object> updateTask(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.updateTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/delTask")
|
||||
@Log("删除任务")
|
||||
public ResponseEntity<Object> delTask(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.delTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/reIssueTask")
|
||||
@Log("下发")
|
||||
public ResponseEntity<Object> reIssueTask(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.reIssueTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmTask")
|
||||
@Log("完成任务")
|
||||
public ResponseEntity<Object> confirmTask(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.confirmTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/cancelTask")
|
||||
@Log("取消完成任务")
|
||||
public ResponseEntity<Object> cancelTask(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.cancelTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("完成单据")
|
||||
public ResponseEntity<Object> confirm(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/backConfirm")
|
||||
@Log("完成入库负单")
|
||||
public ResponseEntity<Object> backConfirm(@RequestBody Map whereJson) {
|
||||
iRawAssistIStorService.backConfirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/autoDis")
|
||||
@Log("自动分配")
|
||||
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
|
||||
iRawAssistIStorService.autoDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.nl.wms.warehouse_management.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/19
|
||||
*/
|
||||
public interface IRawAssistIStorService extends IService<IOStorInv> {
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page);
|
||||
|
||||
IPage<GroupPlateDto> getBillDtl(Map whereJson, PageQuery page);
|
||||
|
||||
String insertDtl(Map whereJson);
|
||||
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void update(Map whereJson);
|
||||
|
||||
List<IOStorInvDtlDto> getIODtl(Map whereJson);
|
||||
|
||||
void divStruct(Map whereJson);
|
||||
|
||||
void allDivStruct(JSONObject form);
|
||||
|
||||
void unDivStruct(Map whereJson);
|
||||
|
||||
void divPoint(Map whereJson);
|
||||
|
||||
void updateTask(Map whereJson);
|
||||
|
||||
void delTask(Map whereJson);
|
||||
|
||||
void reIssueTask(Map whereJson);
|
||||
|
||||
void confirmTask(Map whereJson);
|
||||
|
||||
void cancelTask(Map whereJson);
|
||||
|
||||
void confirm(Map whereJson);
|
||||
|
||||
void backConfirm(Map whereJson);
|
||||
|
||||
List<IOStorInvDisDto> getDisDtl(Map whereJson);
|
||||
|
||||
JSONArray queryTask(Map whereJson);
|
||||
|
||||
Structattr autoDis(JSONObject whereJson);
|
||||
|
||||
JSONObject autoDisMove(JSONObject whereJson);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/20
|
||||
*/
|
||||
@Data
|
||||
@TableName("md_pb_groupplate")
|
||||
public class GroupPlate implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 组盘标识
|
||||
*/
|
||||
@TableId("group_id")
|
||||
private String group_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 组盘数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态 01组盘 02入库 03出库
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 组盘人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 组盘人名称
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 组盘时间
|
||||
*/
|
||||
private String create_time;
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/19
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_ivt_iostorinv")
|
||||
public class IOStorInv implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入库单标识
|
||||
*/
|
||||
@TableId("iostorinv_id")
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 出入类型
|
||||
*/
|
||||
private String io_type;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
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 String source_id;
|
||||
|
||||
/**
|
||||
* 来源方名称
|
||||
*/
|
||||
private String source_name;
|
||||
|
||||
/**
|
||||
* 来源方类型
|
||||
*/
|
||||
private String source_type;
|
||||
|
||||
/**
|
||||
* 总数量
|
||||
*/
|
||||
private BigDecimal total_qty;
|
||||
|
||||
/**
|
||||
* 总重量
|
||||
*/
|
||||
private BigDecimal total_weight;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private Integer detail_count;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 生成方式
|
||||
*/
|
||||
private String create_mode;
|
||||
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
private String input_optid;
|
||||
|
||||
/**
|
||||
* 制单人姓名
|
||||
*/
|
||||
private String input_optname;
|
||||
|
||||
/**
|
||||
* 制单时间
|
||||
*/
|
||||
private String input_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 分配人
|
||||
*/
|
||||
private String dis_optid;
|
||||
|
||||
/**
|
||||
* 分配人姓名
|
||||
*/
|
||||
private String dis_optname;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private String dis_time;
|
||||
|
||||
/**
|
||||
* 确认人
|
||||
*/
|
||||
private String confirm_optid;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String confirm_optname;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String sysdeptid;
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private String syscompanyid;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 是否已上传
|
||||
*/
|
||||
private String is_upload;
|
||||
|
||||
/**
|
||||
* 回传人
|
||||
*/
|
||||
private String upload_optid;
|
||||
/**
|
||||
* 回传时间
|
||||
*/
|
||||
private String upload_time;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_ivt_iostorinvdis")
|
||||
public class IOStorInvDis implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单分配标识
|
||||
*/
|
||||
@TableId("iostorinvdis_id")
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private String 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 work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
private String is_issued;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private String plan_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 出入点位标识
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package org.nl.wms.warehouse_management.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_ivt_iostorinvdtl")
|
||||
public class IOStorInvDtl implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
@TableId("iostorinvdtl_id")
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String seq_no;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
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 remark;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private BigDecimal assign_qty;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private BigDecimal unassign_qty;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Mapper
|
||||
public interface GroupPlateMapper extends BaseMapper<GroupPlate> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Mapper
|
||||
public interface IOStorInvDisMapper extends BaseMapper<IOStorInvDis> {
|
||||
|
||||
List<IOStorInvDisDto> queryInBillDisDtlByIosId(@Param("iostorinv_id")String iostorinv_id);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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.warehouse_management.service.dao.mapper.IOStorInvDisMapper">
|
||||
|
||||
<select id="queryInBillDisDtlByIosId" resultType="org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto">
|
||||
SELECT
|
||||
dis.*,
|
||||
mb.material_code,
|
||||
mb.material_name
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
where
|
||||
(dis.task_id is null OR dis.task_id = '')
|
||||
<if test="iostorinv_id != null">
|
||||
AND
|
||||
dis.iostorinv_id = #{iostorinv_id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Mapper
|
||||
public interface IOStorInvDtlMapper extends BaseMapper<IOStorInvDtl> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.warehouse_management.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/19
|
||||
*/
|
||||
@Mapper
|
||||
public interface IOStorInvMapper extends BaseMapper<IOStorInv> {
|
||||
|
||||
IPage<IOStorInv> queryAllByPage (IPage<IOStorInv> page,@Param("params") Map whereJson);
|
||||
|
||||
IPage<GroupPlateDto> getBillDtl (IPage<GroupPlateDto> page, @Param("params") Map whereJson);
|
||||
|
||||
List<IOStorInvDtlDto> getIODtl (@Param("params") Map whereJson);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?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.warehouse_management.service.dao.mapper.IOStorInvMapper">
|
||||
<select id="queryAllByPage" resultType="org.nl.wms.warehouse_management.service.dao.IOStorInv">
|
||||
SELECT DISTINCT ios.* FROM st_ivt_iostorinv ios
|
||||
LEFT JOIN st_ivt_iostorinvdtl dtl ON ios.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
<where>
|
||||
ios.is_delete = '0' AND ios.io_type = '0'
|
||||
<if test="params.bill_code != null">
|
||||
AND
|
||||
ios.bill_code LIKE #{params.bill_code}
|
||||
</if>
|
||||
<if test="params.pcsn != null">
|
||||
AND
|
||||
dis.pcsn LIKE #{params.pcsn}
|
||||
</if>
|
||||
<if test="params.pcsn_in != null">
|
||||
AND
|
||||
dis.pcsn IN #{params.pcsn_in}
|
||||
</if>
|
||||
<if test="params.stor_id != null">
|
||||
AND
|
||||
ios.stor_id = #{params.stor_id}
|
||||
</if>
|
||||
<if test="params.bill_type != null">
|
||||
AND
|
||||
ios.bill_type = #{params.bill_type}
|
||||
</if>
|
||||
<if test="params.create_mode != null">
|
||||
AND
|
||||
ios.create_mode = #{params.create_mode}
|
||||
</if>
|
||||
<if test="params.bill_status != null">
|
||||
AND
|
||||
ios.bill_status = #{params.bill_status}
|
||||
</if>
|
||||
<if test="params.begin_time != null">
|
||||
AND
|
||||
ios.input_time >= #{params.begin_time}
|
||||
</if>
|
||||
<if test="params.end_time != null">
|
||||
AND
|
||||
ios.input_time <= #{params.end_time}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY ios.iostorinv_id Desc
|
||||
</select>
|
||||
|
||||
<select id="getBillDtl" resultType="org.nl.wms.warehouse_management.service.dto.GroupPlateDto">
|
||||
SELECT gp.*, mtl.material_code, mtl.material_name , gp.qty as plan_qty FROM md_pb_groupplate gp
|
||||
LEFT JOIN md_me_materialbase mtl ON gp.material_id = mtl.material_id
|
||||
<where>
|
||||
gp.status = '01'
|
||||
<if test="params.material_code != null">
|
||||
AND
|
||||
mtl.material_code LIKE CONCAT('%', #{params.material_code}, '%')
|
||||
</if>
|
||||
<if test="params.pcsn != null">
|
||||
AND
|
||||
gp.pcsn LIKE CONCAT('%', #{params.pcsn}, '%')
|
||||
</if>
|
||||
<if test="params.storagevehicle_code != null">
|
||||
AND
|
||||
gp.storagevehicle_code LIKE CONCAT('%', #{params.storagevehicle_code}, '%')
|
||||
</if>
|
||||
<if test="params.begin_time != null">
|
||||
AND
|
||||
gp.create_time >= #{params.begin_time}
|
||||
</if>
|
||||
<if test="params.end_time != null">
|
||||
AND
|
||||
gp.create_time <= #{params.end_time}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY gp.create_time Desc
|
||||
</select>
|
||||
|
||||
<select id="getIODtl" resultType="org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto">
|
||||
SELECT DISTINCT
|
||||
dtl.*,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mst.bill_code,
|
||||
gp.storagevehicle_code
|
||||
FROM
|
||||
st_ivt_iostorinvdtl dtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
LEFT JOIN ST_IVT_IOStorInv mst ON mst.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN md_pb_groupplate gp ON gp.pcsn = dtl.pcsn
|
||||
where
|
||||
1=1
|
||||
<if test="params.bill_code != null">
|
||||
AND
|
||||
mst.bill_code = #{params.bill_code}
|
||||
</if>
|
||||
|
||||
<if test="params.iostorinv_id != null">
|
||||
AND
|
||||
mst.iostorinv_id = #{params.iostorinv_id}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryInBillDisDtlByIosId" resultType="org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto">
|
||||
SELECT
|
||||
dis.*,
|
||||
mb.material_code,
|
||||
mb.material_name
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
where
|
||||
(dis.task_id is null OR dis.task_id = '')
|
||||
<if test="iostorinv_id != null">
|
||||
AND
|
||||
dis.iostorinv_id = #{iostorinv_id}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.warehouse_management.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/20
|
||||
*/
|
||||
@Data
|
||||
public class GroupPlateDto extends GroupPlate{
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.warehouse_management.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/22
|
||||
*/
|
||||
@Data
|
||||
public class IOStorInvDisDto extends IOStorInvDis {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.warehouse_management.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/21
|
||||
*/
|
||||
@Data
|
||||
public class IOStorInvDtlDto extends IOStorInvDtl {
|
||||
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 载具编号
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
}
|
||||
@@ -0,0 +1,680 @@
|
||||
package org.nl.wms.warehouse_management.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.nl.wms.warehouse_management.service.IRawAssistIStorService;
|
||||
import org.nl.wms.warehouse_management.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_management.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.GroupPlateMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.nl.wms.warehouse_management.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_management.service.dto.GroupPlateDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_management.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/19
|
||||
*/
|
||||
@Service
|
||||
public class RawAssistIStorServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> implements IRawAssistIStorService {
|
||||
|
||||
@Resource
|
||||
private IOStorInvMapper ioStorInvMapper;
|
||||
|
||||
@Resource
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Resource
|
||||
private IOStorInvDtlMapper ioStorInvDtlMapper;
|
||||
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
|
||||
@Resource
|
||||
private MdPbStoragevehicleinfoMapper mdPbStoragevehicleinfoMapper;
|
||||
|
||||
@Resource
|
||||
private GroupPlateMapper groupPlateMapper;
|
||||
|
||||
@Override
|
||||
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("buss_type", (String) whereJson.get("buss_type"));
|
||||
map.put("stor_id", (String) whereJson.get("stor_id"));
|
||||
map.put("bill_type", (String) whereJson.get("bill_type"));
|
||||
map.put("create_mode", (String) whereJson.get("create_mode"));
|
||||
map.put("bill_status", (String) whereJson.get("bill_status"));
|
||||
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
} else {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
String begin_time = (String) whereJson.get("begin_time");
|
||||
|
||||
if (!StrUtil.isEmpty(begin_time)) {
|
||||
map.put("begin_time", begin_time);
|
||||
}
|
||||
String end_time = (String) whereJson.get("end_time");
|
||||
if (!StrUtil.isEmpty(end_time)) {
|
||||
map.put("end_time", end_time);
|
||||
}
|
||||
return ioStorInvMapper.queryAllByPage(new Page<>(page.getPage()+1, page.getSize()), map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<GroupPlateDto> getBillDtl(Map whereJson, PageQuery page) {
|
||||
return ioStorInvMapper.getBillDtl(new Page<>(page.getPage()+1,page.getSize()),whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String insertDtl(Map whereJson) {
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
double total_qty = 0;
|
||||
JSONObject io_mst = new JSONObject();
|
||||
String iostorinv_id = IdUtil.getStringId();
|
||||
String bill_code = CodeUtil.getNewCode("IN_STORE_CODE");
|
||||
io_mst.put("iostorinv_id", iostorinv_id);
|
||||
io_mst.put("bill_code", bill_code);
|
||||
io_mst.put("buss_type", ((String) whereJson.get("bill_type")).substring(0, 4));
|
||||
io_mst.put("io_type", "0");
|
||||
io_mst.put("bill_type", whereJson.get("bill_type"));
|
||||
io_mst.put("biz_date", whereJson.get("biz_date").toString().substring(0, 10));
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.findById((String) whereJson.get("stor_id"));
|
||||
String stor_code = bsrealStorattr.getStor_code();
|
||||
String stor_name = bsrealStorattr.getStor_name();
|
||||
io_mst.put("stor_id", whereJson.get("stor_id"));
|
||||
io_mst.put("stor_code", stor_code);
|
||||
io_mst.put("stor_name", stor_name);
|
||||
io_mst.put("detail_count", rows.size());
|
||||
io_mst.put("remark", whereJson.get("remark"));
|
||||
io_mst.put("bill_status", whereJson.get("bill_status"));
|
||||
io_mst.put("create_mode", "01");
|
||||
io_mst.put("input_optid", currentUserId + "");
|
||||
io_mst.put("input_optname", nickName);
|
||||
io_mst.put("input_time", now);
|
||||
io_mst.put("update_optid", currentUserId + "");
|
||||
io_mst.put("update_optname", nickName);
|
||||
io_mst.put("update_time", now);
|
||||
io_mst.put("is_delete", "0");
|
||||
io_mst.put("is_upload", "0");
|
||||
Long deptId = SecurityUtils.getDeptId();
|
||||
io_mst.put("sysdeptid", deptId + "");
|
||||
io_mst.put("syscompanyid", deptId + "");
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
HashMap<String, Object> row = rows.get(i);
|
||||
JSONObject ioStorInvDtl = new JSONObject();
|
||||
ioStorInvDtl.putAll(row);
|
||||
ioStorInvDtl.put("iostorinvdtl_id",IdUtil.getStringId());
|
||||
ioStorInvDtl.put("iostorinv_id",iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no",(i + 1)+"");
|
||||
ioStorInvDtl.put("material_id",row.get("material_id"));
|
||||
ioStorInvDtl.put("Pcsn",row.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status","10");
|
||||
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
|
||||
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
|
||||
ioStorInvDtl.put("assign_qty",row.get("qty"));
|
||||
ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
|
||||
total_qty += Double.parseDouble(row.get("qty").toString());
|
||||
|
||||
//判断该木箱是否已经生成入库单
|
||||
//判断该载具是否已经分配货位或者起点
|
||||
// JSONArray now_dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "18").addParam("box_no", row.get("package_box_sn")).process().getResultJSONArray(0);
|
||||
// if (now_dis_rows.size() > 0) {
|
||||
// throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
|
||||
// }
|
||||
//判断该木箱是否已经存在库内
|
||||
// JSONObject str_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + row.get("package_box_sn") + "'").uniqueResult(0);
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
}
|
||||
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
|
||||
JSONObject dis = new JSONObject();
|
||||
dis.put("iostorinvdis_id", IdUtil.getStringId());
|
||||
dis.put("iostorinv_id", iostorinv_id);
|
||||
dis.put("iostorinvdtl_id", ioStorInvDtl.getString("iostorinvdtl_id"));
|
||||
dis.put("seq_no", 1);
|
||||
dis.put("material_id", row.get("material_id"));
|
||||
dis.put("pcsn", row.get("pcsn"));
|
||||
dis.put("storagevehicle_code", row.get("storagevehicle_code"));
|
||||
dis.put("work_status", "00");
|
||||
dis.put("is_issued", 0);
|
||||
dis.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
dis.put("qty_unit_name", row.get("qty_unit_name"));
|
||||
dis.put("plan_qty", row.get("plan_qty"));
|
||||
|
||||
ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class));
|
||||
}
|
||||
io_mst.put("total_qty", total_qty);
|
||||
ioStorInvMapper.insert(io_mst.toJavaObject(IOStorInv.class));
|
||||
return iostorinv_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
for (Long id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("iostorinv_id", String.valueOf(id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", now);
|
||||
|
||||
//暂时只软删除出入库单主表
|
||||
ioStorInvMapper.updateById(param.toJavaObject(IOStorInv.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Map whereJson) {
|
||||
String iostorinv_id = (String) whereJson.get("iostorinv_id");
|
||||
|
||||
IOStorInv ioStorInv = ioStorInvMapper.selectById(iostorinv_id);
|
||||
|
||||
if (!"10".equals(ioStorInv.getBill_status())) {
|
||||
throw new BadRequestException("主表状态必须为生成!");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
// whereJson.put("update_optid", currentUserId + "");
|
||||
// whereJson.put("update_optname", nickName);
|
||||
// whereJson.put("update_time", now);
|
||||
|
||||
JSONObject iostorinv_json = new JSONObject();
|
||||
iostorinv_json.put("iostorinv_id",iostorinv_id);
|
||||
iostorinv_json.put("stor_id",whereJson.get("stor_id"));
|
||||
iostorinv_json.put("stor_code",whereJson.get("stor_code"));
|
||||
iostorinv_json.put("stor_name",whereJson.get("stor_name"));
|
||||
iostorinv_json.put("total_qty",whereJson.get("total_qty"));
|
||||
iostorinv_json.put("detail_count",whereJson.get("detail_count"));
|
||||
iostorinv_json.put("biz_date",whereJson.get("biz_date"));
|
||||
iostorinv_json.put("bill_type",whereJson.get("bill_type"));
|
||||
iostorinv_json.put("remark",whereJson.get("remark"));
|
||||
iostorinv_json.put("update_optid",currentUserId);
|
||||
iostorinv_json.put("update_optname",nickName);
|
||||
iostorinv_json.put("update_time",now);
|
||||
// iostorinv_json.putAll(whereJson);
|
||||
ioStorInvMapper.updateById(iostorinv_json.toJavaObject(IOStorInv.class));
|
||||
|
||||
// wo.update(whereJson);
|
||||
//先删除该单据下的所有明细
|
||||
ioStorInvDtlMapper.delete(new LambdaQueryWrapper<>(IOStorInvDtl.class).eq(IOStorInvDtl::getIostorinv_id,iostorinv_id));
|
||||
|
||||
ioStorInvDisMapper.delete(new LambdaQueryWrapper<>(IOStorInvDis.class).eq(IOStorInvDis::getIostorinv_id,iostorinv_id));
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
|
||||
// for (int i = 0; i < rows.size(); i++) {
|
||||
// HashMap<String, String> row = rows.get(i);
|
||||
// row.put("iostorinvdtl_id", cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
// row.put("iostorinv_id", iostorinv_id);
|
||||
// row.put("seq_no", (i + 1) + "");
|
||||
// JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("product_name") + "'").uniqueResult(0);
|
||||
// if (ObjectUtil.isEmpty(material)) {
|
||||
// throw new BadRequestException("LMS系统不存在物料:【" + row.get("product_name") + "】,请确认物料是否正确,或SAP系统是否推送到LMS系统");
|
||||
// }
|
||||
// row.put("material_id", material.getString("material_id"));
|
||||
// row.put("pcsn", row.get("container_name"));
|
||||
// row.put("bill_status", "10");
|
||||
// row.put("quality_scode", "01");
|
||||
// row.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
// JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
// row.put("qty_unit_name", unit.getString("unit_name"));
|
||||
// row.put("assign_qty", row.get("net_weight"));
|
||||
// row.put("plan_qty", row.get("net_weight"));
|
||||
// String net_weight = row.get("net_weight");
|
||||
// row.put("box_no", row.get("package_box_sn"));
|
||||
//
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
|
||||
//
|
||||
// JSONObject dis = new JSONObject();
|
||||
// dis.put("iostorinvdis_id", cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
// dis.put("iostorinv_id", iostorinv_id);
|
||||
// dis.put("iostorinvdtl_id", row.get("iostorinvdtl_id"));
|
||||
// dis.put("seq_no", 1);
|
||||
// dis.put("material_id", row.get("material_id"));
|
||||
// dis.put("pcsn", row.get("pcsn"));
|
||||
// dis.put("box_no", row.get("box_no"));
|
||||
// dis.put("quality_scode", row.get("quality_scode"));
|
||||
// dis.put("work_status", "00");
|
||||
// dis.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
// dis.put("qty_unit_name", unit.getString("unit_name"));
|
||||
// dis.put("plan_qty", row.get("plan_qty"));
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDis").insert(dis);
|
||||
// }
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
HashMap<String, Object> row = rows.get(i);
|
||||
JSONObject ioStorInvDtl = new JSONObject();
|
||||
ioStorInvDtl.putAll(row);
|
||||
ioStorInvDtl.put("iostorinvdtl_id",IdUtil.getStringId());
|
||||
ioStorInvDtl.put("iostorinv_id",iostorinv_id);
|
||||
ioStorInvDtl.put("seq_no",(i + 1)+"");
|
||||
ioStorInvDtl.put("material_id",row.get("material_id"));
|
||||
ioStorInvDtl.put("Pcsn",row.get("pcsn"));
|
||||
ioStorInvDtl.put("bill_status","10");
|
||||
ioStorInvDtl.put("qty_unit_id",row.get("qty_unit_id"));
|
||||
ioStorInvDtl.put("qty_unit_name",row.get("qty_unit_name"));
|
||||
ioStorInvDtl.put("assign_qty",row.get("qty"));
|
||||
ioStorInvDtl.put("plan_qty",row.get("plan_qty"));
|
||||
// total_qty += Double.parseDouble(row.get("qty").toString());
|
||||
|
||||
//判断该木箱是否已经生成入库单
|
||||
//判断该载具是否已经分配货位或者起点
|
||||
// JSONArray now_dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "18").addParam("box_no", row.get("package_box_sn")).process().getResultJSONArray(0);
|
||||
// if (now_dis_rows.size() > 0) {
|
||||
// throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
|
||||
// }
|
||||
//判断该木箱是否已经存在库内
|
||||
// JSONObject str_jo = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + row.get("package_box_sn") + "'").uniqueResult(0);
|
||||
|
||||
//判断该载具编号是否已经存在库内
|
||||
Structattr structattr = iStructattrService.getOne(new LambdaQueryWrapper<>(Structattr.class).eq(Structattr::getStoragevehicle_code,row.get("storagevehicle_code")));
|
||||
if (ObjectUtil.isNotEmpty(structattr)) {
|
||||
throw new BadRequestException("载具编码:" + row.get("storagevehicle_code") + "已存在库内,请对数据进行核实!");
|
||||
}
|
||||
|
||||
ioStorInvDtlMapper.insert(ioStorInvDtl.toJavaObject(IOStorInvDtl.class));
|
||||
|
||||
JSONObject dis = new JSONObject();
|
||||
dis.put("iostorinvdis_id", IdUtil.getStringId());
|
||||
dis.put("iostorinv_id", iostorinv_id);
|
||||
dis.put("iostorinvdtl_id", ioStorInvDtl.getString("iostorinvdtl_id"));
|
||||
dis.put("seq_no", 1);
|
||||
dis.put("material_id", row.get("material_id"));
|
||||
dis.put("pcsn", row.get("pcsn"));
|
||||
dis.put("storagevehicle_code", row.get("storagevehicle_code"));
|
||||
dis.put("work_status", "00");
|
||||
dis.put("is_issued", 0);
|
||||
dis.put("qty_unit_id", row.get("qty_unit_id"));
|
||||
dis.put("qty_unit_name", row.get("qty_unit_name"));
|
||||
dis.put("plan_qty", row.get("plan_qty"));
|
||||
|
||||
ioStorInvDisMapper.insert(dis.toJavaObject(IOStorInvDis.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IOStorInvDtlDto> getIODtl(Map whereJson) {
|
||||
return ioStorInvMapper.getIODtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void divStruct(Map whereJson) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
String sect_id = "";
|
||||
String sect_code = "";
|
||||
String sect_name = "";
|
||||
String struct_id = "";
|
||||
String struct_code = "";
|
||||
String struct_name = "";
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableMater");
|
||||
JSONObject whereJson2 = JSONObject.parseObject(JSON.toJSONString(whereJson));
|
||||
HashMap<String, String> map = rows.get(0);
|
||||
|
||||
//判断该载具是否已经分配货位或者起点
|
||||
IOStorInvDis ioStorInvDis = ioStorInvDisMapper.selectOne(new LambdaQueryWrapper<>(IOStorInvDis.class)
|
||||
.eq(IOStorInvDis::getIostorinvdis_id,map.get("iostorinvdis_id"))
|
||||
.isNull(IOStorInvDis::getStruct_code));
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)){
|
||||
throw new BadRequestException("该明细已经分配过货位,无法继续分配!");
|
||||
}
|
||||
|
||||
String point_code = map.get("point_code");
|
||||
// if (StrUtil.isNotEmpty(point_code)) {
|
||||
// HashMap<String, String> point_map = new HashMap<>();
|
||||
// PointDto pointDto = pointService.findByCode(point_code);
|
||||
// point_map.put("point_code", pointDto.getPoint_code());
|
||||
// point_map.put("point_id", pointDto.getPoint_id() + "");
|
||||
// point_map.put("point_name", pointDto.getPoint_name());
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(point_map, "iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'");
|
||||
// }
|
||||
|
||||
Boolean checked = whereJson2.getBoolean("checked");
|
||||
//是否分配货位
|
||||
if (ObjectUtil.isNotEmpty(checked) && checked) {
|
||||
JSONObject jo_form = new JSONObject();
|
||||
Structattr struct = new Structattr();
|
||||
if (whereJson.containsKey("sect_id")) {
|
||||
jo_form.put("sect_id", whereJson.get("sect_id"));
|
||||
jo_form.put("storagevehicle_code", map.get("storagevehicle_code"));
|
||||
struct = this.autoDis(jo_form);
|
||||
} else {
|
||||
throw new BadRequestException("请选择需要分配的库区!");
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(struct)) {
|
||||
throw new BadRequestException("未查询到适用仓位!");
|
||||
}
|
||||
sect_id = struct.getSect_id();
|
||||
sect_code = struct.getSect_code();
|
||||
sect_name = struct.getSect_name();
|
||||
struct_id = struct.getStruct_id();
|
||||
struct_code = struct.getStruct_code();
|
||||
struct_name = struct.getStruct_name();
|
||||
} else {
|
||||
|
||||
Structattr structattr = iStructattrService.findById(map.get("struct_id"));
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
);
|
||||
//判断仓位的长高宽是否能放下载具
|
||||
if (structattr.getWidth().compareTo(mdPbStoragevehicleinfo.getVehicle_width()) <0 &&
|
||||
structattr.getHeight().compareTo(mdPbStoragevehicleinfo.getVehicle_height()) <0 &&
|
||||
structattr.getZdepth().compareTo(mdPbStoragevehicleinfo.getVehicle_long()) <0){
|
||||
throw new BadRequestException("载具不符合,请检查!");
|
||||
}
|
||||
// // 校验仓位是否满足此木箱高度
|
||||
// JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + map.get("box_no") + "'").uniqueResult(0);
|
||||
// double box_high = jsonSub.getDoubleValue("box_high");
|
||||
//
|
||||
// JSONObject jsonAttr = WQLObject.getWQLObject("st_ivt_structattr").query("struct_code = '" + map.get("struct_code") + "'").uniqueResult(0);
|
||||
//
|
||||
// // 入库木箱下限
|
||||
// String in_download_box_high = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("in_download_box_high").getValue();
|
||||
// // 入库木箱上线
|
||||
// String in_up_box_high = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("in_up_box_high").getValue();
|
||||
//
|
||||
// if (Double.parseDouble(in_download_box_high) < box_high && box_high <= Double.parseDouble(in_up_box_high)) {
|
||||
// if (StrUtil.equals(jsonAttr.getString("layer_num"), "3")) {
|
||||
// if (box_high > jsonAttr.getDoubleValue("height")) {
|
||||
// throw new BadRequestException("木箱高度不符,请检查!");
|
||||
// }
|
||||
// } else if (StrUtil.equals(jsonAttr.getString("layer_num"), "1")) {
|
||||
// if (box_high > Double.parseDouble(in_download_box_high)) {
|
||||
// throw new BadRequestException("木箱高度不符,请检查!");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (box_high > Double.parseDouble(in_up_box_high)) {
|
||||
// throw new BadRequestException("木箱高度不符,请检查!");
|
||||
// }
|
||||
|
||||
sect_id = map.get("sect_id");
|
||||
sect_code = map.get("sect_code");
|
||||
sect_name = map.get("sect_name");
|
||||
struct_id = map.get("struct_id");
|
||||
struct_code = map.get("struct_code");
|
||||
struct_name = map.get("struct_name");
|
||||
}
|
||||
HashMap<String, String> dis_map = new HashMap();
|
||||
dis_map.put("sect_id", sect_id);
|
||||
dis_map.put("sect_code", sect_code);
|
||||
dis_map.put("sect_name", sect_name);
|
||||
dis_map.put("struct_id", struct_id);
|
||||
dis_map.put("struct_code", struct_code);
|
||||
dis_map.put("struct_name", struct_name);
|
||||
|
||||
//锁定货位
|
||||
// JSONObject lock_map = new JSONObject();
|
||||
// lock_map.put("end_point", struct_code);
|
||||
// //查询主表信息
|
||||
// JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
// lock_map.put("inv_type", mst.get("bill_type"));
|
||||
// lock_map.put("inv_id", mst.get("iostorinv_id"));
|
||||
// lock_map.put("inv_code", mst.get("bill_code"));
|
||||
// inbillService.operatePoint("0", lock_map);
|
||||
//
|
||||
// //判断起点是否不为空
|
||||
// JSONObject ios_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").uniqueResult(0);
|
||||
//
|
||||
// JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id ='" + sect_id + "'").uniqueResult(0);
|
||||
// boolean is_virtual = false;
|
||||
// if ("09".equals(sect_jo.getString("sect_type_attr"))) {
|
||||
// is_virtual = true;
|
||||
// String task_id = cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
// dis_map.put("task_id", task_id);
|
||||
// dis_map.put("work_status", "01");
|
||||
// }
|
||||
// if (StrUtil.isNotEmpty(ios_dis.getString("point_id")) && !is_virtual) {
|
||||
// //创建任务并下发
|
||||
// InTask task = new InTask();
|
||||
// JSONObject task_form = new JSONObject();
|
||||
// task_form.put("task_type", "010501");
|
||||
// task_form.put("start_device_code", map.get("point_code"));
|
||||
// task_form.put("next_device_code", struct_code);
|
||||
// task_form.put("vehicle_code", map.get("box_no"));
|
||||
// task_form.put("storagevehicle_type", map.get("storagevehicle_type"));
|
||||
// String task_id = task.createTask(task_form);
|
||||
// // 下发
|
||||
// task.immediateNotifyAcs(task_id);
|
||||
// /* if (whereJson.containsKey("auto_issue")) {
|
||||
// }*/
|
||||
// dis_map.put("task_id", task_id);
|
||||
// dis_map.put("work_status", "01");
|
||||
// }
|
||||
//
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'");
|
||||
//
|
||||
// //修改库存
|
||||
// //直接取出入库分配表的库存
|
||||
// JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
|
||||
// JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
// for (int i = 0; i < dis_rows.size(); i++) {
|
||||
// JSONObject dis_jo = dis_rows.getJSONObject(i);
|
||||
// JSONObject i_form = new JSONObject();
|
||||
// i_form.put("struct_id", dis_jo.getString("struct_id"));
|
||||
// i_form.put("material_id", dis_jo.getString("material_id"));
|
||||
// i_form.put("pcsn", dis_jo.getString("pcsn"));
|
||||
// i_form.put("change_qty", dis_jo.getString("plan_qty"));
|
||||
// i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
// i_form.put("quality_scode", "01");
|
||||
// i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
// i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
// i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
// i_form.put("qty_unit_id", dis_jo.getString("qty_unit_id"));
|
||||
// i_form.put("qty_unit_name", dis_jo.getString("qty_unit_name"));
|
||||
// storPublicService.IOStor(i_form, "31");
|
||||
//
|
||||
// JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
// if (StrUtil.isNotEmpty(ios_dis.getString("point_id")) || is_virtual) {
|
||||
// if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
|
||||
// //判断该明细下是否还存在未分配货位的分配明细
|
||||
// JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
|
||||
// if (disdiv_rows.size() == 0) {
|
||||
// dtl_jo.put("bill_status", "40");
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
||||
// //判断主表下的明细是否都为40
|
||||
// JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '40'").getResultJSONArray(0);
|
||||
// if (dtl_rows.size() == 0) {
|
||||
// mst_jo.put("bill_status", "40");
|
||||
// mst_jo.put("dis_optid", currentUserId);
|
||||
// mst_jo.put("dis_optname", nickName);
|
||||
// mst_jo.put("dis_time", now);
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
// } else {
|
||||
// mst_jo.put("bill_status", "30");
|
||||
// mst_jo.put("dis_optid", currentUserId);
|
||||
// mst_jo.put("dis_optname", nickName);
|
||||
// mst_jo.put("dis_time", now);
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// dtl_jo.put("bill_status", "30");
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
||||
// mst_jo.put("bill_status", "30");
|
||||
// mst_jo.put("dis_optid", currentUserId);
|
||||
// mst_jo.put("dis_optname", nickName);
|
||||
// mst_jo.put("dis_time", now);
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
// }
|
||||
// }
|
||||
// //如果是虚拟区,直接更新完成分配任务
|
||||
// if (is_virtual) {
|
||||
// JSONObject dis_form = new JSONObject();
|
||||
// dis_form.put("task_id", dis_map.get("task_id"));
|
||||
// inbillService.confirmDis(dis_form);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allDivStruct(JSONObject form) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unDivStruct(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void divPoint(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTask(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delTask(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reIssueTask(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmTask(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirm(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backConfirm(Map whereJson) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IOStorInvDisDto> getDisDtl(Map whereJson) {
|
||||
//查询该明细下的所有入库分配载具明细
|
||||
String iostorinv_id = (String) whereJson.get("iostorinv_id");
|
||||
return ioStorInvDisMapper.queryInBillDisDtlByIosId(iostorinv_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryTask(Map whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Structattr autoDis(JSONObject whereJson) {
|
||||
String sect_id = whereJson.getString("sect_id");
|
||||
String storagevehicle_code = whereJson.getString("storagevehicle_code");
|
||||
// 过滤没有任务的仓位号
|
||||
List<Structattr> structattrList = iStructattrService.list(new LambdaQueryWrapper<>(Structattr.class)
|
||||
.eq(Structattr::getSect_id,sect_id)
|
||||
.eq(Structattr::getLock_type,"00")
|
||||
);
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = mdPbStoragevehicleinfoMapper.selectOne(new LambdaQueryWrapper<>(MdPbStoragevehicleinfo.class)
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code,storagevehicle_code)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(structattrList)){
|
||||
throw new BadRequestException("该库区没有仓位");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(mdPbStoragevehicleinfo)){
|
||||
throw new BadRequestException("没有该载具号信息");
|
||||
}
|
||||
// 过滤掉不满足载具长宽高的仓位
|
||||
Structattr structattr = structattrList.stream().filter(st ->
|
||||
st.getWidth().compareTo(mdPbStoragevehicleinfo.getVehicle_width()) <0 &&
|
||||
st.getHeight().compareTo(mdPbStoragevehicleinfo.getVehicle_height()) <0 &&
|
||||
st.getZdepth().compareTo(mdPbStoragevehicleinfo.getVehicle_long()) <0
|
||||
).findAny().get();
|
||||
|
||||
if (ObjectUtil.isEmpty(structattr)){
|
||||
throw new BadRequestException("未找到满足的仓位");
|
||||
}
|
||||
|
||||
return structattr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject autoDisMove(JSONObject whereJson) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user