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());
|
||||
|
||||
488
mes/qd/src/views/wms/device_manage/ios/embiin/AddDialog.vue
Normal file
488
mes/qd/src/views/wms/device_manage/ios/embiin/AddDialog.vue
Normal file
@@ -0,0 +1,488 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:loading="crud.cu === 2"
|
||||
type="primary"
|
||||
@click="crud.submitCU"
|
||||
>保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form
|
||||
ref="form"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
size="mini"
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker
|
||||
v-model="form.biz_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 210px"
|
||||
align="center"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bill_type">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_RAW_IN_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓库</label>
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
:disabled="crud.status.view > 0"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间" prop="workshop_id">
|
||||
<label slot="label">车间</label>
|
||||
<el-select
|
||||
v-model="form.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓位" prop="struct_id">
|
||||
<label slot="label">仓位:</label>
|
||||
<el-cascader
|
||||
v-model="form.struct_id"
|
||||
placeholder="请选择"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-input-number
|
||||
v-model.number="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
style="width: 380px;"
|
||||
rows="2"
|
||||
type="textarea"
|
||||
:disabled="crud.status.view > 0"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent()"
|
||||
>
|
||||
添加备件
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="备件编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="备件名称" />
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="入库数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model.number="form.tableData[scope.$index].plan_qty"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
@change="changeQty"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="form.tableData[scope.$index].remark"
|
||||
size="small"
|
||||
:controls="false"
|
||||
controls-position="right"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<MaterDtl
|
||||
:dialog-show.sync="materShow"
|
||||
:is-single="false"
|
||||
@setMaterValue="tableChanged"
|
||||
/>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import MaterDtl from '@/views/wms/pub/MaterDialog'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import crudProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
|
||||
import crudStructattr from '@/api/wms/basedata/st/structattr'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
product_code: '',
|
||||
bill_status: '10',
|
||||
total_qty: 0,
|
||||
detail_count: '0',
|
||||
stor_id: '',
|
||||
struct_id: '',
|
||||
bill_type: '',
|
||||
remark: '',
|
||||
workshop_id: '',
|
||||
biz_date: new Date(),
|
||||
create_mode: '',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { MaterDtl },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['IO_BILL_STATUS', 'ST_INV_RAW_IN_TYPE', 'ST_QUALITY_SCODE', 'bill_type', 'product_area'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
billShow: false,
|
||||
struct_id: '',
|
||||
sect_id: '',
|
||||
opendtlParam: null,
|
||||
storlist: [],
|
||||
sects: [],
|
||||
rules: {
|
||||
product_code: [
|
||||
{ required: true, message: '生产车间不能为空', trigger: 'blur' }
|
||||
],
|
||||
bill_type: [
|
||||
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
biz_date: [
|
||||
{ required: true, message: '业务日期不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取入库单明细
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeToEdit]() {
|
||||
this.struct_id = this.crud.form.struct_id
|
||||
this.sect_id = this.crud.form.sect_id
|
||||
crudStructattr.getSectCascader({ 'stor_id': this.crud.form.stor_id }).then(res => {
|
||||
this.sects = res.content
|
||||
this.form.struct_id = this.search(this.sects, this.struct_id)
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.form.stor_id) {
|
||||
this.crud.notify('仓库不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.struct_id) {
|
||||
this.crud.notify('仓位不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
if (!row.plan_qty) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
row.sect_id = this.sect_id
|
||||
row.struct_id = this.struct_id
|
||||
}
|
||||
},
|
||||
storChange(value) {
|
||||
crudStructattr.getSectCascader({ 'stor_id': value }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
search(object, value) {
|
||||
for (var key in object) {
|
||||
if (object[key].value == value) return [object[key].value]
|
||||
if (object[key].children && Object.keys(object[key].children).length > 0) {
|
||||
var temp = this.search(object[key].children, value)
|
||||
if (temp) return [object[key].value, temp].flat()
|
||||
}
|
||||
}
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
if (val.length === 1) {
|
||||
this.sect_id = val[0]
|
||||
this.struct_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.sect_id = ''
|
||||
this.struct_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.sect_id = val[0]
|
||||
this.struct_id = val[1]
|
||||
}
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
const material_code = rows[index].material_code
|
||||
let len = rows.length
|
||||
while (len--) {
|
||||
const obj = rows[len]
|
||||
if (material_code === obj.material_code) {
|
||||
const index = rows.indexOf(obj)
|
||||
if (index > -1) { // 移除找到的指定元素
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||
rows.splice(index, 1)
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tableChanged(rows) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.material_code === item.material_code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
item.quality_scode = '01'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.plan_qty = 1
|
||||
item.qty_unit_id = item.base_unit_id
|
||||
item.qty_unit_name = item.base_unit_name
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
tableChanged2(rows) {
|
||||
debugger
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
rows.forEach((item) => {
|
||||
let same_mater = true
|
||||
this.form.tableData.forEach((row) => {
|
||||
if (row.material_code === item.material_code && row.po_code === item.po.code) {
|
||||
same_mater = false
|
||||
}
|
||||
})
|
||||
if (same_mater) {
|
||||
item.quality_scode = '01'
|
||||
item.ivt_level = '01'
|
||||
item.is_active = '1'
|
||||
item.plan_qty = parseFloat(item.need_qty)
|
||||
item.source_bill_code = item.po_code
|
||||
item.source_bill_type_name = '原料需求'
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
this.form.tableData.splice(-1, 0, item)
|
||||
}
|
||||
})
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
insertEvent(row) {
|
||||
this.materShow = true
|
||||
},
|
||||
insertBill(row) {
|
||||
this.billShow = true
|
||||
},
|
||||
changeQty() {
|
||||
this.form.total_qty = 0
|
||||
this.form.tableData.forEach((item) => {
|
||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
</style>
|
||||
265
mes/qd/src/views/wms/device_manage/ios/embiin/ViewDialog.vue
Normal file
265
mes/qd/src/views/wms/device_manage/ios/embiin/ViewDialog.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<el-dialog
|
||||
append-to-body
|
||||
title="入库详情"
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||
:inline="true"
|
||||
:model="form"
|
||||
size="mini"
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="单据号" prop="bill_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生产车间">
|
||||
<el-select
|
||||
v-model="form.product_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_IN_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="bill_status">
|
||||
<el-select
|
||||
v-model="form.bill_status"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 数 量:</label>
|
||||
<el-input-number
|
||||
v-model="form.total_qty"
|
||||
:controls="false"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
disabled
|
||||
style="width: 210px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务日期" prop="biz_date">
|
||||
<el-date-picker
|
||||
v-model="form.biz_date"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
style="width: 210px"
|
||||
align="center"
|
||||
value-format="yyyy-MM-dd"
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span2">入库明细</span>
|
||||
</div>
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableDtl"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
size="mini"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="备件编码" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="备件名称" align="center" />
|
||||
<el-table-column prop="pcsn" label="批次" width="150" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="数量" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { crud } from '@crud/crud'
|
||||
import crudProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: {},
|
||||
mixins: [crud()],
|
||||
dicts: ['EM_BI_IN_TYPE', 'product_area', 'IO_BILL_STATUS'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
rowmst: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableDtl: [],
|
||||
tabledis: [],
|
||||
billtypelist: [],
|
||||
storlist: [],
|
||||
currentdtl: null,
|
||||
currentDis: {},
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
rowmst: {
|
||||
handler(newValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.queryTableDtl()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.currentDis = {}
|
||||
this.currentdtl = null
|
||||
this.tableDtl = []
|
||||
this.tabledis = []
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
task_statusFormat(row) {
|
||||
return this.dict.label.task_status[row.task_status]
|
||||
},
|
||||
work_statusFormat(row) {
|
||||
return this.dict.label.work_status[row.work_status]
|
||||
},
|
||||
handleDtlCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.tabledis = []
|
||||
this.currentdtl = current
|
||||
this.queryTableDdis()
|
||||
} else {
|
||||
this.tabledis = []
|
||||
this.currentdtl = {}
|
||||
}
|
||||
},
|
||||
invtypeFormat(row, column) {
|
||||
for (const item of this.billtypelist) {
|
||||
if (item.code === row.source_bill_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
handleDisCurrentChange(current) {
|
||||
this.currentDis = current
|
||||
},
|
||||
queryTableDtl() {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
crudProductIn.getDisTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
|
||||
this.tabledis = res
|
||||
}).catch(() => {
|
||||
this.tabledis = []
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .el-dialog__title2 {
|
||||
line-height: 24px;
|
||||
font-size: 20px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.crud-opts2 .role-span2 {
|
||||
padding: 0px 0px 20px 0px;
|
||||
}
|
||||
|
||||
.crud-opts2 {
|
||||
padding: 10px 0px 0px 50px;
|
||||
}
|
||||
|
||||
</style>
|
||||
49
mes/qd/src/views/wms/device_manage/ios/embiin/embiin.js
Normal file
49
mes/qd/src/views/wms/device_manage/ios/embiin/embiin.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getIODtl(data) {
|
||||
return request({
|
||||
url: '/api/emBiIostorinv/getIODtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
confirm,
|
||||
getIODtl
|
||||
}
|
||||
341
mes/qd/src/views/wms/device_manage/ios/embiin/index.vue
Normal file
341
mes/qd/src/views/wms/device_manage/ios/embiin/index.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<!--suppress ALL -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
|
||||
<el-form-item label="仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据类型">
|
||||
<el-select
|
||||
v-model="query.bill_type"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="单据类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.EM_BI_IN_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="生成方式">
|
||||
<el-select
|
||||
v-model="query.create_mode"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="生成方式"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_CREATE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
align="center"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库单号">
|
||||
<el-input
|
||||
v-model="query.bill_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="入库单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="车间">
|
||||
<el-select
|
||||
v-model="query.workshop_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="confirm_flag"
|
||||
@click="confirm"
|
||||
>
|
||||
强制确认
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
|
||||
<el-table-column show-overflow-tooltip prop="bill_code" width="130" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stor_name" label="生产车间" width="130" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="bill_type"
|
||||
min-width="120"
|
||||
label="业务类型"
|
||||
:formatter="bill_typeFormat"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
||||
<el-table-column label="明细数量" align="center" prop="detail_count" />
|
||||
<el-table-column label="总数量" align="center" prop="total_qty">
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓位" align="center" prop="struct_code" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="制单人" align="center" prop="create_name" />
|
||||
<el-table-column label="制单时间" align="center" prop="create_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_name" />
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_name" width="150" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-edit="canUd(scope.row)"
|
||||
:disabled-dle="canUd(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import rawProductIn from '@/views/wms/device_manage/ios/embiin/embiin'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/device_manage/ios/embiin/AddDialog'
|
||||
import ViewDialog from '@/views/wms/device_manage/ios/embiin/ViewDialog'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
|
||||
export default {
|
||||
name: 'EmBiIn',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
optShow: { add: true, reset: true },
|
||||
idField: 'iostorinv_id',
|
||||
url: '/api/emBiIostorinv',
|
||||
sort: ['bill_code'],
|
||||
crudMethod: { ...rawProductIn }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['IO_BILL_STATUS', 'EM_BI_IN_TYPE', 'product_area', 'ST_INV_CREATE'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
dis_flag: true,
|
||||
confirm_flag: true,
|
||||
disShow: false,
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
divShow: false,
|
||||
openParam: [],
|
||||
currentRow: null,
|
||||
storlist: [],
|
||||
storId: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user'
|
||||
])
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'stor_type': '6' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
canUd(row) {
|
||||
return row.bill_status !== '10'
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
this.buttonChange(row)
|
||||
} else if (val.length === 1) {
|
||||
this.buttonChange(row)
|
||||
} else {
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
buttonChange(currentRow) {
|
||||
if (currentRow !== null) {
|
||||
this.currentRow = currentRow
|
||||
if (currentRow.bill_status === '10') {
|
||||
this.confirm_flag = false
|
||||
} else {
|
||||
this.confirm_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCurrentChange(currentRow) {
|
||||
if (currentRow === null) {
|
||||
this.dis_flag = true
|
||||
this.confirm_flag = true
|
||||
this.currentRow = {}
|
||||
}
|
||||
},
|
||||
bill_typeFormat(row, column) {
|
||||
return this.dict.label.EM_BI_IN_TYPE[row.bill_type]
|
||||
},
|
||||
toView(row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
confirm() {
|
||||
if (!this.currentRow) {
|
||||
this.crud.notify('请选择一条单据', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
rawProductIn.confirm(this.currentRow).then(res => {
|
||||
this.crud.notify('单据确认成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user