5 changed files with 855 additions and 0 deletions
@ -0,0 +1,52 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
import java.util.List; |
|||
|
|||
public class OutsourceStorage extends BaseEntity { |
|||
|
|||
// 关联订单号(委外订单编号)
|
|||
private String relatedOrderCode; |
|||
|
|||
/** 通知已到货数量 */ |
|||
private Integer notifyArrivedNum; |
|||
|
|||
// 委外计划号
|
|||
private String outsourcePlanCode; |
|||
// 委外入库单详情
|
|||
private List<OutsourceStorageDetail> storageDetailList; |
|||
|
|||
public String getRelatedOrderCode() { |
|||
return relatedOrderCode; |
|||
} |
|||
|
|||
public void setRelatedOrderCode(String relatedOrderCode) { |
|||
this.relatedOrderCode = relatedOrderCode; |
|||
} |
|||
|
|||
public Integer getNotifyArrivedNum() { |
|||
return notifyArrivedNum; |
|||
} |
|||
|
|||
public void setNotifyArrivedNum(Integer notifyArrivedNum) { |
|||
this.notifyArrivedNum = notifyArrivedNum; |
|||
} |
|||
|
|||
public List<OutsourceStorageDetail> getStorageDetailList() { |
|||
return storageDetailList; |
|||
} |
|||
|
|||
public void setStorageDetailList(List<OutsourceStorageDetail> storageDetailList) { |
|||
this.storageDetailList = storageDetailList; |
|||
} |
|||
|
|||
public String getOutsourcePlanCode() { |
|||
return outsourcePlanCode; |
|||
} |
|||
|
|||
public void setOutsourcePlanCode(String outsourcePlanCode) { |
|||
this.outsourcePlanCode = outsourcePlanCode; |
|||
} |
|||
} |
@ -0,0 +1,260 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
import com.ruoyi.warehouse.domain.WarehouseStorageOrder; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
|
|||
//委外入库单详情类
|
|||
public class OutsourceStorageDetail extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 委外入库单详情id */ |
|||
private Long outsourceStorageDetailId; |
|||
|
|||
/** 委外入库单号 */ |
|||
@Excel(name = "委外入库单号") |
|||
private String warehouseStorageCode; |
|||
|
|||
// 委外计划号
|
|||
private String outsourcePlanCode; |
|||
/** 委外订单编号 */ |
|||
@Excel(name = "委外订单编号") |
|||
private String outsourceOrderNo; |
|||
|
|||
/** 料号 */ |
|||
@Excel(name = "料号") |
|||
private String materialNo; |
|||
|
|||
/** 物料名称 */ |
|||
private String materialName; |
|||
|
|||
/** 物料类型 */ |
|||
private String materialType; |
|||
|
|||
/** 物料图片 */ |
|||
private String materialPhotoUrl; |
|||
|
|||
/** 单位 */ |
|||
private String unit; |
|||
|
|||
/** 描述 */ |
|||
private String description; |
|||
|
|||
/** 品牌 */ |
|||
private String brand; |
|||
|
|||
/** 加工方式 */ |
|||
private String processMethod; |
|||
|
|||
/** 计划委外数 */ |
|||
private BigDecimal plannedOutsourceAmount; |
|||
|
|||
// 实际委外数
|
|||
private BigDecimal actualOutsourceAmount; |
|||
|
|||
// 关联单号
|
|||
private String correlationCodes; |
|||
|
|||
// 委外工序信息
|
|||
private String outsourceProcessInfo; |
|||
|
|||
// 计价单位信息
|
|||
private String chargeUnitInfo; |
|||
|
|||
// 每个物料规格信息
|
|||
private String singleMaterialInfo; |
|||
|
|||
// 供应商信息
|
|||
private String supplierInfo; |
|||
|
|||
// 交付时间信息
|
|||
private String deliveryTimeInfo; |
|||
|
|||
/** 已委外入库数 */ |
|||
@Excel(name = "已委外入库数") |
|||
private BigDecimal takenMaterial; |
|||
|
|||
/** 本次委外入库数 */ |
|||
@Excel(name = "本次委外入库数") |
|||
private BigDecimal takingMaterial; |
|||
|
|||
public Long getOutsourceStorageDetailId() { |
|||
return outsourceStorageDetailId; |
|||
} |
|||
|
|||
public void setOutsourceStorageDetailId(Long outsourceStorageOrderDetailId) { |
|||
this.outsourceStorageDetailId = outsourceStorageOrderDetailId; |
|||
} |
|||
|
|||
public String getWarehouseStorageCode() { |
|||
return warehouseStorageCode; |
|||
} |
|||
|
|||
public void setWarehouseStorageCode(String warehouseStorageCode) { |
|||
this.warehouseStorageCode = warehouseStorageCode; |
|||
} |
|||
|
|||
public String getOutsourceOrderNo() { |
|||
return outsourceOrderNo; |
|||
} |
|||
|
|||
public void setOutsourceOrderNo(String outsourceOrderNo) { |
|||
this.outsourceOrderNo = outsourceOrderNo; |
|||
} |
|||
|
|||
public String getMaterialNo() { |
|||
return materialNo; |
|||
} |
|||
|
|||
public void setMaterialNo(String materialNo) { |
|||
this.materialNo = materialNo; |
|||
} |
|||
|
|||
public String getMaterialName() { |
|||
return materialName; |
|||
} |
|||
|
|||
public void setMaterialName(String materialName) { |
|||
this.materialName = materialName; |
|||
} |
|||
|
|||
public String getMaterialType() { |
|||
return materialType; |
|||
} |
|||
|
|||
public void setMaterialType(String materialType) { |
|||
this.materialType = materialType; |
|||
} |
|||
|
|||
public String getMaterialPhotoUrl() { |
|||
return materialPhotoUrl; |
|||
} |
|||
|
|||
public void setMaterialPhotoUrl(String materialPhotoUrl) { |
|||
this.materialPhotoUrl = materialPhotoUrl; |
|||
} |
|||
|
|||
public String getUnit() { |
|||
return unit; |
|||
} |
|||
|
|||
public void setUnit(String unit) { |
|||
this.unit = unit; |
|||
} |
|||
|
|||
public String getDescription() { |
|||
return description; |
|||
} |
|||
|
|||
public void setDescription(String description) { |
|||
this.description = description; |
|||
} |
|||
|
|||
public String getBrand() { |
|||
return brand; |
|||
} |
|||
|
|||
public void setBrand(String brand) { |
|||
this.brand = brand; |
|||
} |
|||
|
|||
public String getProcessMethod() { |
|||
return processMethod; |
|||
} |
|||
|
|||
public void setProcessMethod(String processMethod) { |
|||
this.processMethod = processMethod; |
|||
} |
|||
|
|||
public BigDecimal getPlannedOutsourceAmount() { |
|||
return plannedOutsourceAmount; |
|||
} |
|||
|
|||
public void setPlannedOutsourceAmount(BigDecimal plannedOutsourceAmount) { |
|||
this.plannedOutsourceAmount = plannedOutsourceAmount; |
|||
} |
|||
|
|||
public BigDecimal getActualOutsourceAmount() { |
|||
return actualOutsourceAmount; |
|||
} |
|||
|
|||
public void setActualOutsourceAmount(BigDecimal actualOutsourceAmount) { |
|||
this.actualOutsourceAmount = actualOutsourceAmount; |
|||
} |
|||
|
|||
public String getCorrelationCodes() { |
|||
return correlationCodes; |
|||
} |
|||
|
|||
public void setCorrelationCodes(String correlationCodes) { |
|||
this.correlationCodes = correlationCodes; |
|||
} |
|||
|
|||
public String getOutsourceProcessInfo() { |
|||
return outsourceProcessInfo; |
|||
} |
|||
|
|||
public void setOutsourceProcessInfo(String outsourceProcessInfo) { |
|||
this.outsourceProcessInfo = outsourceProcessInfo; |
|||
} |
|||
|
|||
public String getChargeUnitInfo() { |
|||
return chargeUnitInfo; |
|||
} |
|||
|
|||
public void setChargeUnitInfo(String chargeUnitInfo) { |
|||
this.chargeUnitInfo = chargeUnitInfo; |
|||
} |
|||
|
|||
public String getSingleMaterialInfo() { |
|||
return singleMaterialInfo; |
|||
} |
|||
|
|||
public void setSingleMaterialInfo(String singleMaterialInfo) { |
|||
this.singleMaterialInfo = singleMaterialInfo; |
|||
} |
|||
|
|||
public String getSupplierInfo() { |
|||
return supplierInfo; |
|||
} |
|||
|
|||
public void setSupplierInfo(String supplierInfo) { |
|||
this.supplierInfo = supplierInfo; |
|||
} |
|||
|
|||
public String getDeliveryTimeInfo() { |
|||
return deliveryTimeInfo; |
|||
} |
|||
|
|||
public void setDeliveryTimeInfo(String deliveryTimeInfo) { |
|||
this.deliveryTimeInfo = deliveryTimeInfo; |
|||
} |
|||
|
|||
public BigDecimal getTakenMaterial() { |
|||
return takenMaterial; |
|||
} |
|||
|
|||
public void setTakenMaterial(BigDecimal takenMaterial) { |
|||
this.takenMaterial = takenMaterial; |
|||
} |
|||
|
|||
public BigDecimal getTakingMaterial() { |
|||
return takingMaterial; |
|||
} |
|||
|
|||
public void setTakingMaterial(BigDecimal takingMaterial) { |
|||
this.takingMaterial = takingMaterial; |
|||
} |
|||
|
|||
public String getOutsourcePlanCode() { |
|||
return outsourcePlanCode; |
|||
} |
|||
|
|||
public void setOutsourcePlanCode(String outsourcePlanCode) { |
|||
this.outsourcePlanCode = outsourcePlanCode; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,80 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.OutsourceStorageDetail; |
|||
|
|||
/** |
|||
* 委外入库详情Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-13 |
|||
*/ |
|||
public interface OutsourceStorageDetailMapper |
|||
{ |
|||
/** |
|||
* 查询委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetailId 委外入库详情ID |
|||
* @return 委外入库详情 |
|||
*/ |
|||
public OutsourceStorageDetail selectOutsourceStorageDetailById(Long outsourceStorageDetailId); |
|||
|
|||
/** |
|||
* 查询委外入库详情列表 |
|||
* |
|||
* @param outsourceStorageDetail 委外入库详情 |
|||
* @return 委外入库详情集合 |
|||
*/ |
|||
public List<OutsourceStorageDetail> selectOutsourceStorageDetailList(OutsourceStorageDetail outsourceStorageDetail); |
|||
|
|||
/** |
|||
* 新增委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetail 委外入库详情 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertOutsourceStorageDetail(OutsourceStorageDetail outsourceStorageDetail); |
|||
|
|||
/** |
|||
* 修改委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetail 委外入库详情 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateOutsourceStorageDetail(OutsourceStorageDetail outsourceStorageDetail); |
|||
|
|||
/** |
|||
* 删除委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetailId 委外入库详情ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteOutsourceStorageDetailById(Long outsourceStorageDetailId); |
|||
|
|||
/** |
|||
* 批量删除委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetailIds 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteOutsourceStorageDetailByIds(String[] outsourceStorageDetailIds); |
|||
|
|||
/** |
|||
* 作废委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetailId 委外入库详情ID |
|||
* @return 结果 |
|||
*/ |
|||
public int cancelOutsourceStorageDetailById(Long outsourceStorageDetailId); |
|||
|
|||
/** |
|||
* 恢复委外入库详情 |
|||
* |
|||
* @param outsourceStorageDetailId 委外入库详情ID |
|||
* @return 结果 |
|||
*/ |
|||
public int restoreOutsourceStorageDetailById(Long outsourceStorageDetailId); |
|||
|
|||
// 根据入库单号查询委外入库单详情
|
|||
public List<OutsourceStorageDetail> selectOutsourceStorageDetailByStorageCode(String storageCode); |
|||
} |
@ -0,0 +1,170 @@ |
|||
<?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.ruoyi.system.mapper.OutsourceStorageDetailMapper"> |
|||
|
|||
<resultMap type="OutsourceStorageDetail" id="OutsourceStorageDetailResult"> |
|||
<result property="outsourceStorageDetailId" column="outsource_storage_detail_id" /> |
|||
<result property="warehouseStorageCode" column="warehouse_storage_code" /> |
|||
<result property="outsourceOrderNo" column="outsource_order_no" /> |
|||
<result property="outsourcePlanCode" column="outsource_plan_code" /> |
|||
<result property="correlationCodes" column="correlation_codes" /> |
|||
<result property="materialNo" column="material_no" /> |
|||
<result property="materialName" column="material_name" /> |
|||
<result property="materialType" column="material_type" /> |
|||
<result property="materialPhotoUrl" column="material_photo_url" /> |
|||
<result property="description" column="description" /> |
|||
<result property="brand" column="brand" /> |
|||
<result property="unit" column="unit" /> |
|||
<result property="processMethod" column="process_method" /> |
|||
<result property="plannedOutsourceAmount" column="planned_outsource_amount" /> |
|||
<result property="actualOutsourceAmount" column="actual_outsource_amount" /> |
|||
<result property="takenMaterial" column="taken_material" /> |
|||
<result property="takingMaterial" column="taking_material" /> |
|||
<result property="outsourceProcessInfo" column="outsource_process_info" /> |
|||
<result property="chargeUnitInfo" column="charge_unit_info" /> |
|||
<result property="singleMaterialInfo" column="single_material_info" /> |
|||
<result property="supplierInfo" column="supplier_info" /> |
|||
<result property="deliveryTimeInfo" column="delivery_time_info" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectOutsourceStorageDetailVo"> |
|||
select outsource_storage_detail_id, warehouse_storage_code, outsource_order_no, outsource_plan_code, correlation_codes, material_no, material_name, material_type, material_photo_url, description, brand, unit, process_method, planned_outsource_amount, actual_outsource_amount, taken_material, taking_material, outsource_process_info, charge_unit_info, single_material_info, supplier_info, delivery_time_info from outsource_storage_detail |
|||
</sql> |
|||
|
|||
<select id="selectOutsourceStorageDetailList" parameterType="OutsourceStorageDetail" resultMap="OutsourceStorageDetailResult"> |
|||
<include refid="selectOutsourceStorageDetailVo"/> |
|||
<where> |
|||
<if test="warehouseStorageCode != null and warehouseStorageCode != ''"> and warehouse_storage_code = #{warehouseStorageCode}</if> |
|||
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsource_order_no = #{outsourceOrderNo}</if> |
|||
<if test="outsourcePlanCode != null and outsourcePlanCode != ''"> and outsource_plan_code = #{outsourcePlanCode}</if> |
|||
<if test="correlationCodes != null and correlationCodes != ''"> and correlation_codes = #{correlationCodes}</if> |
|||
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
|||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
|||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
|||
<if test="materialPhotoUrl != null and materialPhotoUrl != ''"> and material_photo_url = #{materialPhotoUrl}</if> |
|||
<if test="description != null and description != ''"> and description = #{description}</if> |
|||
<if test="brand != null and brand != ''"> and brand = #{brand}</if> |
|||
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
|||
<if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if> |
|||
<if test="plannedOutsourceAmount != null "> and planned_outsource_amount = #{plannedOutsourceAmount}</if> |
|||
<if test="actualOutsourceAmount != null "> and actual_outsource_amount = #{actualOutsourceAmount}</if> |
|||
<if test="takenMaterial != null "> and taken_material = #{takenMaterial}</if> |
|||
<if test="takingMaterial != null "> and taking_material = #{takingMaterial}</if> |
|||
<if test="outsourceProcessInfo != null and outsourceProcessInfo != ''"> and outsource_process_info = #{outsourceProcessInfo}</if> |
|||
<if test="chargeUnitInfo != null and chargeUnitInfo != ''"> and charge_unit_info = #{chargeUnitInfo}</if> |
|||
<if test="singleMaterialInfo != null and singleMaterialInfo != ''"> and single_material_info = #{singleMaterialInfo}</if> |
|||
<if test="supplierInfo != null and supplierInfo != ''"> and supplier_info = #{supplierInfo}</if> |
|||
<if test="deliveryTimeInfo != null and deliveryTimeInfo != ''"> and delivery_time_info = #{deliveryTimeInfo}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectOutsourceStorageDetailById" parameterType="Long" resultMap="OutsourceStorageDetailResult"> |
|||
<include refid="selectOutsourceStorageDetailVo"/> |
|||
where outsource_storage_detail_id = #{outsourceStorageDetailId} |
|||
</select> |
|||
|
|||
<insert id="insertOutsourceStorageDetail" parameterType="OutsourceStorageDetail" useGeneratedKeys="true" keyProperty="outsourceStorageDetailId"> |
|||
insert into outsource_storage_detail |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="warehouseStorageCode != null and warehouseStorageCode != ''">warehouse_storage_code,</if> |
|||
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">outsource_order_no,</if> |
|||
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code,</if> |
|||
<if test="correlationCodes != null">correlation_codes,</if> |
|||
<if test="materialNo != null and materialNo != ''">material_no,</if> |
|||
<if test="materialName != null">material_name,</if> |
|||
<if test="materialType != null">material_type,</if> |
|||
<if test="materialPhotoUrl != null">material_photo_url,</if> |
|||
<if test="description != null">description,</if> |
|||
<if test="brand != null">brand,</if> |
|||
<if test="unit != null">unit,</if> |
|||
<if test="processMethod != null">process_method,</if> |
|||
<if test="plannedOutsourceAmount != null">planned_outsource_amount,</if> |
|||
<if test="actualOutsourceAmount != null">actual_outsource_amount,</if> |
|||
<if test="takenMaterial != null">taken_material,</if> |
|||
<if test="takingMaterial != null">taking_material,</if> |
|||
<if test="outsourceProcessInfo != null">outsource_process_info,</if> |
|||
<if test="chargeUnitInfo != null">charge_unit_info,</if> |
|||
<if test="singleMaterialInfo != null">single_material_info,</if> |
|||
<if test="supplierInfo != null">supplier_info,</if> |
|||
<if test="deliveryTimeInfo != null">delivery_time_info,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="warehouseStorageCode != null and warehouseStorageCode != ''">#{warehouseStorageCode},</if> |
|||
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">#{outsourceOrderNo},</if> |
|||
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">#{outsourcePlanCode},</if> |
|||
<if test="correlationCodes != null">#{correlationCodes},</if> |
|||
<if test="materialNo != null and materialNo != ''">#{materialNo},</if> |
|||
<if test="materialName != null">#{materialName},</if> |
|||
<if test="materialType != null">#{materialType},</if> |
|||
<if test="materialPhotoUrl != null">#{materialPhotoUrl},</if> |
|||
<if test="description != null">#{description},</if> |
|||
<if test="brand != null">#{brand},</if> |
|||
<if test="unit != null">#{unit},</if> |
|||
<if test="processMethod != null">#{processMethod},</if> |
|||
<if test="plannedOutsourceAmount != null">#{plannedOutsourceAmount},</if> |
|||
<if test="actualOutsourceAmount != null">#{actualOutsourceAmount},</if> |
|||
<if test="takenMaterial != null">#{takenMaterial},</if> |
|||
<if test="takingMaterial != null">#{takingMaterial},</if> |
|||
<if test="outsourceProcessInfo != null">#{outsourceProcessInfo},</if> |
|||
<if test="chargeUnitInfo != null">#{chargeUnitInfo},</if> |
|||
<if test="singleMaterialInfo != null">#{singleMaterialInfo},</if> |
|||
<if test="supplierInfo != null">#{supplierInfo},</if> |
|||
<if test="deliveryTimeInfo != null">#{deliveryTimeInfo},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateOutsourceStorageDetail" parameterType="OutsourceStorageDetail"> |
|||
update outsource_storage_detail |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="warehouseStorageCode != null and warehouseStorageCode != ''">warehouse_storage_code = #{warehouseStorageCode},</if> |
|||
<if test="outsourceOrderNo != null and outsourceOrderNo != ''">outsource_order_no = #{outsourceOrderNo},</if> |
|||
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code = #{outsourcePlanCode},</if> |
|||
<if test="correlationCodes != null">correlation_codes = #{correlationCodes},</if> |
|||
<if test="materialNo != null and materialNo != ''">material_no = #{materialNo},</if> |
|||
<if test="materialName != null">material_name = #{materialName},</if> |
|||
<if test="materialType != null">material_type = #{materialType},</if> |
|||
<if test="materialPhotoUrl != null">material_photo_url = #{materialPhotoUrl},</if> |
|||
<if test="description != null">description = #{description},</if> |
|||
<if test="brand != null">brand = #{brand},</if> |
|||
<if test="unit != null">unit = #{unit},</if> |
|||
<if test="processMethod != null">process_method = #{processMethod},</if> |
|||
<if test="plannedOutsourceAmount != null">planned_outsource_amount = #{plannedOutsourceAmount},</if> |
|||
<if test="actualOutsourceAmount != null">actual_outsource_amount = #{actualOutsourceAmount},</if> |
|||
<if test="takenMaterial != null">taken_material = #{takenMaterial},</if> |
|||
<if test="takingMaterial != null">taking_material = #{takingMaterial},</if> |
|||
<if test="outsourceProcessInfo != null">outsource_process_info = #{outsourceProcessInfo},</if> |
|||
<if test="chargeUnitInfo != null">charge_unit_info = #{chargeUnitInfo},</if> |
|||
<if test="singleMaterialInfo != null">single_material_info = #{singleMaterialInfo},</if> |
|||
<if test="supplierInfo != null">supplier_info = #{supplierInfo},</if> |
|||
<if test="deliveryTimeInfo != null">delivery_time_info = #{deliveryTimeInfo},</if> |
|||
</trim> |
|||
where outsource_storage_detail_id = #{outsourceStorageDetailId} |
|||
</update> |
|||
|
|||
<delete id="deleteOutsourceStorageDetailById" parameterType="Long"> |
|||
delete from outsource_storage_detail where outsource_storage_detail_id = #{outsourceStorageDetailId} |
|||
</delete> |
|||
|
|||
<delete id="deleteOutsourceStorageDetailByIds" parameterType="String"> |
|||
delete from outsource_storage_detail where outsource_storage_detail_id in |
|||
<foreach item="outsourceStorageDetailId" collection="array" open="(" separator="," close=")"> |
|||
#{outsourceStorageDetailId} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelOutsourceStorageDetailById" parameterType="Long"> |
|||
update outsource_storage_detail set del_flag = '1' where outsource_storage_detail_id = #{outsourceStorageDetailId} |
|||
</update> |
|||
|
|||
<update id="restoreOutsourceStorageDetailById" parameterType="Long"> |
|||
update outsource_storage_detail set del_flag = '0' where outsource_storage_detail_id = #{outsourceStorageDetailId} |
|||
</update> |
|||
|
|||
<select id="selectOutsourceStorageDetailByStorageCode" parameterType="String" resultMap="OutsourceStorageDetailResult"> |
|||
<include refid="selectOutsourceStorageDetailVo"/> |
|||
where warehouse_storage_code = #{warehouseStorageCode} |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,293 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('委外入库单详情')" /> |
|||
<th:block th:include="include :: select2-css" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
<th:block th:include="include :: bootstrap-editable-css" /> |
|||
</head> |
|||
<style> |
|||
.col-sm-12.material-table{ |
|||
height: 75px; |
|||
} |
|||
.hr-line-dashed { |
|||
border-top: 1px dashed #ddd; |
|||
margin-top: 20px; /* 调整间距 */ |
|||
border-bottom: 1px dashed #ddd; |
|||
margin-bottom: 20px; |
|||
} |
|||
|
|||
</style> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-order-outsourceStorage-detail" th:object="${outsourceStorage}"> |
|||
<div class="col-xs-11" > |
|||
<label class="col-sm-2 control-label" style="margin-left: 10px;">已选择委外计划:</label> |
|||
<div class="col-sm-8"> |
|||
<input id="outsourcePlanCode" name="outsourcePlanCode" class="form-control" th:field="*{outsourcePlanCode}" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="col-xs-11" style="margin-left: 60px;height: 20px;"> |
|||
<div class="hr-line-dashed" > |
|||
</div> |
|||
</div> |
|||
<div class="container" id="material"> |
|||
|
|||
</div> |
|||
</form> |
|||
<!-- 订单合计--> |
|||
<div class="container"> |
|||
<div class="row"><h4 class="card-header">订单合计:</h4></div> |
|||
<div class="col-xs-12"> |
|||
<div class="col-sm-6"> |
|||
<label for="materialAmount" class="col-sm-4 col-form-label">物料合计:</label> |
|||
<div class="col-sm-6"> |
|||
<input type="text" class="form-control" value="0" id="materialAmount" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<label for="nowStorageTotalAmount" class="col-sm-4 col-form-label">申请入库数量合计:</label> |
|||
<div class="col-sm-6"> |
|||
<input type="text" class="form-control" value="0" id="nowStorageTotalAmount" disabled> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: select2-js" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/outsource_storage"; |
|||
$("#form-order-outsourceStorage-detail").validate({focusCleanup: true}); |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
var formId = "form-order-outsourceStorage-add"; |
|||
var outsourcePlanCode = ''; |
|||
var materialList = []; |
|||
var tableIdList = []; |
|||
var $processContent; |
|||
var $supplierheaderContent; |
|||
var materials; |
|||
var outsourceStorage = [[${outsourceStorage}]]; |
|||
var originMaterial = [] |
|||
|
|||
$(function() { |
|||
|
|||
originMaterial = outsourceStorage.storageDetailList; |
|||
// 根据料号去重 |
|||
materials = mergeRecords(originMaterial); |
|||
$("#outsourcePlanCode").val(originMaterial[0].outsourcePlanCode); |
|||
$("#materialAmount").val(originMaterial.length); |
|||
var totalAmount = 0; |
|||
materials.forEach(function (material, index) { |
|||
var takingNum = Number(material.takingMaterial); |
|||
if(!isNaN(takingNum)){ |
|||
totalAmount += takingNum; |
|||
} |
|||
}); |
|||
$("#nowStorageTotalAmount").val(totalAmount); |
|||
|
|||
|
|||
materials.forEach(function (material, index) { |
|||
var tableId = 'materialNo-' + (index+1); |
|||
var materialTable = "bootstrap-table_" + tableId; |
|||
tableIdList.push(tableId); |
|||
// 创建物料信息的容器 |
|||
var $tableWrapper = $('<div id="material-' + tableId + '"></div>'); |
|||
// 将整个物料信息容器添加到页面 |
|||
$('#material').append($tableWrapper); |
|||
// 添加关联销售订单号信息 |
|||
var $headerDiv = |
|||
$('<div class="row">' + |
|||
'<div class="col-xs-12" >' + |
|||
'<h3>' + |
|||
'<span><strong>物料 ' + (index+1) + ': </strong> ' + '<strong>关联订单号: </strong></span>' + '<span class="correlationCodes" style="color: blue" id="correlationCodes-' + tableId + '"></span>' + |
|||
'</h3>' + |
|||
'<div class="col-sm-12 material-table">' + |
|||
'<table class="table-materialNo" id="' + materialTable + '">' + '</table>' + |
|||
'</div>' + |
|||
'</div>' + |
|||
'</div>'); |
|||
$tableWrapper.append($headerDiv); |
|||
|
|||
$(".correlationCodes").text(material.correlationCodes); |
|||
|
|||
var materialObj = { |
|||
materialNo: material.materialNo, |
|||
materialPhotourl: material.materialPhotourl, |
|||
materialName: material.materialName, |
|||
materialType: material.materialType, |
|||
description: material.description, |
|||
unit: material.unit, |
|||
brand: material.brand, |
|||
processMethod: material.processMethod, |
|||
correlationCodes: material.correlationCodes, |
|||
plannedOutsourceAmount: material.plannedOutsourceAmount, |
|||
actualOutsourceAmount: material.actualOutsourceAmount, |
|||
alreadyStorageAmount: material.takenMaterial, |
|||
nowStorageAmount: material.takingMaterial, |
|||
}; |
|||
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源 |
|||
materialList.push(material); |
|||
tables(materialTable, materialData); |
|||
|
|||
var $MaterialNumDiv = |
|||
$('<div class="row" style="margin-top: 20px;margin-left: 10px;">' + |
|||
'<div class="form-group">' + |
|||
'<div class="col-xs-12">' + |
|||
'<h3>' + |
|||
'<span><strong>供应商</strong></span>' + |
|||
'</h3>' + |
|||
'</div>' + |
|||
'</div>' + |
|||
'</div>'); |
|||
$tableWrapper.append($MaterialNumDiv); |
|||
|
|||
var $processInfo = $('<div class="process-card" style="height: 60px;" id="processInfo-' + tableId + '"></div>'); |
|||
|
|||
if(material.processList.length <= 0){ |
|||
var $noProcessDiv = $('<div class="no-process">暂无委外工序信息,请先添加委外工序信息。</div>'); |
|||
$tableWrapper.append($noProcessDiv); |
|||
}else{ |
|||
material.processList.forEach(function(detail, detailsIndex) { |
|||
|
|||
var processSelectId = 'process-select-' + tableId + '_' + (detailsIndex+1); |
|||
var processTableId = 'process-' + tableId + '_' + (detailsIndex+1); |
|||
$processContent = |
|||
$('<div class="card-header process_card" id="process-' + tableId + '_' + (detailsIndex+1) + '" >' + |
|||
'<div class="row" style="margin-left: 25px;height: 20px">' + |
|||
'<div class="card-text">' + |
|||
'<h5>委外工序 ' + (detailsIndex+1) + ':' + |
|||
'<span style="color: blue" class="outsourceProcessInfo">' + detail.outsourceProcessInfo + '</span>' + |
|||
'</h5>' + |
|||
'</div>' + |
|||
'<div class="col-xs-12" style="padding-left: 0px;">' + |
|||
'<div class="col-sm-12" style="padding-left: 0px;" id="chargeUnit-'+processSelectId+'">' + |
|||
'<span class="chargeUnit" style="padding-right: 10px;">*计价单位:</span>' + |
|||
'<span class="chargeUnitInfo" style="padding-right: 80px;">' + detail.chargeUnitInfo + '</span>' + |
|||
'<span class="singleMaterial" style="padding-right: 10px;">每个物料:</span>' + |
|||
'<span class="singleMaterialInfo">' + detail.singleMaterialInfo + '</span>' + |
|||
'</div>' + |
|||
'</div>' + |
|||
'</div>' + |
|||
'</div>'); |
|||
|
|||
$tableWrapper.append($processContent); |
|||
$supplierheaderContent = |
|||
$('<div class="card-header suppplier_card" id = "supplier-' + processTableId + '_' + ' ">' + |
|||
'<div class="col-xs-12">' + |
|||
'<div class="col-sm-4" style="margin-top: 13px;padding-left: 10px;">' + |
|||
'<input type="radio" id="supplier-' + processTableId + '" name="supplier-' + processTableId + '" value="" checked>' + |
|||
'<span class="supplierInfo">' + detail.supplierInfo + '</span>' + |
|||
|
|||
'</div>' + |
|||
'<div class="col-sm-8 deliveryTime-'+processTableId+'" style="padding-top: 10px;padding-left: 0px;">' + |
|||
'<label class="col-sm-2" style="padding-left: 0px;margin-top: 5px;">计划交付时间: </label>' + |
|||
'<div class ="col-sm-4">' + |
|||
'<div class="input-group date"> ' + |
|||
'<input type="text" disabled name="deliveryTime" value="' + detail.deliveryTimeInfo + '" class="form-control supplierDeliveryTime" id="deliveryTime_' + processTableId + '">' + |
|||
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' + |
|||
'</div>' + |
|||
'</div>' + |
|||
'</div>'+ |
|||
|
|||
'</div>' + |
|||
'</div>'+ |
|||
'<div class="row">' + |
|||
'<div class="hr-line-dashed" style="margin-bottom: 0px;margin-top: 80px;">' + |
|||
'</div>' + |
|||
'</div>'); |
|||
$("#"+processTableId).append($supplierheaderContent); |
|||
$("input[name='deliveryTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
todayBtn: true, |
|||
autoClose: true |
|||
}); |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
function tables(tableId, data) { |
|||
$('#' + tableId).bootstrapTable({ |
|||
showExport: false, |
|||
showFooter: false, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showColumns: false, |
|||
showToggle: false, |
|||
data: data, |
|||
columns: [ |
|||
{title: '料号', field: 'materialNo'}, |
|||
{title: '图片', field: 'materialPhotourl', formatter: function (value, row, index) { |
|||
return $.table.imageView(value); |
|||
} |
|||
}, |
|||
{title: '物料名称', field: 'materialName'}, |
|||
{title: '物料描述', field: 'description'}, |
|||
{title: '品牌', field: 'brand'}, |
|||
{title: '单位', field: 'unit', align: 'center', }, |
|||
{title: '加工方式', field: 'processMethod', align: 'center', |
|||
formatter: function (value, row, index) { |
|||
return $.table.selectDictLabel(processMethodDatas, value); |
|||
} |
|||
}, |
|||
{title: '计划委外数', field: 'plannedOutsourceAmount'}, |
|||
{title: '实际委外数', field: 'actualOutsourceAmount'}, |
|||
{title: '已入库数', field: 'alreadyStorageAmount'}, |
|||
{title: '本次入库数', field: 'nowStorageAmount', |
|||
}, |
|||
], |
|||
}); |
|||
} |
|||
// 函数用于合并重复的material的记录 |
|||
function mergeRecords(items) { |
|||
return items.reduce((merged, current) => { |
|||
const existingRecord = merged.find(record => record.materialNo === current.materialNo); |
|||
if (existingRecord) { |
|||
if (!existingRecord.processList) { |
|||
existingRecord.processList = []; |
|||
} |
|||
existingRecord.processList.push({ |
|||
outsourceProcessInfo: current.outsourceProcessInfo, |
|||
chargeUnitInfo: current.chargeUnitInfo, |
|||
singleMaterialInfo: current.singleMaterialInfo, |
|||
supplierInfo: current.supplierInfo, |
|||
deliveryTimeInfo: current.deliveryTimeInfo, |
|||
}); |
|||
} else { |
|||
// console.log(current); |
|||
// 如果是第一次遇到这个materialNo,创建一个新的记录 |
|||
merged.push({ |
|||
materialNo: current.materialNo, |
|||
materialPhotourl: current.materialPhotourl, |
|||
materialName: current.materialName, |
|||
materialType: current.materialType, |
|||
description: current.description, |
|||
unit: current.unit, |
|||
brand: current.brand, |
|||
processMethod: current.processMethod, |
|||
correlationCodes: current.correlationCodes, |
|||
plannedOutsourceAmount: current.plannedOutsourceAmount, |
|||
actualOutsourceAmount: current.actualOutsourceAmount, |
|||
takenMaterial: current.takenMaterial, |
|||
takingMaterial: current.takingMaterial, |
|||
processList:[{ |
|||
outsourceProcessInfo: current.outsourceProcessInfo, |
|||
chargeUnitInfo: current.chargeUnitInfo, |
|||
singleMaterialInfo: current.singleMaterialInfo, |
|||
supplierInfo: current.supplierInfo, |
|||
deliveryTimeInfo: current.deliveryTimeInfo, |
|||
}], |
|||
}); |
|||
} |
|||
return merged; |
|||
}, []); |
|||
}; |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue