WMS:完成PDA接口:转库任务(半成品出半成品库入成品库)。
1.3.5
xins 10 months ago
parent 241eea0010
commit d145ba3b34

@ -11,8 +11,8 @@ import com.hw.common.core.web.domain.BaseEntity;
/** /**
* mes_base_barcode_info * mes_base_barcode_info
* *
* @author xs * @author xins
* @date 2023-12-21 * @date 2024-01-15
*/ */
public class MesBaseBarcodeInfo extends BaseEntity public class MesBaseBarcodeInfo extends BaseEntity
{ {
@ -30,10 +30,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "打印人") @Excel(name = "打印人")
private String printPerson; private String printPerson;
/** 批次标识(0否1是) */ /** 批次标识(0否1是);在打印时,如果物料已设置,则根据物料的批次信息,如果没有设置则在此需要选择,选择物料等信息保存后同步设置物料信息。 */
@Excel(name = "批次标识(0否1是)") @Excel(name = "批次标识(0否1是);在打印时,如果物料已设置,则根据物料的批次信息,如果没有设置则在此需要选择,选择物料等信息保存后同步设置物料信息。")
private String batchFlag; private String batchFlag;
/** 条码类型1原材料,2半成品,3成品,4背板 */
@Excel(name = "条码类型", readConverterExp = "1=原材料,2半成品,3成品,4背板")
private String barcodeType;
/** 条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同 */ /** 条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同 */
@Excel(name = "条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同") @Excel(name = "条码内容;如果是按单个物料贴,则一个物料一个条码,如果是按批次贴,则条码跟批次代码相同")
private String barcodeInfo; private String barcodeInfo;
@ -42,9 +46,9 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "批次代码") @Excel(name = "批次代码")
private String batchCode; private String batchCode;
/** RFID代码 */ /** 托盘RFID代码 */
@Excel(name = "RFID代码") @Excel(name = "托盘RFID代码")
private String rfidCode; private String palletInfoCode;
/** 物料ID关联mes_base_material_info的material_id */ /** 物料ID关联mes_base_material_info的material_id */
@Excel(name = "物料ID关联mes_base_material_info的material_id") @Excel(name = "物料ID关联mes_base_material_info的material_id")
@ -54,10 +58,6 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "供应商ID") @Excel(name = "供应商ID")
private Long manufacturerId; private Long manufacturerId;
/** 重量 */
@Excel(name = "重量")
private BigDecimal weight;
/** 数量 */ /** 数量 */
@Excel(name = "数量") @Excel(name = "数量")
private BigDecimal amount; private BigDecimal amount;
@ -66,8 +66,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "打印机台名称,打印时获取") @Excel(name = "打印机台名称,打印时获取")
private String machineName; private String machineName;
/** 采购订单号 */ /** 采购订单号;适合原材料入库时 */
@Excel(name = "采购订单号") @Excel(name = "采购订单号;适合原材料入库时")
private String poNo; private String poNo;
/** 生产日期;打印时根据领料单选择输入 */ /** 生产日期;打印时根据领料单选择输入 */
@ -80,22 +80,43 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "接受日期;打印时的系统日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "接受日期;打印时的系统日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date acceptedDate; private Date acceptedDate;
/** 日限;根据日限计算出过期日期(最晚出库日期) */
@Excel(name = "日限;根据日限计算出过期日期", readConverterExp = "最=晚出库日期")
private Long limitingDate;
/** 最晚出库日期;可以直接输入,也可以根据日限计算 */ /** 最晚出库日期;可以直接输入,也可以根据日限计算 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最晚出库日期;可以直接输入,也可以根据日限计算", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "最晚出库日期;可以直接输入,也可以根据日限计算", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastOutstockDate; private Date lastOutstockDate;
/** 生产计划编号关联mes_pd_product_plan的plan_code;适合生产出入库等 */
@Excel(name = "生产计划编号关联mes_pd_product_plan的plan_code;适合生产出入库等")
private String planCode;
/** 生产计划明细编号关联mes_product_plan_detail的plan_detail_code;适合生产出入库等 */
@Excel(name = "生产计划明细编号关联mes_product_plan_detail的plan_detail_code;适合生产出入库等")
private String planDetailCode;
/** 销售订单编号;适合生产出入库等 */
@Excel(name = "销售订单编号;适合生产出入库等")
private String saleorderCode;
/** 项目号 */
@Excel(name = "项目号")
private String projectNo;
/** 流水号 */ /** 流水号 */
@Excel(name = "流水号") @Excel(name = "流水号")
private String serialNumber; private String serialNumber;
/** 是否启用 */ /** 绑定状态(1绑定0解绑) */
@Excel(name = "是否启用") @Excel(name = "绑定状态(1绑定0解绑)")
private Long activeFlag; private String bindStatus;
/** 绑定托盘的人 */
@Excel(name = "绑定托盘的人")
private String bindBy;
/** 绑定托盘时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "绑定托盘时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bindTime;
public void setBarcodeId(Long barcodeId) public void setBarcodeId(Long barcodeId)
{ {
@ -133,6 +154,15 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return batchFlag; return batchFlag;
} }
public void setBarcodeType(String barcodeType)
{
this.barcodeType = barcodeType;
}
public String getBarcodeType()
{
return barcodeType;
}
public void setBarcodeInfo(String barcodeInfo) public void setBarcodeInfo(String barcodeInfo)
{ {
this.barcodeInfo = barcodeInfo; this.barcodeInfo = barcodeInfo;
@ -151,14 +181,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return batchCode; return batchCode;
} }
public void setRfidCode(String rfidCode) public void setPalletInfoCode(String palletInfoCode)
{ {
this.rfidCode = rfidCode; this.palletInfoCode = palletInfoCode;
} }
public String getRfidCode() public String getPalletInfoCode()
{ {
return rfidCode; return palletInfoCode;
} }
public void setMaterialId(Long materialId) public void setMaterialId(Long materialId)
{ {
@ -178,15 +208,6 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return manufacturerId; return manufacturerId;
} }
public void setWeight(BigDecimal weight)
{
this.weight = weight;
}
public BigDecimal getWeight()
{
return weight;
}
public void setAmount(BigDecimal amount) public void setAmount(BigDecimal amount)
{ {
this.amount = amount; this.amount = amount;
@ -232,23 +253,50 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return acceptedDate; return acceptedDate;
} }
public void setLimitingDate(Long limitingDate) public void setLastOutstockDate(Date lastOutstockDate)
{ {
this.limitingDate = limitingDate; this.lastOutstockDate = lastOutstockDate;
} }
public Long getLimitingDate() public Date getLastOutstockDate()
{ {
return limitingDate; return lastOutstockDate;
} }
public void setLastOutstockDate(Date lastOutstockDate) public void setPlanCode(String planCode)
{ {
this.lastOutstockDate = lastOutstockDate; this.planCode = planCode;
} }
public Date getLastOutstockDate() public String getPlanCode()
{ {
return lastOutstockDate; return planCode;
}
public void setPlanDetailCode(String planDetailCode)
{
this.planDetailCode = planDetailCode;
}
public String getPlanDetailCode()
{
return planDetailCode;
}
public void setSaleorderCode(String saleorderCode)
{
this.saleorderCode = saleorderCode;
}
public String getSaleorderCode()
{
return saleorderCode;
}
public void setProjectNo(String projectNo)
{
this.projectNo = projectNo;
}
public String getProjectNo()
{
return projectNo;
} }
public void setSerialNumber(String serialNumber) public void setSerialNumber(String serialNumber)
{ {
@ -259,14 +307,32 @@ public class MesBaseBarcodeInfo extends BaseEntity
{ {
return serialNumber; return serialNumber;
} }
public void setActiveFlag(Long activeFlag) public void setBindStatus(String bindStatus)
{
this.bindStatus = bindStatus;
}
public String getBindStatus()
{
return bindStatus;
}
public void setBindBy(String bindBy)
{
this.bindBy = bindBy;
}
public String getBindBy()
{
return bindBy;
}
public void setBindTime(Date bindTime)
{ {
this.activeFlag = activeFlag; this.bindTime = bindTime;
} }
public Long getActiveFlag() public Date getBindTime()
{ {
return activeFlag; return bindTime;
} }
@Override @Override
@ -276,24 +342,27 @@ public class MesBaseBarcodeInfo extends BaseEntity
.append("printTime", getPrintTime()) .append("printTime", getPrintTime())
.append("printPerson", getPrintPerson()) .append("printPerson", getPrintPerson())
.append("batchFlag", getBatchFlag()) .append("batchFlag", getBatchFlag())
.append("barcodeType", getBarcodeType())
.append("barcodeInfo", getBarcodeInfo()) .append("barcodeInfo", getBarcodeInfo())
.append("batchCode", getBatchCode()) .append("batchCode", getBatchCode())
.append("rfidCode", getRfidCode()) .append("palletInfoCode", getPalletInfoCode())
.append("materialId", getMaterialId()) .append("materialId", getMaterialId())
.append("manufacturerId", getManufacturerId()) .append("manufacturerId", getManufacturerId())
.append("weight", getWeight())
.append("amount", getAmount()) .append("amount", getAmount())
.append("machineName", getMachineName()) .append("machineName", getMachineName())
.append("poNo", getPoNo()) .append("poNo", getPoNo())
.append("productionDate", getProductionDate()) .append("productionDate", getProductionDate())
.append("acceptedDate", getAcceptedDate()) .append("acceptedDate", getAcceptedDate())
.append("limitingDate", getLimitingDate())
.append("lastOutstockDate", getLastOutstockDate()) .append("lastOutstockDate", getLastOutstockDate())
.append("planCode", getPlanCode())
.append("planDetailCode", getPlanDetailCode())
.append("saleorderCode", getSaleorderCode())
.append("projectNo", getProjectNo())
.append("serialNumber", getSerialNumber()) .append("serialNumber", getSerialNumber())
.append("remark", getRemark()) .append("remark", getRemark())
.append("activeFlag", getActiveFlag()) .append("bindStatus", getBindStatus())
.append("createBy", getCreateBy()) .append("bindBy", getBindBy())
.append("createTime", getCreateTime()) .append("bindTime", getBindTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.toString(); .toString();

@ -17,7 +17,7 @@ public class WmsConstants {
/*操作类型,适合原材料和成品的出入库以及原材料的退库*/ /*操作类型,适合原材料和成品的出入库、原材料的退库以及转库*/
public static final String WMS_OPERATION_TYPE_AUTO = "0";//agv自动 public static final String WMS_OPERATION_TYPE_AUTO = "0";//agv自动
public static final String WMS_OPERATION_TYPE_MANUAL = "1";//人工 public static final String WMS_OPERATION_TYPE_MANUAL = "1";//人工
public static final String WMS_OPERATION_TYPE_FORCED = "2";//强制 public static final String WMS_OPERATION_TYPE_FORCED = "2";//强制
@ -79,7 +79,9 @@ public class WmsConstants {
/*出入库退库记录(明细)执行状态*/ /*出入库退库记录(明细)执行状态*/
public static final String WMS_EXECUTE_STATUS_TOEXECUTE = "0";//待执行 public static final String WMS_EXECUTE_STATUS_TOEXECUTE = "0";//待执行
public static final String WMS_EXECUTE_STATUS_EXECUTING = "1";//执行中 public static final String WMS_EXECUTE_STATUS_EXECUTING = "1";//执行中
public static final String WMS_EXECUTE_STATUS_FINISH = "2";//执完成行 public static final String WMS_EXECUTE_STATUS_FINISH = "2";//完成执行
public static final String WMS_EXECUTE_STATUS_NOT_FINISH = "notFinish";//未完成执行
@ -113,9 +115,9 @@ public class WmsConstants {
/*仓库存放类型*/ /*仓库存放类型*/
public static final String WAREHOUSE_INSTOCK_TYPE_RAW = "1";//原材料 public static final String WMS_WAREHOUSE_INSTOCK_TYPE_RAW = "1";//原材料
public static final String WAREHOUSE_INSTOCK_TYPE_SEMI = "2";//半成品 public static final String WMS_WAREHOUSE_INSTOCK_TYPE_SEMI = "2";//半成品
public static final String WAREHOUSE_INSTOCK_TYPE_PRODUCT = "3";//成品 public static final String WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT = "3";//成品
public static final String WMS_MOVEMERGE_TYPE_MOVE = "1"; //移库 public static final String WMS_MOVEMERGE_TYPE_MOVE = "1"; //移库
@ -175,4 +177,17 @@ public class WmsConstants {
public static final String WMS_RAW_STOCK_COMPLETE_FLAG_NO = "0";//否 public static final String WMS_RAW_STOCK_COMPLETE_FLAG_NO = "0";//否
public static final String WMS_WAREHOUSE_MATERIAL_STORAGE_TYPE_MATERIAL = "1"; public static final String WMS_WAREHOUSE_MATERIAL_STORAGE_TYPE_MATERIAL = "1";
/*转库类型*/
public static final String WMS_TRANSFER_TYPE_OUT_TO_PRODUCT_STOCK = "1";//出半成品库入成品库
/*转库明细类型*/
public static final String WMS_TRANSFER_DETAIL_TYPE_OUTSTOCK = "1";//出库
public static final String WMS_TRANSFER_DETAIL_TYPE_INSTOCK = "2";//入库
} }

@ -92,4 +92,9 @@ public enum BusinessType
*/ */
UNALLOCATE, UNALLOCATE,
/**
*
*/
TRANSFER,
} }

@ -9,58 +9,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="printTime" column="print_time" /> <result property="printTime" column="print_time" />
<result property="printPerson" column="print_person" /> <result property="printPerson" column="print_person" />
<result property="batchFlag" column="batch_flag" /> <result property="batchFlag" column="batch_flag" />
<result property="barcodeType" column="barcode_type" />
<result property="barcodeInfo" column="barcode_info" /> <result property="barcodeInfo" column="barcode_info" />
<result property="batchCode" column="batch_code" /> <result property="batchCode" column="batch_code" />
<result property="rfidCode" column="rfid_code" /> <result property="palletInfoCode" column="pallet_info_code" />
<result property="materialId" column="material_id" /> <result property="materialId" column="material_id" />
<result property="manufacturerId" column="manufacturer_id" /> <result property="manufacturerId" column="manufacturer_id" />
<result property="weight" column="weight" />
<result property="amount" column="amount" /> <result property="amount" column="amount" />
<result property="machineName" column="machine_name" /> <result property="machineName" column="machine_name" />
<result property="poNo" column="po_no" /> <result property="poNo" column="po_no" />
<result property="productionDate" column="production_date" /> <result property="productionDate" column="production_date" />
<result property="acceptedDate" column="accepted_date" /> <result property="acceptedDate" column="accepted_date" />
<result property="limitingDate" column="limiting_date" />
<result property="lastOutstockDate" column="last_outstock_date" /> <result property="lastOutstockDate" column="last_outstock_date" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleorderCode" column="saleorder_code" />
<result property="projectNo" column="project_no" />
<result property="serialNumber" column="serial_number" /> <result property="serialNumber" column="serial_number" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="activeFlag" column="active_flag" /> <result property="bindStatus" column="bind_status" />
<result property="createBy" column="create_by" /> <result property="bindBy" column="bind_by" />
<result property="createTime" column="create_time" /> <result property="bindTime" column="bind_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<sql id="selectMesBaseBarcodeInfoVo"> <sql id="selectMesBaseBarcodeInfoVo">
select barcode_id, print_time, print_person, batch_flag, barcode_info, batch_code, rfid_code, material_id, manufacturer_id, weight, amount, machine_name, po_no, production_date, accepted_date, limiting_date, last_outstock_date, serial_number, remark, active_flag, create_by, create_time, update_by, update_time from mes_base_barcode_info select barcode_id, print_time, print_person, batch_flag, barcode_type, barcode_info, batch_code, pallet_info_code, material_id, manufacturer_id, amount, machine_name, po_no, production_date, accepted_date, last_outstock_date, plan_code, plan_detail_code, saleorder_code, project_no, serial_number, remark, bind_status, bind_by, bind_time, update_by, update_time from mes_base_barcode_info
</sql> </sql>
<select id="selectMesBaseBarcodeInfoByBarcodeInfo" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where barcode_info = #{barcodeInfo} limit 1
</select>
<select id="selectMesBaseBarcodeInfoList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult"> <select id="selectMesBaseBarcodeInfoList" parameterType="MesBaseBarcodeInfo" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/> <include refid="selectMesBaseBarcodeInfoVo"/>
<where> <where>
<if test="printTime != null "> and print_time = #{printTime}</if> <if test="printTime != null "> and print_time = #{printTime}</if>
<if test="printPerson != null and printPerson != ''"> and print_person = #{printPerson}</if> <if test="printPerson != null and printPerson != ''"> and print_person = #{printPerson}</if>
<if test="batchFlag != null and batchFlag != ''"> and batch_flag = #{batchFlag}</if>
<if test="barcodeType != null and barcodeType != ''"> and barcode_type = #{barcodeType}</if>
<if test="barcodeInfo != null and barcodeInfo != ''"> and barcode_info = #{barcodeInfo}</if> <if test="barcodeInfo != null and barcodeInfo != ''"> and barcode_info = #{barcodeInfo}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if> <if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="rfidCode != null and rfidCode != ''"> and rfid_code = #{rfidCode}</if> <if test="palletInfoCode != null and palletInfoCode != ''"> and pallet_info_code = #{palletInfoCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if> <if test="materialId != null "> and material_id = #{materialId}</if>
<if test="manufacturerId != null "> and manufacturer_id = #{manufacturerId}</if> <if test="manufacturerId != null "> and manufacturer_id = #{manufacturerId}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="amount != null "> and amount = #{amount}</if> <if test="amount != null "> and amount = #{amount}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if> <if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if> <if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="productionDate != null "> and production_date = #{productionDate}</if> <if test="productionDate != null "> and production_date = #{productionDate}</if>
<if test="acceptedDate != null "> and accepted_date = #{acceptedDate}</if> <if test="acceptedDate != null "> and accepted_date = #{acceptedDate}</if>
<if test="limitingDate != null "> and limiting_date = #{limitingDate}</if>
<if test="lastOutstockDate != null "> and last_outstock_date = #{lastOutstockDate}</if> <if test="lastOutstockDate != null "> and last_outstock_date = #{lastOutstockDate}</if>
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null and saleorderCode != ''"> and saleorder_code = #{saleorderCode}</if>
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if> <if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
<if test="activeFlag != null "> and active_flag = #{activeFlag}</if> <if test="bindStatus != null and bindStatus != ''"> and bind_status = #{bindStatus}</if>
<if test="bindBy != null and bindBy != ''"> and bind_by = #{bindBy}</if>
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
</where> </where>
</select> </select>
@ -75,24 +78,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="printTime != null">print_time,</if> <if test="printTime != null">print_time,</if>
<if test="printPerson != null">print_person,</if> <if test="printPerson != null">print_person,</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag,</if> <if test="batchFlag != null and batchFlag != ''">batch_flag,</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type,</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if> <if test="barcodeInfo != null and barcodeInfo != ''">barcode_info,</if>
<if test="batchCode != null and batchCode != ''">batch_code,</if> <if test="batchCode != null and batchCode != ''">batch_code,</if>
<if test="rfidCode != null">rfid_code,</if> <if test="palletInfoCode != null">pallet_info_code,</if>
<if test="materialId != null">material_id,</if> <if test="materialId != null">material_id,</if>
<if test="manufacturerId != null">manufacturer_id,</if> <if test="manufacturerId != null">manufacturer_id,</if>
<if test="weight != null">weight,</if>
<if test="amount != null">amount,</if> <if test="amount != null">amount,</if>
<if test="machineName != null">machine_name,</if> <if test="machineName != null">machine_name,</if>
<if test="poNo != null">po_no,</if> <if test="poNo != null">po_no,</if>
<if test="productionDate != null">production_date,</if> <if test="productionDate != null">production_date,</if>
<if test="acceptedDate != null">accepted_date,</if> <if test="acceptedDate != null">accepted_date,</if>
<if test="limitingDate != null">limiting_date,</if>
<if test="lastOutstockDate != null">last_outstock_date,</if> <if test="lastOutstockDate != null">last_outstock_date,</if>
<if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="saleorderCode != null">saleorder_code,</if>
<if test="projectNo != null">project_no,</if>
<if test="serialNumber != null">serial_number,</if> <if test="serialNumber != null">serial_number,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="activeFlag != null">active_flag,</if> <if test="bindStatus != null">bind_status,</if>
<if test="createBy != null">create_by,</if> <if test="bindBy != null">bind_by,</if>
<if test="createTime != null">create_time,</if> <if test="bindTime != null">bind_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
</trim> </trim>
@ -100,24 +106,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="printTime != null">#{printTime},</if> <if test="printTime != null">#{printTime},</if>
<if test="printPerson != null">#{printPerson},</if> <if test="printPerson != null">#{printPerson},</if>
<if test="batchFlag != null and batchFlag != ''">#{batchFlag},</if> <if test="batchFlag != null and batchFlag != ''">#{batchFlag},</if>
<if test="barcodeType != null and barcodeType != ''">#{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if> <if test="barcodeInfo != null and barcodeInfo != ''">#{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">#{batchCode},</if> <if test="batchCode != null and batchCode != ''">#{batchCode},</if>
<if test="rfidCode != null">#{rfidCode},</if> <if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="materialId != null">#{materialId},</if> <if test="materialId != null">#{materialId},</if>
<if test="manufacturerId != null">#{manufacturerId},</if> <if test="manufacturerId != null">#{manufacturerId},</if>
<if test="weight != null">#{weight},</if>
<if test="amount != null">#{amount},</if> <if test="amount != null">#{amount},</if>
<if test="machineName != null">#{machineName},</if> <if test="machineName != null">#{machineName},</if>
<if test="poNo != null">#{poNo},</if> <if test="poNo != null">#{poNo},</if>
<if test="productionDate != null">#{productionDate},</if> <if test="productionDate != null">#{productionDate},</if>
<if test="acceptedDate != null">#{acceptedDate},</if> <if test="acceptedDate != null">#{acceptedDate},</if>
<if test="limitingDate != null">#{limitingDate},</if>
<if test="lastOutstockDate != null">#{lastOutstockDate},</if> <if test="lastOutstockDate != null">#{lastOutstockDate},</if>
<if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="saleorderCode != null">#{saleorderCode},</if>
<if test="projectNo != null">#{projectNo},</if>
<if test="serialNumber != null">#{serialNumber},</if> <if test="serialNumber != null">#{serialNumber},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="activeFlag != null">#{activeFlag},</if> <if test="bindStatus != null">#{bindStatus},</if>
<if test="createBy != null">#{createBy},</if> <if test="bindBy != null">#{bindBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="bindTime != null">#{bindTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
</trim> </trim>
@ -129,24 +138,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="printTime != null">print_time = #{printTime},</if> <if test="printTime != null">print_time = #{printTime},</if>
<if test="printPerson != null">print_person = #{printPerson},</if> <if test="printPerson != null">print_person = #{printPerson},</if>
<if test="batchFlag != null and batchFlag != ''">batch_flag = #{batchFlag},</if> <if test="batchFlag != null and batchFlag != ''">batch_flag = #{batchFlag},</if>
<if test="barcodeType != null and barcodeType != ''">barcode_type = #{barcodeType},</if>
<if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if> <if test="barcodeInfo != null and barcodeInfo != ''">barcode_info = #{barcodeInfo},</if>
<if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if> <if test="batchCode != null and batchCode != ''">batch_code = #{batchCode},</if>
<if test="rfidCode != null">rfid_code = #{rfidCode},</if> <if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
<if test="materialId != null">material_id = #{materialId},</if> <if test="materialId != null">material_id = #{materialId},</if>
<if test="manufacturerId != null">manufacturer_id = #{manufacturerId},</if> <if test="manufacturerId != null">manufacturer_id = #{manufacturerId},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="amount != null">amount = #{amount},</if> <if test="amount != null">amount = #{amount},</if>
<if test="machineName != null">machine_name = #{machineName},</if> <if test="machineName != null">machine_name = #{machineName},</if>
<if test="poNo != null">po_no = #{poNo},</if> <if test="poNo != null">po_no = #{poNo},</if>
<if test="productionDate != null">production_date = #{productionDate},</if> <if test="productionDate != null">production_date = #{productionDate},</if>
<if test="acceptedDate != null">accepted_date = #{acceptedDate},</if> <if test="acceptedDate != null">accepted_date = #{acceptedDate},</if>
<if test="limitingDate != null">limiting_date = #{limitingDate},</if>
<if test="lastOutstockDate != null">last_outstock_date = #{lastOutstockDate},</if> <if test="lastOutstockDate != null">last_outstock_date = #{lastOutstockDate},</if>
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="projectNo != null">project_no = #{projectNo},</if>
<if test="serialNumber != null">serial_number = #{serialNumber},</if> <if test="serialNumber != null">serial_number = #{serialNumber},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="activeFlag != null">active_flag = #{activeFlag},</if> <if test="bindStatus != null">bind_status = #{bindStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="bindBy != null">bind_by = #{bindBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="bindTime != null">bind_time = #{bindTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
</trim> </trim>
@ -163,4 +175,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{barcodeId} #{barcodeId}
</foreach> </foreach>
</delete> </delete>
<select id="selectMesBaseBarcodeInfoByBarcodeInfo" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where barcode_info = #{barcodeInfo} limit 1
</select>
</mapper> </mapper>

@ -43,6 +43,15 @@ public class WmsMobileController extends BaseController {
@Autowired @Autowired
private IWmsMoveMergeService wmsMoveMergeService; private IWmsMoveMergeService wmsMoveMergeService;
@Autowired
private IWmsTransferService wmsTransferService;
@Autowired
private IWmsBaseWarehouseService wmsBaseWarehouseService;
@Autowired
private IWmsProductStockService wmsProductStockService;
/** /**
* *
*/ */
@ -108,12 +117,6 @@ public class WmsMobileController extends BaseController {
} }
/** /**
* 退 * 退
*/ */
@ -177,7 +180,6 @@ public class WmsMobileController extends BaseController {
} }
/** /**
* *
*/ */
@ -187,10 +189,88 @@ public class WmsMobileController extends BaseController {
return toAjax(wmsProductInstockService.insertWmsProductInstock(wmsProductInstockVo)); return toAjax(wmsProductInstockService.insertWmsProductInstock(wmsProductInstockVo));
} }
/**
*
*/
// @RequiresPermissions("wms:rawoutstock:query")
@GetMapping(value = "/getSemiWarehouseList")
public AjaxResult getSemiWarehouseList() {
WmsBaseWarehouse queryBaseWarehouse = new WmsBaseWarehouse();
queryBaseWarehouse.setWarehouseInstockType(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_SEMI);
return success(wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryBaseWarehouse));
}
/**
*
*/
// @RequiresPermissions("wms:rawoutstock:query")
@GetMapping(value = "/getProductWarehouseList")
public AjaxResult getProductWarehouseList() {
WmsBaseWarehouse queryBaseWarehouse = new WmsBaseWarehouse();
queryBaseWarehouse.setWarehouseInstockType(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_PRODUCT);
return success(wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryBaseWarehouse));
}
/**
* ID
*/
// @RequiresPermissions("wms:rawoutstock:query")
@GetMapping(value = "/getProductStock")
public AjaxResult getProductStock(Long warehouseId) {
WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setWarehouseId(warehouseId);
return success(wmsProductStockService.selectWmsProductStockJoinList(queryProductStock));
}
/**
*
*/
@Log(title = "转库", businessType = BusinessType.TRANSFER)
@PostMapping(("/applyProductTransfer"))
public AjaxResult applyProductTransfer(@Validated @RequestBody List<WmsTransfer> wmsTransfers) {
return toAjax(wmsTransferService.applyTransfers(wmsTransfers));
}
/**
*
*/
// @RequiresPermissions("wms:rawoutstock:query")
@GetMapping(value = "/getTransfers")
public AjaxResult getTransfers() {
WmsTransfer queryTransfer = new WmsTransfer();
queryTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_NOT_FINISH);
return success(wmsTransferService.selectWmsTransferJoinList(queryTransfer));
}
/**
*
*/
@Log(title = "转库", businessType = BusinessType.INSERT)
@PostMapping(("/transferOutstock"))
public AjaxResult transferOutstock(@RequestBody WmsTransferDetail wmsTransferDetail) {
return toAjax(wmsTransferService.transferOutstock(wmsTransferDetail));
}
/**
*
*/
@Log(title = "转库", businessType = BusinessType.INSERT)
@PostMapping(("/transferInstock"))
public AjaxResult transferInstock(@RequestBody WmsTransferDetail wmsTransferDetail) {
return toAjax(wmsTransferService.transferInstock(wmsTransferDetail));
}
/** /**
* *
*/ */
@Log(title = "原材料移库", businessType = BusinessType.INSERT) @Log(title = "人工移库", businessType = BusinessType.INSERT)
@PostMapping(("/moveRaw")) @PostMapping(("/moveRaw"))
public AjaxResult moveRaw(@Validated @RequestBody WmsMoveMergeVo wmsMoveMergeVo) { public AjaxResult moveRaw(@Validated @RequestBody WmsMoveMergeVo wmsMoveMergeVo) {
return toAjax(wmsMoveMergeService.manualMove(wmsMoveMergeVo, WmsConstants.WMS_MOVEMERGE_TYPE_MOVE)); return toAjax(wmsMoveMergeService.manualMove(wmsMoveMergeVo, WmsConstants.WMS_MOVEMERGE_TYPE_MOVE));

@ -87,6 +87,10 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "入库时间", readConverterExp = "预=留") @Excel(name = "入库时间", readConverterExp = "预=留")
private Date instockDate; private Date instockDate;
private String materialCode;
private String materialName;
public void setProductStockId(Long productStockId) public void setProductStockId(Long productStockId)
{ {
this.productStockId = productStockId; this.productStockId = productStockId;
@ -231,6 +235,22 @@ public class WmsProductStock extends BaseEntity
return instockDate; return instockDate;
} }
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,46 @@
package com.hw.wms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @Description: VO
* @ClassName: WmsProductTransferVo
* @Author : xins
* @Date :2024-01-15 8:51
* @Version :1.0
*/
@Data
public class WmsProductTransferVo {
//原仓库ID
@NotNull(message="原仓库必须输入")
private Long oriWarehouseId;
//目标仓库ID
@NotNull(message="目标仓库ID必须输入")
private Long targetWarehouseId;
//原库位编号
@NotBlank(message="原库位编号必须输入")
private String oriLocationCode;
//产品ID
@NotNull(message="成品ID必须输入")
private Long productId;
//产品批次
@NotBlank(message="产品批次必须输入")
private String productBatch;
//生产计划Code
@NotBlank(message="生产计划编号必须输入")
private String planCode;
private BigDecimal applyCount;
}

@ -87,4 +87,13 @@ public interface WmsProductStockMapper
*/ */
public List<WmsProductStock> selectWmsProductStockInList(WmsProductStock wmsProductStock); public List<WmsProductStock> selectWmsProductStockInList(WmsProductStock wmsProductStock);
/**
* Join material,totalAmount>0
*
* @param wmsProductStock
* @return
*/
public List<WmsProductStock> selectWmsProductStockJoinList(WmsProductStock wmsProductStock);
} }

@ -0,0 +1,61 @@
package com.hw.wms.mapper;
import java.util.List;
import com.hw.wms.domain.WmsTransferDetail;
/**
* Mapper
*
* @author xins
* @date 2024-01-15
*/
public interface WmsTransferDetailMapper
{
/**
*
*
* @param transferDetailId
* @return
*/
public WmsTransferDetail selectWmsTransferDetailByTransferDetailId(Long transferDetailId);
/**
*
*
* @param wmsTransferDetail
* @return
*/
public List<WmsTransferDetail> selectWmsTransferDetailList(WmsTransferDetail wmsTransferDetail);
/**
*
*
* @param wmsTransferDetail
* @return
*/
public int insertWmsTransferDetail(WmsTransferDetail wmsTransferDetail);
/**
*
*
* @param wmsTransferDetail
* @return
*/
public int updateWmsTransferDetail(WmsTransferDetail wmsTransferDetail);
/**
*
*
* @param transferDetailId
* @return
*/
public int deleteWmsTransferDetailByTransferDetailId(Long transferDetailId);
/**
*
*
* @param transferDetailIds
* @return
*/
public int deleteWmsTransferDetailByTransferDetailIds(Long[] transferDetailIds);
}

@ -58,4 +58,12 @@ public interface IWmsProductStockService
* @return * @return
*/ */
public int deleteWmsProductStockByProductStockId(Long productStockId); public int deleteWmsProductStockByProductStockId(Long productStockId);
/**
* ,Join material,totalAmount>0
*
* @param wmsProductStock
* @return
*/
public List<WmsProductStock> selectWmsProductStockJoinList(WmsProductStock wmsProductStock);
} }

@ -0,0 +1,25 @@
package com.hw.wms.service;
import com.hw.wms.domain.WmsTransfer;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* @Description:
* @ClassName: IWmsTransactionalService
* @Author : xins
* @Date :2024-01-15 10:29
* @Version :1.0
*/
public interface IWmsTransactionalService {
/**
* @Description:
* @ClassName: WmsTransactionalServiceImpl
* @Author : xins
* @Date :2024-01-15 10:37
* @Version :1.0
*/
public void applyTransfer(WmsTransfer wmsTransfer, String userName, Date currentDate);
}

@ -90,4 +90,19 @@ public class WmsProductStockServiceImpl implements IWmsProductStockService
{ {
return wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStockId); return wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStockId);
} }
/**
* ,Join material,totalAmount>0
*
* @param wmsProductStock
* @return
*/
@Override
public List<WmsProductStock> selectWmsProductStockJoinList(WmsProductStock wmsProductStock)
{
return wmsProductStockMapper.selectWmsProductStockJoinList(wmsProductStock);
}
} }

@ -0,0 +1,70 @@
package com.hw.wms.service.impl;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.exception.ServiceException;
import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.domain.WmsTransfer;
import com.hw.wms.mapper.WmsProductStockMapper;
import com.hw.wms.mapper.WmsTransferMapper;
import com.hw.wms.service.IWmsTransactionalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Description:
* @ProjectName:HwMes
* @Author:xins
* @Date:2024-01-15 10:29
* @Version:1.0
*/
@Service
public class WmsTransactionalServiceImpl implements IWmsTransactionalService {
@Autowired
private WmsProductStockMapper wmsProductStockMapper;
@Autowired
private WmsTransferMapper wmsTransferMapper;
/**
* @Description:
* @ClassName: WmsTransactionalServiceImpl
* @Author : xins
* @Date :2024-01-15 10:37
* @Version :1.0
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void applyTransfer(WmsTransfer wmsTransfer, String userName, Date currentDate) {
BigDecimal applyQty = wmsTransfer.getApplyQty();
String productBatch = wmsTransfer.getProductBatch();
String oriLocationCode = wmsTransfer.getOriLocationCode();
WmsProductStock wmsProductStock = wmsProductStockMapper.selectProductStockByLocationAndBatch(oriLocationCode, productBatch);
if (wmsProductStock == null) {
throw new ServiceException("库位["+oriLocationCode+"]没有此批次["+productBatch+"]的库存");
}
BigDecimal totalAmount = wmsProductStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsProductStock.getTotalAmount();
BigDecimal frozenAmount = wmsProductStock.getFrozenAmount() == null ? BigDecimal.ZERO : wmsProductStock.getFrozenAmount();
BigDecimal occupyAmount = wmsProductStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsProductStock.getOccupyAmount();
BigDecimal avaialableAmount = totalAmount.subtract(frozenAmount).subtract(occupyAmount);
if (avaialableAmount.compareTo(applyQty) < 0) {
throw new ServiceException("库位["+oriLocationCode+"],批次["+productBatch+"]的申请数量不能大于" + avaialableAmount);
}
wmsProductStock.setOccupyAmount(occupyAmount.add(applyQty));
wmsProductStockMapper.updateWmsProductStock(wmsProductStock);
wmsTransfer.setApplyBy(userName);
wmsTransfer.setApplyDate(currentDate);
wmsTransfer.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsTransfer.setTransferType(WmsConstants.WMS_TRANSFER_TYPE_OUT_TO_PRODUCT_STOCK);
wmsTransfer.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
wmsTransferMapper.insertWmsTransfer(wmsTransfer);
}
}

@ -23,6 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateDate" column="update_date" /> <result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" /> <result property="activeFlag" column="active_flag" />
<result property="instockDate" column="instock_date" /> <result property="instockDate" column="instock_date" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
</resultMap> </resultMap>
<sql id="selectWmsProductStockVo"> <sql id="selectWmsProductStockVo">
@ -166,10 +168,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null ">and update_date = #{updateDate}</if> <if test="updateDate != null ">and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if> <if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and instock_date = #{instockDate}</if> <if test="instockDate != null ">and instock_date = #{instockDate}</if>
and totalAmoun>0 and totalAmount>0
</where> </where>
</select> </select>
<select id="selectWmsProductStockJoinList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wps.product_stock_id, wps.warehouse_id, wps.location_code, wps.stock_type, wps.product_batch, wps.quality_status, wps.product_id,
wps.plan_code, wps.plan_detail_code, wps.total_amount, wps.frozen_amount, wps.occupy_amount, wps.active_flag, wps.instock_date,
mai.material_code,mai.material_name
from wms_product_stock wps left join mes_material_info mai on wps.product_id = mai.material_id
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
and totalAmount>0
</where>
</select>
</mapper> </mapper>

@ -0,0 +1,134 @@
<?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="com.hw.wms.mapper.WmsTransferDetailMapper">
<resultMap type="WmsTransferDetail" id="WmsTransferDetailResult">
<result property="transferDetailId" column="transfer_detail_id" />
<result property="transferId" column="transfer_id" />
<result property="locationCode" column="location_code" />
<result property="materialBarcode" column="material_barcode" />
<result property="instockBatch" column="instock_batch" />
<result property="materialId" column="material_id" />
<result property="planAmount" column="plan_amount" />
<result property="realAmount" column="real_amount" />
<result property="executeStatus" column="execute_status" />
<result property="executePerson" column="execute_person" />
<result property="executeTime" column="execute_time" />
<result property="transferDetailType" column="transfer_detail_type" />
<result property="machineName" column="machine_name" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
</resultMap>
<sql id="selectWmsTransferDetailVo">
select transfer_detail_id, transfer_id, location_code, material_barcode, instock_batch, material_id, plan_amount, real_amount, execute_status, execute_person, execute_time, transfer_detail_type, machine_name, create_by, create_date, update_by, update_date, active_flag from wms_transfer_detail
</sql>
<select id="selectWmsTransferDetailList" parameterType="WmsTransferDetail" resultMap="WmsTransferDetailResult">
<include refid="selectWmsTransferDetailVo"/>
<where>
<if test="transferId != null "> and transfer_id = #{transferId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="instockBatch != null and instockBatch != ''"> and instock_batch = #{instockBatch}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="planAmount != null "> and plan_amount = #{planAmount}</if>
<if test="realAmount != null "> and real_amount = #{realAmount}</if>
<if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if>
<if test="executePerson != null and executePerson != ''"> and execute_person = #{executePerson}</if>
<if test="executeTime != null "> and execute_time = #{executeTime}</if>
<if test="transferDetailType != null and transferDetailType != ''"> and transfer_detail_type = #{transferDetailType}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
</where>
</select>
<select id="selectWmsTransferDetailByTransferDetailId" parameterType="Long" resultMap="WmsTransferDetailResult">
<include refid="selectWmsTransferDetailVo"/>
where transfer_detail_id = #{transferDetailId}
</select>
<insert id="insertWmsTransferDetail" parameterType="WmsTransferDetail" useGeneratedKeys="true" keyProperty="transferDetailId">
insert into wms_transfer_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="transferId != null">transfer_id,</if>
<if test="locationCode != null and locationCode != ''">location_code,</if>
<if test="materialBarcode != null and materialBarcode != ''">material_barcode,</if>
<if test="instockBatch != null">instock_batch,</if>
<if test="materialId != null">material_id,</if>
<if test="planAmount != null">plan_amount,</if>
<if test="realAmount != null">real_amount,</if>
<if test="executeStatus != null and executeStatus != ''">execute_status,</if>
<if test="executePerson != null">execute_person,</if>
<if test="executeTime != null">execute_time,</if>
<if test="transferDetailType != null and transferDetailType != ''">transfer_detail_type,</if>
<if test="machineName != null">machine_name,</if>
<if test="createBy != null">create_by,</if>
<if test="createDate != null">create_date,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="transferId != null">#{transferId},</if>
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
<if test="materialBarcode != null and materialBarcode != ''">#{materialBarcode},</if>
<if test="instockBatch != null">#{instockBatch},</if>
<if test="materialId != null">#{materialId},</if>
<if test="planAmount != null">#{planAmount},</if>
<if test="realAmount != null">#{realAmount},</if>
<if test="executeStatus != null and executeStatus != ''">#{executeStatus},</if>
<if test="executePerson != null">#{executePerson},</if>
<if test="executeTime != null">#{executeTime},</if>
<if test="transferDetailType != null and transferDetailType != ''">#{transferDetailType},</if>
<if test="machineName != null">#{machineName},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createDate != null">#{createDate},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</insert>
<update id="updateWmsTransferDetail" parameterType="WmsTransferDetail">
update wms_transfer_detail
<trim prefix="SET" suffixOverrides=",">
<if test="transferId != null">transfer_id = #{transferId},</if>
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="materialBarcode != null and materialBarcode != ''">material_barcode = #{materialBarcode},</if>
<if test="instockBatch != null">instock_batch = #{instockBatch},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="realAmount != null">real_amount = #{realAmount},</if>
<if test="executeStatus != null and executeStatus != ''">execute_status = #{executeStatus},</if>
<if test="executePerson != null">execute_person = #{executePerson},</if>
<if test="executeTime != null">execute_time = #{executeTime},</if>
<if test="transferDetailType != null and transferDetailType != ''">transfer_detail_type = #{transferDetailType},</if>
<if test="machineName != null">machine_name = #{machineName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
<if test="activeFlag != null">active_flag = #{activeFlag},</if>
</trim>
where transfer_detail_id = #{transferDetailId}
</update>
<delete id="deleteWmsTransferDetailByTransferDetailId" parameterType="Long">
delete from wms_transfer_detail where transfer_detail_id = #{transferDetailId}
</delete>
<delete id="deleteWmsTransferDetailByTransferDetailIds" parameterType="String">
delete from wms_transfer_detail where transfer_detail_id in
<foreach item="transferDetailId" collection="array" open="(" separator="," close=")">
#{transferDetailId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save