单据接口字段调整
This commit is contained in:
@@ -3,17 +3,31 @@ package com.ruoyi.api.domain.ErpStock;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ErpStockDetail {
|
||||
|
||||
/** 产品名称 */
|
||||
// @JsonProperty("名称")
|
||||
String productName;
|
||||
|
||||
/** 辊号 */
|
||||
// @JsonProperty("辊号")
|
||||
String rollerNumber;
|
||||
|
||||
/** 版长 */
|
||||
// @JsonProperty("版长")
|
||||
BigDecimal length;
|
||||
|
||||
/** 版周 */
|
||||
// @JsonProperty("版周")
|
||||
BigDecimal perimeter;
|
||||
|
||||
/** 序号 */
|
||||
@JsonProperty("序号")
|
||||
int number;
|
||||
|
||||
/** 辊号 */
|
||||
@JsonProperty("辊号")
|
||||
String rollerNumber;
|
||||
|
||||
/** 色序 */
|
||||
@JsonProperty("色序")
|
||||
Integer colorSequence;
|
||||
@@ -25,4 +39,5 @@ public class ErpStockDetail {
|
||||
/** 规格 */
|
||||
@JsonProperty("规格")
|
||||
String spec;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,16 @@ import java.util.List;
|
||||
@Data
|
||||
public class ErpStockParam {
|
||||
|
||||
/** 产品名称 */
|
||||
// @JsonProperty("名称")
|
||||
// String productName;
|
||||
|
||||
/** 单据编号 */
|
||||
@JsonProperty("单据号")
|
||||
// @JsonProperty("单据号")
|
||||
String docNumber;
|
||||
|
||||
/** 单据明细 */
|
||||
@JsonProperty("明细")
|
||||
// @JsonProperty("明细")
|
||||
List<ErpStockDetail> details;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.api.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.ErpStock.ErpStockDetail;
|
||||
import com.ruoyi.api.domain.ErpStock.ErpStockParam;
|
||||
import com.ruoyi.api.service.IApiErpService;
|
||||
@@ -21,6 +22,7 @@ import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.log.domain.RequestLog;
|
||||
import com.ruoyi.log.service.IRequestLogService;
|
||||
import com.ruoyi.out.stockout.domain.OutStockout;
|
||||
import com.ruoyi.out.stockout.service.IOutStockoutService;
|
||||
@@ -78,6 +80,12 @@ public class ApiErpService implements IApiErpService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult receiveErpStockinBill(ErpStockParam erpStockParam) {
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpStockParam), "接收mes下发入库单据");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
//>>>接收并处理单据主信息
|
||||
String docNo = erpStockParam.getDocNumber();
|
||||
if (StrUtil.isBlank(docNo)) {
|
||||
@@ -124,14 +132,15 @@ public class ApiErpService implements IApiErpService {
|
||||
|
||||
log.info("【ERP请求】推送入库单据,wms入库单号:{},ERP单号:{}", stockinId, docNo);
|
||||
|
||||
|
||||
int num = 1;
|
||||
//>>>生成入库单据明细
|
||||
for (ErpStockDetail detail : erpStockParam.getDetails()) {
|
||||
inStockinDetailService.insertInStockinDetail(
|
||||
new InStockinDetail().builder()
|
||||
.stockinId(stockinId)
|
||||
.stockinDetailId(stockinId + "-" + detail.getNumber())
|
||||
.stockinDetailId(stockinId + "-" + num++)
|
||||
.status(0)
|
||||
.productName(detail.getProductName())
|
||||
.quantity(new BigDecimal(1))
|
||||
.scanNum(new BigDecimal(0))
|
||||
.assignNum(new BigDecimal(0))
|
||||
@@ -139,12 +148,14 @@ public class ApiErpService implements IApiErpService {
|
||||
.colorSequence(detail.getColorSequence())
|
||||
.color(detail.getColor())
|
||||
.spec(detail.getSpec())
|
||||
.length(detail.getLength())
|
||||
.perimeter(detail.getPerimeter())
|
||||
.build()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功,erp入库单据:" + docNo);
|
||||
return AjaxResult.success("操作成功,下发erp入库单据号:" + docNo);
|
||||
|
||||
}
|
||||
|
||||
@@ -158,6 +169,12 @@ public class ApiErpService implements IApiErpService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult receiveErpStockoutBill(ErpStockParam erpStockParam) {
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpStockParam), "接收mes下发出库单据");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
//>>>接收并处理单据主信息
|
||||
String docNo = erpStockParam.getDocNumber();
|
||||
if (StrUtil.isBlank(docNo)) {
|
||||
@@ -204,14 +221,15 @@ public class ApiErpService implements IApiErpService {
|
||||
|
||||
log.info("【ERP请求】推送出库单据,wms出库单号:{},ERP单号:{}", stockoutId, docNo);
|
||||
|
||||
|
||||
int num = 1;
|
||||
//>>>生成出库单据明细
|
||||
for (ErpStockDetail detail : erpStockParam.getDetails()) {
|
||||
outStockoutDetailService.insertOutStockoutDetail(
|
||||
new OutStockoutDetail().builder()
|
||||
.stockoutId(stockoutId)
|
||||
.stockoutDetailId(stockoutId + "-" + detail.getNumber())
|
||||
.stockoutDetailId(stockoutId + "-" + num++)
|
||||
.status(0)
|
||||
.productName(detail.getProductName())
|
||||
.quantity(new BigDecimal(1))
|
||||
.allotNum(new BigDecimal(0))
|
||||
.assignNum(new BigDecimal(0))
|
||||
@@ -220,12 +238,14 @@ public class ApiErpService implements IApiErpService {
|
||||
.colorSequence(detail.getColorSequence())
|
||||
.color(detail.getColor())
|
||||
.spec(detail.getSpec())
|
||||
.length(detail.getLength())
|
||||
.perimeter(detail.getPerimeter())
|
||||
.build()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功,erp出库单据:" + docNo);
|
||||
return AjaxResult.success("操作成功,下发erp出库单据号:" + docNo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -85,5 +86,11 @@ public class InStockinDetail extends BaseEntity
|
||||
|
||||
private String spare2;
|
||||
|
||||
private String spare3;
|
||||
/** 版长 */
|
||||
@Excel(name = "版长")
|
||||
private BigDecimal length;
|
||||
|
||||
/** 版周 */
|
||||
@Excel(name = "版周")
|
||||
private BigDecimal perimeter;
|
||||
}
|
||||
|
||||
@@ -73,5 +73,13 @@ public class OutStockoutDetail extends BaseEntity
|
||||
/** 状态 0-未完成分配 1-出库完成等待回传 2-回传成功 */
|
||||
private int status;
|
||||
|
||||
/** 版长 */
|
||||
@Excel(name = "版长")
|
||||
private BigDecimal length;
|
||||
|
||||
/** 版周 */
|
||||
@Excel(name = "版周")
|
||||
private BigDecimal perimeter;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ spring:
|
||||
# url: jdbc:sqlserver://172.16.4.12:1433;databaseName=flrd-wms;encrypt=false;sendStringParametersAsUnicode=true
|
||||
# username: sa
|
||||
# password: Flrd0914.
|
||||
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=FT577-wms;encrypt=false;sendStringParametersAsUnicode=true
|
||||
url: jdbc:sqlserver://172.16.30.100:1433;databaseName=FT577-wms;encrypt=false;sendStringParametersAsUnicode=true
|
||||
username: sa
|
||||
password: 123456
|
||||
password: Flrd0914.
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -74,7 +74,7 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 127.0.0.1
|
||||
host: 172.16.30.100
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
|
||||
@@ -19,13 +19,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="colorSequence" column="color_sequence" />
|
||||
<result property="color" column="color" />
|
||||
<result property="spec" column="spec" />
|
||||
<result property="length" column="length" />
|
||||
<result property="perimeter" column="perimeter" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInStockinDetailVo">
|
||||
select stockin_detail_id, stockin_id, lot_no, product_id, product_name, quantity, scan_num, assign_num, remark, roller_number, key_groove_spec, key_groove_type, color_sequence, color, spec, status from in_stockin_detail
|
||||
select stockin_detail_id, stockin_id, lot_no, product_id, product_name, quantity, scan_num, assign_num, remark, roller_number, key_groove_spec, key_groove_type, color_sequence, color, spec, length, perimeter, status from in_stockin_detail
|
||||
</sql>
|
||||
<sql id="selectInStockinDetailFinishVo">
|
||||
select stockin_detail_id, stockin_id, lot_no, product_id, product_name, quantity, scan_num, assign_num, remark, roller_number, key_groove_spec, key_groove_type, color_sequence, color, spec, status from in_stockin_detail_finish
|
||||
select stockin_detail_id, stockin_id, lot_no, product_id, product_name, quantity, scan_num, assign_num, remark, roller_number, key_groove_spec, key_groove_type, color_sequence, color, spec, length, perimeter, status from in_stockin_detail_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectInStockinDetailList" parameterType="InStockinDetail" resultMap="InStockinDetailResult">
|
||||
@@ -43,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null "> and color_sequence = #{colorSequence}</if>
|
||||
<if test="color != null "> and color = #{color}</if>
|
||||
<if test="spec != null "> and spec = #{spec}</if>
|
||||
<if test="length != null "> and length = #{length}</if>
|
||||
<if test="perimeter != null "> and perimeter = #{perimeter}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -96,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null "> and color_sequence = #{colorSequence}</if>
|
||||
<if test="color != null "> and color = #{color}</if>
|
||||
<if test="spec != null "> and spec = #{spec}</if>
|
||||
<if test="length != null "> and length = #{length}</if>
|
||||
<if test="perimeter != null "> and perimeter = #{perimeter}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -116,6 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null ">color_sequence,</if>
|
||||
<if test="color != null ">color,</if>
|
||||
<if test="spec != null ">spec,</if>
|
||||
<if test="length != null ">length,</if>
|
||||
<if test="perimeter != null ">perimeter,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockinDetailId != null">#{stockinDetailId},</if>
|
||||
@@ -132,6 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null ">#{colorSequence},</if>
|
||||
<if test="color != null ">#{color},</if>
|
||||
<if test="spec != null ">#{spec},</if>
|
||||
<if test="length != null ">#{length},</if>
|
||||
<if test="perimeter != null ">#{perimeter},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -152,6 +162,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null ">color_sequence,</if>
|
||||
<if test="color != null ">color,</if>
|
||||
<if test="spec != null ">spec,</if>
|
||||
<if test="length != null ">length,</if>
|
||||
<if test="perimeter != null ">perimeter,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockinDetailId != null">#{stockinDetailId},</if>
|
||||
@@ -168,6 +180,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null ">#{colorSequence},</if>
|
||||
<if test="color != null ">#{color},</if>
|
||||
<if test="spec != null ">#{spec},</if>
|
||||
<if test="length != null ">#{length},</if>
|
||||
<if test="perimeter != null ">#{perimeter},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -187,6 +201,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="colorSequence != null ">color_sequence = #{colorSequence},</if>
|
||||
<if test="color != null ">color = #{color},</if>
|
||||
<if test="spec != null ">spec = #{spec},</if>
|
||||
<if test="length != null ">length = #{length},</if>
|
||||
<if test="perimeter != null ">perimeter = #{perimeter},</if>
|
||||
</trim>
|
||||
where stockin_detail_id = #{stockinDetailId}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user