add:半成品入库功能
This commit is contained in:
Binary file not shown.
@@ -49,7 +49,7 @@
|
||||
class.class_name,
|
||||
unit_name,
|
||||
'50' as standard_weight,
|
||||
unit_name as base_unit_id_name,
|
||||
unit_name as base_unit_name,
|
||||
class2.class_code as product_series_code,
|
||||
class2.class_name as product_series_name
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public enum IOSEnum {
|
||||
//单据状态
|
||||
BILL_STATUS(MapOf.of("生成","1","分配中","2","分配完","3","完成","9")),
|
||||
//单据状态
|
||||
WORK_STATUS(MapOf.of("创建","1","生成","2")),
|
||||
WORK_STATUS(MapOf.of("生成","1","下发","2")),
|
||||
;
|
||||
private Map<String,String> code;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package org.nl.wms.storage_manage.semimanage.controller.iostorInv;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -51,58 +52,41 @@ public class StIvtIostorinvBcpController {
|
||||
@Log("查询入库单据")
|
||||
@ApiOperation("查询入库单据")
|
||||
public ResponseEntity<Object> query(BcpIostorInvQuery query, PageQuery page) {
|
||||
Page<StIvtIostorinvBcp> list = stIvtIostorinvBcpService.page(page.build(), query.build());
|
||||
Page<StIvtIostorinvBcp> list = stIvtIostorinvBcpService.page(page.build(StIvtIostorinvBcp.class), query.build());
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Log("新增入库单")
|
||||
@ApiOperation("新增入库单")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject form) {
|
||||
stIvtIostorinvBcpService.create(form);
|
||||
semiProductInService.insertDtl(form);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("删除出入库单")
|
||||
@ApiOperation("删除出入库单")
|
||||
@DeleteMapping
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
if (ids.length>0){
|
||||
stIvtIostorinvBcpService.removeByIds(Arrays.asList(ids));
|
||||
stIvtIostorinvBcpService.update(new UpdateWrapper<StIvtIostorinvBcp>()
|
||||
.set("is_delete","1")
|
||||
.in("iostorinv_id",ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getBillDtl")
|
||||
@Log("查询入库单来源")
|
||||
@ApiOperation("查询入库单来源")
|
||||
public ResponseEntity<Object> getBillDtl(@RequestParam Map<String,Object> whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(semiProductInService.getBillDtl(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/semiProductInFromPda")
|
||||
@Log("C端半成品入库")
|
||||
@ApiOperation("C端半成品入库")
|
||||
public ResponseEntity<Object> semiProductInFromPda(@RequestBody JSONObject whereJson) {
|
||||
log.info("海亮缓存线手持服务 [半成品入库] 接口被请求, 请求参数-{}", whereJson);
|
||||
//参数校验
|
||||
if(StringUtils.isBlank(whereJson.getString("iostorinv_id")) || StringUtils.isBlank(whereJson.getString("material_id")) || StringUtils.isBlank(whereJson.getString("plan_qty")) || StringUtils.isBlank(whereJson.getString("storagevehicle_code"))) {
|
||||
throw new BizCoreException(ResultCode.VALIDATE_FAILED);
|
||||
}
|
||||
return new ResponseEntity<>(semiProductInService.semiProductInFromPda(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@PostMapping("/update")
|
||||
@Log("修改入库单")
|
||||
@ApiOperation("修改入库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
semiProductInService.update(whereJson);
|
||||
stIvtIostorinvBcpService.updateBill(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/queryStor")
|
||||
@Log("查询仓库")
|
||||
@ApiOperation("查询仓库")
|
||||
@@ -110,12 +94,6 @@ public class StIvtIostorinvBcpController {
|
||||
return new ResponseEntity<>(semiProductInService.queryStor(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getIODtl")
|
||||
@Log("查询出入库单明细")
|
||||
@ApiOperation("查询出入库单明细")
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(semiProductInService.getIODtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/commit")
|
||||
@Log("出入单提交")
|
||||
@@ -125,11 +103,11 @@ public class StIvtIostorinvBcpController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisDtl")
|
||||
@PostMapping("/getIODtl")
|
||||
@Log("查询入库分配明细")
|
||||
@ApiOperation("查询入库分配明细")
|
||||
public ResponseEntity<Object> getDisDtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(semiProductInService.getDisDtl(whereJson), HttpStatus.OK);
|
||||
public ResponseEntity<Object> getIODtl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(stIvtIostorinvBcpService.getInvDis(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmvehicle")
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库记录表 服务类
|
||||
@@ -19,4 +22,17 @@ public interface IStIvtIostorinvBcpService extends IService<StIvtIostorinvBcp> {
|
||||
* @return
|
||||
*/
|
||||
String create(JSONObject form);
|
||||
/**
|
||||
* 修改单据
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
String updateBill(JSONObject form);
|
||||
|
||||
/**
|
||||
* 获取分配明细
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
List<Map> getInvDis(JSONObject form);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface IStIvtIostorinvdisBcpService extends IService<StIvtIostorinvdisBcp> {
|
||||
/**
|
||||
* 查询明细
|
||||
* @param query:
|
||||
* iostorinv_id "1656252437415202816"
|
||||
* @return
|
||||
*/
|
||||
List<Map> getIostorinvdis(Map query);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
@@ -25,6 +27,7 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
@TableId(value = "iostorinv_id")
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
@@ -35,10 +38,11 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
/**
|
||||
* 出入类型
|
||||
*/
|
||||
private Boolean io_type;
|
||||
private String io_type;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
* alter table st_ivt_iostorinv_bcp modify buss_type varchar(5) generated always as (bill_type) stored;
|
||||
*/
|
||||
private String buss_type;
|
||||
|
||||
@@ -47,10 +51,16 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
private String bill_type;
|
||||
|
||||
|
||||
/**
|
||||
* 单据状态
|
||||
*/
|
||||
private String bill_status;
|
||||
|
||||
/**
|
||||
* 业务日期
|
||||
*/
|
||||
private String biz_date;
|
||||
private Date biz_date;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
@@ -102,35 +112,22 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
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 total_qty;
|
||||
|
||||
/**
|
||||
* 明细数
|
||||
*/
|
||||
private Integer detail_count;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
@@ -172,35 +169,6 @@ public class StIvtIostorinvBcp implements Serializable {
|
||||
*/
|
||||
private Date update_time;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 存储载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
private BigDecimal unit_weight;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_iostorinvdis_bcp")
|
||||
public class StIvtIostorinvdisBcp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入单分配标识
|
||||
*/
|
||||
@TableId(value = "iostorinvdis_id")
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private Integer seq_no;
|
||||
|
||||
/**
|
||||
* 关联基础单编号
|
||||
*/
|
||||
private String base_bill_code;
|
||||
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String region_code;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String region_name;
|
||||
|
||||
/**
|
||||
* 点位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 点位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
@Deprecated
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
private BigDecimal unit_weight;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String base_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String base_unit_name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 出入点位标识
|
||||
*/
|
||||
private String point_code;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 出入库单分配表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-05-10
|
||||
*/
|
||||
public interface StIvtIostorinvdisBcpMapper extends BaseMapper<StIvtIostorinvdisBcp> {
|
||||
|
||||
List<Map> getIostorinvdis(Map query);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvdisBcpMapper">
|
||||
|
||||
<select id="getIostorinvdis" resultType="java.util.Map">
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec
|
||||
FROM
|
||||
st_ivt_iostorinvdis_bcp dtl
|
||||
LEFT JOIN md_me_materialbase mater ON mater.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>
|
||||
@@ -1,19 +1,30 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.storage_manage.IOSEnum;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.basedata.service.storage.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvdisBcpService;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvBcpMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -26,76 +37,97 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpMapper, StIvtIostorinvBcp> implements IStIvtIostorinvBcpService {
|
||||
|
||||
@Autowired
|
||||
IStIvtBsrealstorattrService storattrService;
|
||||
|
||||
@Autowired
|
||||
IStIvtIostorinvdisBcpService storinvdisBcpService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String create(JSONObject form) {
|
||||
Assert.notNull(form,"参数不能为空");
|
||||
// String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
// String nickName = SecurityUtils.getCurrentNickName();
|
||||
// String now = DateUtil.now();
|
||||
// JSONArray rows = whereJson.getJSONArray("tableData");
|
||||
// // 插入主表
|
||||
// JSONObject io_mst = new JSONObject();
|
||||
// String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
// String bill_code = CodeUtil.getNewCode("IO_CODE");
|
||||
// double total_qty = 0;
|
||||
// io_mst.put("iostorinv_id", iostorinv_id);
|
||||
// io_mst.put("bill_code", bill_code);
|
||||
// io_mst.put("io_type", "0");
|
||||
// io_mst.put("bill_type", whereJson.getString("bill_type"));
|
||||
// io_mst.put("biz_date", whereJson.getString("biz_date").substring(0, 10));
|
||||
// //获取生产区域信息
|
||||
// JSONObject json = WQL.getWO("QSCH_REGION_01").addParam("flag", "2").addParam("value", whereJson.getString("product_code")).process().uniqueResult(0);
|
||||
// io_mst.put("product_id", json.getString("dict_id"));
|
||||
// io_mst.put("product_code", json.getString("value"));
|
||||
// io_mst.put("product_name", json.getString("label"));
|
||||
// io_mst.put("detail_count", rows.size());
|
||||
// io_mst.put("remark", whereJson.get("remark"));
|
||||
// io_mst.put("bill_status", whereJson.getString("bill_status"));
|
||||
// io_mst.put("create_id", currentUserId + "");
|
||||
// io_mst.put("create_name", nickName);
|
||||
// io_mst.put("create_time", now);
|
||||
// io_mst.put("update_id", currentUserId + "");
|
||||
// io_mst.put("update_name", nickName);
|
||||
// io_mst.put("update_time", now);
|
||||
// io_mst.put("is_delete", "0");
|
||||
// for(int i = 0; i < rows.size(); i++) {
|
||||
// // 插入明细表
|
||||
// JSONObject row = rows.getJSONObject(i);
|
||||
// row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
// row.put("iostorinv_id", iostorinv_id);
|
||||
// row.put("seq_no", (i + 1));
|
||||
// JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + row.get("material_code") + "'").uniqueResult(0);
|
||||
// row.put("material_id", material.getString("material_id"));
|
||||
// row.put("pcsn", row.getString("pcsn"));
|
||||
// row.put("bill_status", "10");
|
||||
// row.put("quality_scode", "01");
|
||||
// row.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
// JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + material.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
// row.put("qty_unit_name", unit.getString("unit_name"));
|
||||
// row.put("assign_qty", row.getDoubleValue("plan_qty"));
|
||||
// row.put("plan_qty", row.getDoubleValue("plan_qty"));
|
||||
// String plan_qty = row.getString("plan_qty");
|
||||
// total_qty += Double.parseDouble(plan_qty);
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
|
||||
// // 插入分配表
|
||||
// JSONObject dis = new JSONObject();
|
||||
// dis.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
// dis.put("iostorinv_id", iostorinv_id);
|
||||
// dis.put("iostorinvdtl_id", row.get("iostorinvdtl_id"));
|
||||
// dis.put("seq_no", 1);
|
||||
// dis.put("material_id", row.getString("material_id"));
|
||||
// dis.put("pcsn", row.getString("pcsn"));
|
||||
// dis.put("quality_scode", row.getString("quality_scode"));
|
||||
// dis.put("work_status", "00");
|
||||
// dis.put("qty_unit_id", material.getString("base_unit_id"));
|
||||
// dis.put("qty_unit_name", unit.getString("unit_name"));
|
||||
// dis.put("plan_qty", row.getString("plan_qty"));
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInvDis").insert(dis);
|
||||
// }
|
||||
// io_mst.put("total_qty", total_qty);
|
||||
// WQLObject.getWQLObject("ST_IVT_IOStorInv").insert(io_mst);
|
||||
// return iostorinv_id;
|
||||
return null;
|
||||
StIvtIostorinvBcp mst = packageMstForm(form);
|
||||
this.save(mst);
|
||||
int i = 1;
|
||||
for (Object item : form.getJSONArray("tableData")) {
|
||||
JSONObject row = (JSONObject) item;
|
||||
StIvtIostorinvdisBcp dis = packageDisForm(mst, i, row);
|
||||
storinvdisBcpService.save(dis);
|
||||
i++;
|
||||
}
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String updateBill(JSONObject form) {
|
||||
Assert.notNull(new Object[]{form,form.get("iostorinv_id")},"请求参数不能为空");
|
||||
StIvtIostorinvBcp mst = form.toJavaObject(StIvtIostorinvBcp.class);
|
||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setUpdate_time(new Date());
|
||||
this.updateById(mst);
|
||||
storinvdisBcpService.remove(new QueryWrapper<StIvtIostorinvdisBcp>().eq("iostorinv_id",mst.getIostorinv_id()));
|
||||
int i = 1;
|
||||
for (Object item : form.getJSONArray("tableData")) {
|
||||
JSONObject row = (JSONObject) item;
|
||||
StIvtIostorinvdisBcp dis = packageDisForm(mst, i, row);
|
||||
storinvdisBcpService.save(dis);
|
||||
i++;
|
||||
}
|
||||
return mst.getIostorinv_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getInvDis(JSONObject form) {
|
||||
return storinvdisBcpService.getIostorinvdis(form);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvdisBcp packageDisForm(StIvtIostorinvBcp mst, int i, JSONObject row) {
|
||||
StIvtIostorinvdisBcp dis = new StIvtIostorinvdisBcp();
|
||||
dis.setIostorinv_id(mst.getIostorinv_id());
|
||||
dis.setIostorinvdis_id(IdUtil.getStringId());
|
||||
dis.setMaterial_id(row.getString("material_id"));
|
||||
|
||||
dis.setPcsn(StringUtils.isNotEmpty(row.getString("pcsn"))?row.getString("pcsn"): DateUtil.today());
|
||||
dis.setPlan_qty(row.getBigDecimal("plan_qty"));
|
||||
dis.setQuality_scode(row.getString("quality_scode"));
|
||||
dis.setBase_unit_id(row.getString("base_unit_id"));
|
||||
dis.setBase_unit_name(row.getString("base_unit_name"));
|
||||
dis.setBase_bill_code(row.getString("base_bill_code"));
|
||||
dis.setPoint_code(row.getString("point_id"));
|
||||
dis.setUnit_weight(row.getBigDecimal("unit_weight"));
|
||||
dis.setStoragevehicle_code(row.getString("storagevehicle_code"));
|
||||
dis.setStoragevehicle_id(row.getString("storagevehicle_id"));
|
||||
dis.setSeq_no(i);
|
||||
return dis;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StIvtIostorinvBcp packageMstForm(JSONObject form) {
|
||||
StIvtIostorinvBcp mst = new StIvtIostorinvBcp();
|
||||
mst.setIostorinv_id(IdUtil.getStringId());
|
||||
mst.setBill_code(CodeUtil.getNewCode("IO_CODE"));
|
||||
mst.setBiz_date(form.getDate("biz_date"));
|
||||
mst.setBill_type(form.getString("bill_type"));
|
||||
mst.setTotal_qty(form.getBigDecimal("total_qty"));
|
||||
mst.setDetail_count(form.getJSONArray("tableData").size());
|
||||
mst.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||
mst.setIo_type(IOSEnum.IO_TYPE.code("入库"));
|
||||
mst.setRemark(form.getString("remark"));
|
||||
mst.setProduct_area(form.getString("product_code"));
|
||||
仓库数据:{
|
||||
StIvtBsrealstorattr stor = storattrService.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_id", form.getString("stor_id")));
|
||||
mst.setStor_id(stor.getStor_id());
|
||||
mst.setStor_code(stor.getStor_code());
|
||||
mst.setStor_name(stor.getStor_name());
|
||||
}
|
||||
mst.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mst.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
mst.setCreate_time(new Date());
|
||||
return mst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
||||
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvdisBcp;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.mapper.StIvtIostorinvdisBcpMapper;
|
||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvdisBcpService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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 StIvtIostorinvdisBcpServiceImpl extends ServiceImpl<StIvtIostorinvdisBcpMapper, StIvtIostorinvdisBcp> implements IStIvtIostorinvdisBcpService {
|
||||
|
||||
@Override
|
||||
public List<Map> getIostorinvdis(Map query) {
|
||||
if (query == null || (query.get("iostorinv_id") == null && query.get("bill_code") == null)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return baseMapper.getIostorinvdis(query);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user