add:备件入库
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package org.nl.wms.device_manage.ios.controller.iostorInv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/emBiIostorinv")
|
||||
public class EmBiIostorinvController {
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvService emBiIostorinvService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询原料入库单")
|
||||
//("查询原料入库单")
|
||||
public ResponseEntity<Object> query(EmIostorInvQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(emBiIostorinvService.pageQuery(query,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("创建入库单")
|
||||
//("创建入库单")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("修改入库单")
|
||||
//("修改入库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvService.updateBill(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Log("删除入库单")
|
||||
//("删除入库单")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
|
||||
emBiIostorinvService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getIODtl")
|
||||
@Log("查询入库分配明细")
|
||||
//("查询入库分配明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(emBiIostorinvService.getInvDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("强制确认")
|
||||
//("强制确认")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
emBiIostorinvService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.device_manage.ios.controller.structIvt;
|
||||
|
||||
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dto.StructIvtEmQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/emBiStructivt")
|
||||
public class EmBiStructivtController {
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtService emBiStructivtService;
|
||||
|
||||
@GetMapping("/getRawIvt")
|
||||
@Log("查询可用的原料库存")
|
||||
//("查询可用的原料库存")
|
||||
public ResponseEntity<Object> getRawIvt(StructIvtEmQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getRawIvt(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getProductIvt")
|
||||
@Log("查询可用的成品库存")
|
||||
//("查询可用的成品库存")
|
||||
public ResponseEntity<Object> getProductIvt(StructIvtEmQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getProductIvt(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getStructIvt")
|
||||
@Log("查询库存")
|
||||
//("查询库存")
|
||||
public ResponseEntity<Object> getStructIvt(StructIvtEmQuery query) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getStructIvt(query), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getSemiProductIvt")
|
||||
@Log("查询可用的半成品库存")
|
||||
//("查询可用的半成品库存")
|
||||
public ResponseEntity<Object> getSemiProductIvt(StructIvtEmQuery query) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getSemiProductIvt(query), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getAllRawIvt")
|
||||
@Log("查询原料库存")
|
||||
//("查询原料库存")
|
||||
public ResponseEntity<Object> getAllRawIvt(StructIvtEmQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtService.getAllRawIvt(query, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.device_manage.ios.controller.structIvt;
|
||||
|
||||
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtflowService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.IvtFlowQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/EmBiStructivtflow")
|
||||
public class EmBiStructivtflowController {
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtflowService emBiStructivtflowService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库存变动记录")
|
||||
//("查询库存变动记录")
|
||||
public ResponseEntity<Object> query(IvtFlowQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(emBiStructivtflowService.queryAll(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvService extends IService<EmBiostorinv> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query,page /
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object pageQuery(EmIostorInvQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param form /
|
||||
*/
|
||||
void create(JSONObject form);
|
||||
|
||||
/**
|
||||
* 修改单据
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateBill(JSONObject form);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* {
|
||||
* 主表id..
|
||||
* }
|
||||
*/
|
||||
void delete(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取分配明细
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<Map> getInvDtl(JSONObject form);
|
||||
|
||||
/**
|
||||
* 强制确认
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
void confirm(JSONObject form);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdis;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvdisService extends IService<EmBiIostorinvdis> {
|
||||
/**
|
||||
* 主单据使用
|
||||
*
|
||||
* @param row
|
||||
* @param mst_jo
|
||||
* @return
|
||||
*/
|
||||
void create(JSONObject row, JSONObject mst_jo);
|
||||
|
||||
/**
|
||||
* 根据主表删除明细
|
||||
*
|
||||
* @param mst_id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String mst_id);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.device_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.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvdtlService extends IService<EmBiIostorinvdtl> {
|
||||
|
||||
/**
|
||||
* 主单据使用
|
||||
* @param row
|
||||
* @param iostorinvCp_id
|
||||
* @return
|
||||
*/
|
||||
double create(JSONArray row, String iostorinvCp_id,String io_type);
|
||||
|
||||
List<Map> getDtlList(JSONObject json);
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_iostorinvdis")
|
||||
public class EmBiIostorinvdis implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单分配标识
|
||||
*/
|
||||
@TableId(value = "iostorinvdis_id")
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private Integer 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 ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 任务执行状态
|
||||
*/
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 存储载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
private Boolean is_issued;
|
||||
|
||||
/**
|
||||
* 出入点位标识
|
||||
*/
|
||||
private String point_id;
|
||||
|
||||
/**
|
||||
* 出入点位编码
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
/**
|
||||
* 出入点位名称
|
||||
*/
|
||||
private String point_name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单明细表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_iostorinvdtl")
|
||||
public class EmBiIostorinvdtl implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
@TableId(value = "iostorinvdtl_id")
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private Integer seq_no;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 库存等级
|
||||
*/
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 单据明细状态
|
||||
*/
|
||||
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 remark_ext;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_iostorinv")
|
||||
public class EmBiostorinv implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
@TableId(value = "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 Integer detail_count;
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 分配人
|
||||
*/
|
||||
private String dis_id;
|
||||
|
||||
/**
|
||||
* 分配人姓名
|
||||
*/
|
||||
private String dis_name;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private String dis_time;
|
||||
|
||||
/**
|
||||
* 确认人
|
||||
*/
|
||||
private String confirm_id;
|
||||
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String confirm_name;
|
||||
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String sysdeptid;
|
||||
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private String syscompanyid;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean is_delete;
|
||||
|
||||
/**
|
||||
* 是否已上传
|
||||
*/
|
||||
private Boolean is_upload;
|
||||
|
||||
/**
|
||||
* 回传人
|
||||
*/
|
||||
private String upload_id;
|
||||
|
||||
/**
|
||||
* 回传人姓名
|
||||
*/
|
||||
private String uploa_name;
|
||||
|
||||
/**
|
||||
* 回传时间
|
||||
*/
|
||||
private String upload_time;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private String workshop_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvMapper extends BaseMapper<EmBiostorinv> {
|
||||
|
||||
List<Map> getMstDetail(@Param("query") EmIostorInvQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdis;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvdisMapper extends BaseMapper<EmBiIostorinvdis> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiIostorinvdtlMapper extends BaseMapper<EmBiIostorinvdtl> {
|
||||
|
||||
List<Map> getIostorinvdtl(Map query);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvMapper">
|
||||
|
||||
<select id="getMstDetail" resultType="java.util.Map">
|
||||
SELECT DISTINCT
|
||||
mst.iostorinv_id,
|
||||
mst.bill_code,
|
||||
mst.io_type,
|
||||
mst.buss_type,
|
||||
mst.bill_type,
|
||||
mst.biz_date,
|
||||
mst.stor_id,
|
||||
mst.stor_code,
|
||||
mst.stor_name,
|
||||
mst.source_id,
|
||||
mst.source_name,
|
||||
mst.source_type,
|
||||
mst.total_qty,
|
||||
mst.detail_count,
|
||||
mst.bill_status,
|
||||
mst.remark,
|
||||
mst.create_id,
|
||||
mst.create_name,
|
||||
DATE_FORMAT( mst.create_time,'%Y-%m-%d %H:%i:%s') AS create_time,
|
||||
mst.update_id,
|
||||
mst.update_name,
|
||||
DATE_FORMAT( mst.update_time,'%Y-%m-%d %H:%i:%s') AS update_time,
|
||||
mst.confirm_id,
|
||||
mst.confirm_name,
|
||||
DATE_FORMAT( mst.confirm_time,'%Y-%m-%d %H:%i:%s') AS confirm_time,
|
||||
dis.struct_id,
|
||||
dis.sect_id,
|
||||
dis.struct_code,
|
||||
mst.workshop_id
|
||||
FROM
|
||||
em_bi_iostorinv mst
|
||||
LEFT JOIN em_bi_iostorinvdis dis ON dis.iostorinv_id = mst.iostorinv_id
|
||||
<where>
|
||||
mst.is_delete = '0'
|
||||
AND
|
||||
io_type = '0'
|
||||
<if test="query.start_time != null">
|
||||
and mst.create_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time != null">
|
||||
and #{query.end_time} >= mst.create_time
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and mst.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
<if test="query.bill_status != null and query.bill_status != ''">
|
||||
and mst.bill_status = #{query.bill_status}
|
||||
</if>
|
||||
<if test="query.bill_type != null and query.bill_type != ''">
|
||||
and mst.bill_type = #{query.bill_type}
|
||||
</if>
|
||||
<if test="query.bill_code != null and query.bill_code != ''">
|
||||
and mst.bill_code = #{query.bill_code}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by create_time DESC
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvdisMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvdtlMapper">
|
||||
|
||||
<select id="getIostorinvdtl" resultType="java.util.Map">
|
||||
SELECT
|
||||
dtl.*,
|
||||
mb.material_code,
|
||||
mb.material_name
|
||||
FROM
|
||||
em_bi_iostorinvdtl dtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
<where>
|
||||
<if test="bill_code != null and bill_code != ''">
|
||||
and dtl.bill_code = #{bill_code}
|
||||
</if>
|
||||
<if test="iostorinv_id != null and iostorinv_id != ''">
|
||||
and dtl.iostorinv_id = #{iostorinv_id}
|
||||
</if>
|
||||
</where>
|
||||
order by dtl.seq_no ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class EmIostorInvQuery extends BaseQuery<EmBiostorinv> {
|
||||
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private String bill_status;
|
||||
|
||||
private String bill_type;
|
||||
|
||||
private String bill_code;
|
||||
|
||||
private String io_type;
|
||||
|
||||
private Boolean is_delete = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("bill_code", QParam.builder().k(new String[]{"bill_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
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 com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdisService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdtlService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdis;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdtl;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiostorinv;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvMapper;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dto.EmIostorInvQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtflowService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单主表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiIostorinvServiceImpl extends ServiceImpl<EmBiIostorinvMapper, EmBiostorinv> implements EmBiIostorinvService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService stIvtBsrealstorattrService; // 实物属性服务
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvdtlService emBiIostorinvdtlService; // 明细服务
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvdisService emBiIostorinvdisService; // 分配服务
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtService emBiStructivtService; // 库存服务
|
||||
|
||||
@Autowired
|
||||
private EmBiStructivtflowService emBiStructivtflowService; //仓位变动服务
|
||||
|
||||
|
||||
@Override
|
||||
public Object pageQuery(EmIostorInvQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getMstDetail(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(JSONObject form) {
|
||||
JSONArray rows = form.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
|
||||
// 调用主表 插入/更新方法
|
||||
EmBiostorinv emBiostorinv = packageMstForm(new EmBiostorinv(), form, false);
|
||||
// 插入主表
|
||||
this.save(emBiostorinv);
|
||||
|
||||
// 调用明细表 插入/更新方法
|
||||
emBiIostorinvdtlService.create(rows, emBiostorinv.getIostorinv_id(), emBiostorinv.getIo_type());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateBill(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||
EmBiostorinv mst = form.toJavaObject(EmBiostorinv.class);
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(DateUtil.now());
|
||||
this.updateById(mst);
|
||||
|
||||
JSONArray rows = form.getJSONArray("tableData");
|
||||
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||
// 调用明细表 插入/更新方法
|
||||
emBiIostorinvdtlService.create(rows, form.getString("iostorinv_id"), mst.getIo_type());
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long[] ids) {
|
||||
|
||||
for (Long id : ids) {
|
||||
EmBiostorinv dao = this.getOne(new QueryWrapper<EmBiostorinv>().eq("iostorinv_id", id));
|
||||
dao.setIs_delete(true);
|
||||
|
||||
this.updateById(dao);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getInvDtl(JSONObject form) {
|
||||
return emBiIostorinvdtlService.getDtlList(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackOn = Exception.class)
|
||||
public void confirm(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||
|
||||
String iostorinv_id = form.getString("iostorinv_id");
|
||||
|
||||
EmBiostorinv mst = this.getById(iostorinv_id);
|
||||
|
||||
List<EmBiIostorinvdis> dis_list = emBiIostorinvdisService.list(new QueryWrapper<EmBiIostorinvdis>().eq("iostorinv_id", iostorinv_id));
|
||||
List<EmBiIostorinvdtl> dtl_list = emBiIostorinvdtlService.list(new QueryWrapper<EmBiIostorinvdtl>().eq("iostorinv_id", iostorinv_id));
|
||||
|
||||
if (ObjectUtil.isEmpty(dis_list)) {
|
||||
throw new BadRequestException("该入库单不存在分配明细!");
|
||||
}
|
||||
|
||||
if (mst == null || mst.getIs_delete() == true) {
|
||||
throw new BadRequestException("单据不存在");
|
||||
}
|
||||
|
||||
//修改分配状态
|
||||
dis_list.forEach(dis -> {
|
||||
dis.setReal_qty(dis.getPlan_qty());
|
||||
dis.setWork_status(IOSEnum.WORK_STATUS.code("完成"));
|
||||
emBiIostorinvdisService.updateById(dis);
|
||||
|
||||
//修改库存
|
||||
|
||||
//判断该货位和物料上是否存在
|
||||
EmBiStructivt structivtYl = emBiStructivtService.getOne(new QueryWrapper<EmBiStructivt>().eq("struct_code", dis.getStruct_code()).eq("material_id", dis.getMaterial_id()));
|
||||
if (ObjectUtil.isNotEmpty(structivtYl)) {
|
||||
structivtYl.setCanuse_qty(NumberUtil.add(structivtYl.getCanuse_qty(), dis.getPlan_qty()));
|
||||
structivtYl.setIvt_qty(structivtYl.getCanuse_qty());
|
||||
emBiStructivtService.updateById(structivtYl);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(structivtYl));
|
||||
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("change_qty",dis.getPlan_qty());
|
||||
param.put("result_qty", structivtYl.getCanuse_qty());
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
emBiStructivtflowService.insetIvtChange(param);
|
||||
} else {
|
||||
EmBiStructivt ivtDao = EmBiStructivt.builder()
|
||||
.stockrecord_id(IdUtil.getStringId())
|
||||
.struct_id(dis.getStruct_id())
|
||||
.struct_code(dis.getStruct_code())
|
||||
.struct_name(dis.getStruct_name())
|
||||
.material_id(dis.getMaterial_id())
|
||||
.quality_scode(dis.getQuality_scode())
|
||||
.pcsn(dis.getPcsn())
|
||||
.ivt_level(dis.getIvt_level())
|
||||
.is_active(dis.getIs_active())
|
||||
.canuse_qty(dis.getReal_qty())
|
||||
.ivt_qty(dis.getReal_qty())
|
||||
.qty_unit_id(dis.getQty_unit_id())
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.workshop_id(mst.getWorkshop_id())
|
||||
.build();
|
||||
emBiStructivtService.save(ivtDao);
|
||||
|
||||
// 插入库存变动记录
|
||||
JSONObject param = JSONObject.parseObject(JSON.toJSONString(ivtDao));
|
||||
param.put("change_type", ChangeIvtUtil.SUBWAREHOUSING_ADDIVT_QTY);
|
||||
param.put("change_qty",dis.getPlan_qty());
|
||||
param.put("result_qty", dis.getPlan_qty());
|
||||
param.put("bill_code",mst.getBill_code());
|
||||
param.put("inv_id",mst.getIostorinv_id());
|
||||
param.put("bill_type_scode",mst.getBill_type());
|
||||
emBiStructivtflowService.insetIvtChange(param);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//修改明细状态
|
||||
dtl_list.forEach(dtl -> {
|
||||
dtl.setReal_qty(dtl.getPlan_qty());
|
||||
dtl.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
emBiIostorinvdtlService.updateById(dtl);
|
||||
});
|
||||
|
||||
//修改主表
|
||||
mst.setConfirm_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setConfirm_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setConfirm_time(DateUtil.now());
|
||||
mst.setDis_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setDis_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setDis_time(DateUtil.now());
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
this.updateById(mst);
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private EmBiostorinv packageMstForm(EmBiostorinv stIvtIostorinvYl, JSONObject whereJson, Boolean isUpdate) {
|
||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
if (!isUpdate) {
|
||||
// 新增
|
||||
stIvtIostorinvYl.setIostorinv_id(IdUtil.getStringId());
|
||||
stIvtIostorinvYl.setBill_code(CodeUtil.getNewCode("IO_CODE"));
|
||||
stIvtIostorinvYl.setIo_type(IOSEnum.IO_TYPE.code("入库"));
|
||||
stIvtIostorinvYl.setBuss_type(whereJson.getString("bill_type"));
|
||||
stIvtIostorinvYl.setBill_type(stIvtIostorinvYl.getBuss_type());
|
||||
stIvtIostorinvYl.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
stIvtIostorinvYl.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setCreate_time(DateUtil.now());
|
||||
stIvtIostorinvYl.setIs_delete(false);
|
||||
stIvtIostorinvYl.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setUpdate_time(DateUtil.now());
|
||||
// TODO 暂时写死
|
||||
stIvtIostorinvYl.setSysdeptid("111");
|
||||
stIvtIostorinvYl.setSyscompanyid("111");
|
||||
|
||||
} else {
|
||||
// 修改
|
||||
stIvtIostorinvYl.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
stIvtIostorinvYl.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
stIvtIostorinvYl.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
stIvtIostorinvYl.setBiz_date(whereJson.getString("biz_date").substring(0, 10));
|
||||
// 获取仓库信息
|
||||
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("stor_id", whereJson.getString("stor_id"));
|
||||
wrapper.eq("is_used", true);
|
||||
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
|
||||
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
|
||||
|
||||
stIvtIostorinvYl.setStor_id(bsrealDao.getStor_id());
|
||||
stIvtIostorinvYl.setStor_code(bsrealDao.getStor_code());
|
||||
stIvtIostorinvYl.setStor_name(bsrealDao.getStor_name());
|
||||
stIvtIostorinvYl.setTotal_qty(whereJson.getBigDecimal("total_qty"));
|
||||
stIvtIostorinvYl.setDetail_count(rows.size());
|
||||
stIvtIostorinvYl.setRemark(whereJson.getString("remark"));
|
||||
stIvtIostorinvYl.setWorkshop_id(whereJson.getString("workshop_id"));
|
||||
|
||||
return stIvtIostorinvYl;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdisService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdis;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvdisMapper;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiIostorinvdisServiceImpl extends ServiceImpl<EmBiIostorinvdisMapper, EmBiIostorinvdis> implements EmBiIostorinvdisService {
|
||||
|
||||
@Autowired
|
||||
private IStIvtSectattrService sectattrService; // 库区服务
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService; // 仓位属性服务
|
||||
|
||||
@Override
|
||||
public void create(JSONObject jo, JSONObject mst_jo) {
|
||||
if (ObjectUtil.isNotEmpty(mst_jo)) {
|
||||
|
||||
String mst_id = mst_jo.getString("mst_id");
|
||||
String dtl_id = mst_jo.getString("dtl_id");
|
||||
String iostorinvdisYl_id = IdUtil.getStringId();
|
||||
EmBiIostorinvdis row = jo.toJavaObject(EmBiIostorinvdis.class);
|
||||
row.setIostorinv_id(mst_id);
|
||||
row.setIostorinvdtl_id(dtl_id);
|
||||
row.setIostorinvdtl_id(dtl_id);
|
||||
row.setIostorinvdis_id(iostorinvdisYl_id);
|
||||
List<EmBiIostorinvdis> list = this.list(new QueryWrapper<EmBiIostorinvdis>().eq("iostorinvdtl_id", dtl_id));
|
||||
row.setSeq_no(list.size() + 1);
|
||||
row.setIs_active(true);
|
||||
row.setWork_status(IOSEnum.WORK_STATUS.code("未生成"));
|
||||
row.setPlan_qty(row.getPlan_qty());
|
||||
|
||||
// 获取库区信息
|
||||
QueryWrapper<StIvtSectattr> sect_wrapper = new QueryWrapper<>();
|
||||
sect_wrapper.eq("sect_id", row.getSect_id());
|
||||
sect_wrapper.eq("is_used", true);
|
||||
StIvtSectattr sectDao = sectattrService.getOne(sect_wrapper);
|
||||
if (ObjectUtil.isEmpty(sectDao)) throw new BadRequestException("库区不存在或未启用!");
|
||||
|
||||
row.setSect_code(sectDao.getSect_code());
|
||||
row.setSect_name(sectDao.getSect_name());
|
||||
// 获取仓位信息
|
||||
QueryWrapper<StIvtStructattr> struct_wrapper = new QueryWrapper<>();
|
||||
struct_wrapper.eq("struct_id", row.getStruct_id());
|
||||
struct_wrapper.eq("is_used", true);
|
||||
StIvtStructattr structDao = structattrService.getOne(struct_wrapper);
|
||||
if (ObjectUtil.isEmpty(structDao)) throw new BadRequestException("仓位不存在或未启用!");
|
||||
|
||||
row.setStruct_code(structDao.getStruct_code());
|
||||
row.setStruct_name(structDao.getStruct_name());
|
||||
row.setPcsn(DateUtil.today());
|
||||
this.save(row);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String mst_id) {
|
||||
this.remove(new QueryWrapper<EmBiIostorinvdis>().eq("iostorinv_id", mst_id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.nl.wms.device_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.EmBiIostorinvdtlService;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.EmBiIostorinvdtl;
|
||||
import org.nl.wms.device_manage.ios.service.iostorInv.dao.mapper.EmBiIostorinvdtlMapper;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单明细表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiIostorinvdtlServiceImpl extends ServiceImpl<EmBiIostorinvdtlMapper, EmBiIostorinvdtl> implements EmBiIostorinvdtlService {
|
||||
|
||||
@Autowired
|
||||
private EmBiIostorinvdisServiceImpl emBiIostorinvdisService; // 分配服务
|
||||
|
||||
@Override
|
||||
public double create(JSONArray rows, String iostorinvYl_id, String io_type) {
|
||||
double total_qty = 0;
|
||||
|
||||
if (rows.size() > 0 && StringUtils.isNotEmpty(iostorinvYl_id)) {
|
||||
// 先删除在插入
|
||||
this.remove(new QueryWrapper<EmBiIostorinvdtl>().eq("iostorinv_id", iostorinvYl_id));
|
||||
if (io_type.equals(IOSEnum.IO_TYPE.code("入库"))) {
|
||||
//删除分配记录
|
||||
emBiIostorinvdisService.deleteById(iostorinvYl_id);
|
||||
}
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
String iostorinvdtlYl_id = IdUtil.getStringId();
|
||||
EmBiIostorinvdtl row = rows.getJSONObject(i).toJavaObject(EmBiIostorinvdtl.class);
|
||||
row.setIostorinv_id(iostorinvYl_id);
|
||||
row.setIostorinvdtl_id(iostorinvdtlYl_id);
|
||||
row.setSeq_no(i + 1);
|
||||
row.setIs_active(true);
|
||||
row.setPcsn(DateUtil.today());
|
||||
row.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
row.setUnassign_qty(row.getPlan_qty());
|
||||
this.save(row);
|
||||
total_qty += row.getPlan_qty().doubleValue();
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
mst_jo.put("mst_id", iostorinvYl_id);
|
||||
mst_jo.put("dtl_id", iostorinvdtlYl_id);
|
||||
if (io_type.equals(IOSEnum.IO_TYPE.code("入库"))) {
|
||||
emBiIostorinvdisService.create(rows.getJSONObject(i), mst_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return total_qty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getDtlList(JSONObject form) {
|
||||
if (ObjectUtil.isEmpty(form) || (StrUtil.isEmpty(form.getString("iostorinv_id")) && StrUtil.isEmpty(form.getString("bill_code")))) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.getIostorinvdtl(form);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dto.StructIvtEmQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiStructivtService extends IService<EmBiStructivt> {
|
||||
|
||||
/**
|
||||
* 分页查询可用的原料库存
|
||||
*
|
||||
* @param query,page /
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object getRawIvt(StructIvtEmQuery query, PageQuery page);
|
||||
Object getAllRawIvt(StructIvtEmQuery query, PageQuery page);
|
||||
|
||||
List<Map> getStructIvt(StructIvtEmQuery query);
|
||||
|
||||
/**
|
||||
* 分页查询可用的成品库存
|
||||
*
|
||||
* @param query /
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object getProductIvt(StructIvtEmQuery query, PageQuery page);
|
||||
|
||||
|
||||
Object getSemiProductIvt(StructIvtEmQuery query);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivtflow;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.IvtFlowQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiStructivtflowService extends IService<EmBiStructivtflow> {
|
||||
|
||||
void insetIvtChange(JSONObject json);
|
||||
|
||||
Object queryAll(IvtFlowQuery query, PageQuery page);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.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-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_structivt")
|
||||
@Builder
|
||||
public class EmBiStructivt implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 库存记录标识
|
||||
*/
|
||||
@TableId(value = "stockrecord_id")
|
||||
private String stockrecord_id;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 库存等级
|
||||
*/
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 可用数
|
||||
*/
|
||||
private BigDecimal canuse_qty;
|
||||
|
||||
/**
|
||||
* 冻结数
|
||||
*/
|
||||
private BigDecimal frozen_qty;
|
||||
|
||||
/**
|
||||
* 库存数
|
||||
*/
|
||||
private BigDecimal ivt_qty;
|
||||
|
||||
/**
|
||||
* 待入数
|
||||
*/
|
||||
private BigDecimal warehousing_qty;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private String workshop_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("em_bi_structivtflow")
|
||||
public class EmBiStructivtflow implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 记录标识
|
||||
*/
|
||||
private String change_id;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 库存等级
|
||||
*/
|
||||
private String ivt_level;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean is_active;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String bill_type_scode;
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String inv_id;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 单据表名
|
||||
*/
|
||||
private String bill_table;
|
||||
|
||||
/**
|
||||
* 变动类型
|
||||
*/
|
||||
private String change_type_scode;
|
||||
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private String change_time;
|
||||
|
||||
/**
|
||||
* 变动人
|
||||
*/
|
||||
private String change_person_id;
|
||||
|
||||
/**
|
||||
* 变动人姓名
|
||||
*/
|
||||
private String change_person_name;
|
||||
|
||||
/**
|
||||
* 变动数
|
||||
*/
|
||||
private BigDecimal change_qty;
|
||||
|
||||
/**
|
||||
* 结存数
|
||||
*/
|
||||
private BigDecimal result_qty;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dto.StructIvtEmQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiStructivtMapper extends BaseMapper<EmBiStructivt> {
|
||||
|
||||
List<Map> getRawIvt(@Param("query") StructIvtEmQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
List<Map> getAllRawIvt(@Param("query") StructIvtEmQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
List<Map> getProductIvt(@Param("query") StructIvtEmQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
List<Map> getSemiProductIvt(@Param("query") StructIvtEmQuery query);
|
||||
|
||||
List<Map> getStructIvt(@Param("query") StructIvtEmQuery query);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivtflow;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.IvtFlowQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface EmBiStructivtflowMapper extends BaseMapper<EmBiStructivtflow> {
|
||||
|
||||
List<Map> queryAll(@Param("query") IvtFlowQuery query);
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
<?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.device_manage.ios.service.structIvt.dao.mapper.EmBiStructivtMapper">
|
||||
|
||||
<select id="getRawIvt" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
class.class_name
|
||||
FROM
|
||||
em_bi_structivt ivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
<where>
|
||||
ivt.canuse_qty > 0
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code like '%${query.material_search}%' OR mb.material_name like '%${query.material_search}%')
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.struct_id = #{query.struct_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAllRawIvt" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
sa.stor_name,
|
||||
class.class_name
|
||||
FROM
|
||||
em_bi_structivt ivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
<where>
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code like '%${query.material_search}%' OR mb.material_name like '%${query.material_search}%')
|
||||
</if>
|
||||
<if test="query.struct_search != null and query.struct_search != ''">
|
||||
and (sa.struct_code like '%${query.struct_search}%' OR sa.struct_name like '%${query.struct_search}%')
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getProductIvt" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
sa.storagevehicle_code,
|
||||
class.class_name
|
||||
FROM
|
||||
st_ivt_structivt_cp ivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
<where>
|
||||
ivt.canuse_qty > 0
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.struct_id = #{query.struct_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSemiProductIvt" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
sa.storagevehicle_code,
|
||||
class.class_name
|
||||
FROM
|
||||
st_ivt_structivt_bcp ivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
<where>
|
||||
ivt.canuse_qty > 0
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.struct_id = #{query.struct_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getStructIvt" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mu.unit_name AS qty_unit_name,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
sa.sect_id,
|
||||
sa.sect_code,
|
||||
sa.sect_name,
|
||||
sa.struct_id,
|
||||
sa.struct_code,
|
||||
sa.struct_name,
|
||||
class.class_name
|
||||
FROM
|
||||
em_bi_structivt ivt
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr sa ON sa.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt.qty_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
<where>
|
||||
ivt.canuse_qty > 0
|
||||
AND
|
||||
sa.lock_type = '0'
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
and (mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
</if>
|
||||
<if test="query.sect_id != null and query.sect_id != ''">
|
||||
and sa.sect_id = #{query.sect_id}
|
||||
</if>
|
||||
<if test="query.struct_id != null and query.struct_id != ''">
|
||||
and sa.struct_id = #{query.struct_id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.device_manage.ios.service.structIvt.dao.mapper.EmBiStructivtflowMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
ivt.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
attr.stor_name,
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
unit.unit_name
|
||||
FROM
|
||||
em_bi_structivtflow ivt
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||
<where>
|
||||
1 = 1
|
||||
<if test="query.struct_code != null and query.struct_code != ''">
|
||||
and (ivt.struct_code LIKE '%${query.struct_code}%' or
|
||||
ivt.struct_name LIKE '%${query.struct_code}%' )
|
||||
</if>
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
and (mater.material_code LIKE '%${query.material_code}%' or
|
||||
mater.material_name LIKE '%${query.material_code}%' or
|
||||
mater.material_spec LIKE '%${query.material_code}%'
|
||||
)
|
||||
</if>
|
||||
<if test="query.bill_code != null and query.bill_code != ''">
|
||||
and ivt.bill_code LIKE '%${query.bill_code}%'
|
||||
</if>
|
||||
<if test="query.change_type_scode != null and query.change_type_scode != ''">
|
||||
and ivt.change_type_scode = #{query.change_type_scode}
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and ivt.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
</where>
|
||||
order by ivt.change_time desc,ivt.struct_code ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class StructIvtEmQuery extends BaseQuery<EmBiStructivt> {
|
||||
|
||||
|
||||
private String sect_id;
|
||||
|
||||
private String struct_id;
|
||||
|
||||
private String material_search;
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private String struct_search;
|
||||
|
||||
private Boolean is_delete = false;
|
||||
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("material_search", QParam.builder().k(new String[]{"material_search"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivt;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.mapper.EmBiStructivtMapper;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dto.StructIvtEmQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiStructivtServiceImpl extends ServiceImpl<EmBiStructivtMapper, EmBiStructivt> implements EmBiStructivtService {
|
||||
|
||||
@Override
|
||||
public Object getRawIvt(StructIvtEmQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getRawIvt(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
@Override
|
||||
public Object getAllRawIvt(StructIvtEmQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getAllRawIvt(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getStructIvt(StructIvtEmQuery query) {
|
||||
return this.baseMapper.getStructIvt(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getProductIvt(StructIvtEmQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
List<Map> mst_detail = this.baseMapper.getProductIvt(query, pageQuery);
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSemiProductIvt(StructIvtEmQuery query) {
|
||||
return this.baseMapper.getSemiProductIvt(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.nl.wms.device_manage.ios.service.structIvt.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.EmBiStructivtflowService;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.EmBiStructivtflow;
|
||||
import org.nl.wms.device_manage.ios.service.structIvt.dao.mapper.EmBiStructivtflowMapper;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.IvtFlowQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存变动记录表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Service
|
||||
public class EmBiStructivtflowServiceImpl extends ServiceImpl<EmBiStructivtflowMapper, EmBiStructivtflow> implements EmBiStructivtflowService {
|
||||
|
||||
@Autowired
|
||||
protected IStIvtStructattrService iStIvtStructattrService; // 仓位属性服务
|
||||
|
||||
@Override
|
||||
public void insetIvtChange(JSONObject json) {
|
||||
|
||||
StIvtStructattr ivtDao = iStIvtStructattrService.getById(json.getString("struct_id"));
|
||||
|
||||
EmBiStructivtflow dao = new EmBiStructivtflow();
|
||||
dao.setChange_id(IdUtil.getStringId());
|
||||
dao.setStruct_id(json.getString("struct_id"));
|
||||
dao.setStruct_code(json.getString("struct_code"));
|
||||
dao.setStruct_name(json.getString("struct_name"));
|
||||
dao.setMaterial_id(json.getString("material_id"));
|
||||
dao.setQuality_scode(json.getString("quality_scode"));
|
||||
dao.setIvt_level(json.getString("ivt_level"));
|
||||
dao.setIs_active(json.getBoolean("is_active"));
|
||||
dao.setPcsn(json.getString("pcsn"));
|
||||
dao.setStor_id(ivtDao.getStor_id());
|
||||
dao.setChange_type_scode(json.getString("change_type"));
|
||||
dao.setChange_time(DateUtil.now());
|
||||
dao.setChange_person_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setChange_person_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setChange_qty(json.getBigDecimal("change_qty"));
|
||||
dao.setResult_qty(json.getBigDecimal("result_qty"));
|
||||
dao.setQty_unit_id(json.getString("qty_unit_id"));
|
||||
dao.setProduct_area(json.getString("workshop_id"));
|
||||
dao.setBill_code(json.getString("bill_code"));
|
||||
dao.setBill_type_scode(json.getString("bill_type_scode"));
|
||||
dao.setInv_id(json.getString("inv_id"));
|
||||
this.save(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object queryAll(IvtFlowQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
TableDataInfo build = TableDataInfo.build(this.baseMapper.queryAll(query));
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="org.nl.wms.storage_manage.rawmanage.service.iostorInv.dao.mapper.StIvtIostorinvYlMapper">
|
||||
|
||||
<select id="getMstDetail" resultType="java.util.Map">
|
||||
SELECT
|
||||
SELECT DISTINCT
|
||||
mst.iostorinv_id,
|
||||
mst.bill_code,
|
||||
mst.io_type,
|
||||
@@ -59,7 +59,7 @@
|
||||
</if>
|
||||
</where>
|
||||
|
||||
order by mst.create_time DESC
|
||||
order by create_time DESC
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -156,7 +156,7 @@ public class StIvtIostorinvYlServiceImpl extends ServiceImpl<StIvtIostorinvYlMap
|
||||
//修改库存
|
||||
|
||||
//判断该货位和物料上是否存在
|
||||
StIvtStructivtYl structivtYl = structivtYlService.getOne(new QueryWrapper<StIvtStructivtYl>().eq("struct_code", dis.getSect_code()).eq("material_id", dis.getMaterial_id()));
|
||||
StIvtStructivtYl structivtYl = structivtYlService.getOne(new QueryWrapper<StIvtStructivtYl>().eq("struct_code", dis.getStruct_code()).eq("material_id", dis.getMaterial_id()));
|
||||
if (ObjectUtil.isNotEmpty(structivtYl)) {
|
||||
structivtYl.setCanuse_qty(NumberUtil.add(structivtYl.getCanuse_qty(), dis.getPlan_qty()));
|
||||
structivtYl.setIvt_qty(structivtYl.getCanuse_qty());
|
||||
|
||||
Reference in New Issue
Block a user