Browse Source

[feat]仓库管理:

仓库入库单
仓库入库单数据库,实体类新增客户相关字段
新增 入库-生产订单(生产入库)页面storageMake.html
新增入库按钮
后端新增入库接口
后端新增根据客户Id查询生产订单详情接口
dev
liuxiaoxu 6 months ago
parent
commit
ca05b146c4
  1. 36
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java
  2. 80
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java
  3. 13
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java
  5. 36
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  6. 110
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderDetailMapper.xml
  7. 343
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMake.html
  8. 13
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageOrder.html

36
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java

@ -265,4 +265,40 @@ public class WarehouseStorageOrderController extends BaseController
return groupedDetails; return groupedDetails;
} }
/**
* 入库-生产订单(生产入库)
*/
@GetMapping("/storageMake/{warehouseStorageId}")
public String storageMake(@PathVariable("warehouseStorageId") Long warehouseStorageId, ModelMap mmap)
{
WarehouseStorageOrder warehouseStorageOrder = warehouseStorageOrderService.selectWarehouseStorageOrderById(warehouseStorageId);
mmap.put("warehouseStorageOrder", warehouseStorageOrder);
return prefix + "/storageMake";
}
/**
* 修改保存入库-生产订单(生产入库)
*/
@RequiresPermissions("warehouse:storageOrder:storagePurchaseWarehouse")
@Log(title = "仓库入库单", businessType = BusinessType.UPDATE)
@PostMapping("/storageMake")
@ResponseBody
public AjaxResult storageMakeSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder)
{
return toAjax(warehouseStorageOrderService.updateStorageMake(warehouseStorageOrder));
}
/**
* 入库-生产订单(生产入库) 客户物料详情列表
*/
@ResponseBody
@RequestMapping("/storageMakeDetail")
public Map<String,List<WarehouseStorageOrderDetail>> storageMakeDetail(String warehouseStorageCode){
List<WarehouseStorageOrderDetail> allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode);
Map<String, List<WarehouseStorageOrderDetail>> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getCustomerId));
return groupedDetails;
}
} }

80
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseStorageOrderDetail.java

@ -208,6 +208,31 @@ public class WarehouseStorageOrderDetail extends BaseEntity
/** 存放位置 */ /** 存放位置 */
@Excel(name = "存放位置") @Excel(name = "存放位置")
private String storageLocation; private String storageLocation;
/** 生产入库数 */
@Excel(name = "生产入库数")
private Integer makeStorageNum;
/** 客户ID */
@Excel(name = "客户ID")
private String customerId;
/** 客户名称 */
@Excel(name = "客户名称")
private String customerName;
/** 客户联系人 */
@Excel(name = "客户联系人")
private String customerContactPeople;
/** 客户联系人电话 */
@Excel(name = "客户联系人电话")
private String customerContactNumber;
/** 客户公司地址 */
@Excel(name = "客户公司地址")
private String customerCompanyAddress;
public void setWarehouseStorageDetailId(Long warehouseStorageDetailId) public void setWarehouseStorageDetailId(Long warehouseStorageDetailId)
{ {
this.warehouseStorageDetailId = warehouseStorageDetailId; this.warehouseStorageDetailId = warehouseStorageDetailId;
@ -632,6 +657,55 @@ public class WarehouseStorageOrderDetail extends BaseEntity
this.storageLocation = storageLocation; this.storageLocation = storageLocation;
} }
public Integer getMakeStorageNum() {
return makeStorageNum;
}
public void setMakeStorageNum(Integer makeStorageNum) {
this.makeStorageNum = makeStorageNum;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerContactPeople() {
return customerContactPeople;
}
public void setCustomerContactPeople(String customerContactPeople) {
this.customerContactPeople = customerContactPeople;
}
public String getCustomerContactNumber() {
return customerContactNumber;
}
public void setCustomerContactNumber(String customerContactNumber) {
this.customerContactNumber = customerContactNumber;
}
public String getCustomerCompanyAddress() {
return customerCompanyAddress;
}
public void setCustomerCompanyAddress(String customerCompanyAddress) {
this.customerCompanyAddress = customerCompanyAddress;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -671,6 +745,7 @@ public class WarehouseStorageOrderDetail extends BaseEntity
.append("temporaryQualifiedNum", getTemporaryQualifiedNum()) .append("temporaryQualifiedNum", getTemporaryQualifiedNum())
.append("hasStorageNum", getHasStorageNum()) .append("hasStorageNum", getHasStorageNum())
.append("storageNum", getStorageNum()) .append("storageNum", getStorageNum())
.append("makeStorageNum",getMakeStorageNum())
.append("qualityHasQualifiedNum", getQualityHasQualifiedNum()) .append("qualityHasQualifiedNum", getQualityHasQualifiedNum())
.append("qualityQualifiedNum", getQualityQualifiedNum()) .append("qualityQualifiedNum", getQualityQualifiedNum())
.append("refundsExchangesNum", getRefundsExchangesNum()) .append("refundsExchangesNum", getRefundsExchangesNum())
@ -682,6 +757,11 @@ public class WarehouseStorageOrderDetail extends BaseEntity
.append("temporaryRemark", getTemporaryRemark()) .append("temporaryRemark", getTemporaryRemark())
.append("temporaryReportUrl", getTemporaryReportUrl()) .append("temporaryReportUrl", getTemporaryReportUrl())
.append("storageLocation",getStorageLocation()) .append("storageLocation",getStorageLocation())
.append("customerId", getCustomerId())
.append("customerName", getCustomerName())
.append("customerContactPeople", getCustomerContactPeople())
.append("customerContactNumber", getCustomerContactNumber())
.append("customerCompanyAddress", getCustomerCompanyAddress())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())

13
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseStorageOrderDetailMapper.java

@ -91,4 +91,17 @@ public interface WarehouseStorageOrderDetailMapper
* 根据入库单号供应商id物料号更新对应的物料单详情 * 根据入库单号供应商id物料号更新对应的物料单详情
* */ * */
int updateWarehouseStorageOrderDetailByObject(WarehouseStorageOrderDetail warehouseStorageOrderDetail); int updateWarehouseStorageOrderDetailByObject(WarehouseStorageOrderDetail warehouseStorageOrderDetail);
/*
* 根据入库单号客户ID物料号查找对应的物料单详情
* */
WarehouseStorageOrderDetail selectWarehouseStorageMakeOrderByObject(WarehouseStorageOrderDetail tempStorageOrderDetail);
/*
* 根据入库单号客户id物料号更新对应的物料单详情
* */
int updateWarehouseStorageMakeOrderDetailByObject(WarehouseStorageOrderDetail warehouseStorageOrderDetail);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java

@ -72,4 +72,9 @@ public interface IWarehouseStorageOrderService
* @return * @return
*/ */
int restoreWarehouseStorageOrderById(Long warehouseStorageId); int restoreWarehouseStorageOrderById(Long warehouseStorageId);
/*
* 入库-生产订单
* */
int updateStorageMake(WarehouseStorageOrder warehouseStorageOrder);
} }

36
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -106,6 +106,40 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder); return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
} }
/*
* 入库-生产订单
* */
@Override
public int updateStorageMake(WarehouseStorageOrder warehouseStorageOrder) {
String loginName = ShiroUtils.getLoginName();
warehouseStorageOrder.setUpdateBy(loginName);
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate());
List<WarehouseStorageOrderDetail> storageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
if (StringUtils.isEmpty(storageOrderDetailList)){
log.warn("入库单详情为空:{}",storageOrderDetailList);
}else {
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : storageOrderDetailList) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
WarehouseStorageOrderDetail tempStorageOrderDetail = new WarehouseStorageOrderDetail();
tempStorageOrderDetail.setMaterialNo(warehouseStorageOrderDetail.getMaterialNo());
tempStorageOrderDetail.setCustomerId(warehouseStorageOrderDetail.getCustomerId());
tempStorageOrderDetail.setWarehouseStorageCode(warehouseStorageOrder.getWarehouseStorageCode());
WarehouseStorageOrderDetail storageOrderDetailFromData = storageOrderDetailMapper.selectWarehouseStorageMakeOrderByObject(tempStorageOrderDetail);
if (storageOrderDetailFromData == null){
log.warn("数据库中入库单详情为空:{}",tempStorageOrderDetail);
}else {
storageOrderDetailMapper.updateWarehouseStorageMakeOrderDetailByObject(warehouseStorageOrderDetail);
}
}
}
return warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
}
/** /**
* 删除仓库入库单对象 * 删除仓库入库单对象
* *
@ -153,4 +187,6 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
{ {
return warehouseStorageOrderMapper.restoreWarehouseStorageOrderById(warehouseStorageId); return warehouseStorageOrderMapper.restoreWarehouseStorageOrderById(warehouseStorageId);
} }
} }

110
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseStorageOrderDetailMapper.xml

@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="temporaryQualifiedNum" column="temporary_qualified_num" /> <result property="temporaryQualifiedNum" column="temporary_qualified_num" />
<result property="hasStorageNum" column="has_storage_num" /> <result property="hasStorageNum" column="has_storage_num" />
<result property="storageNum" column="storage_num" /> <result property="storageNum" column="storage_num" />
<result property="makeStorageNum" column="make_storage_num" />
<result property="qualityHasQualifiedNum" column="quality_has_qualified_num" /> <result property="qualityHasQualifiedNum" column="quality_has_qualified_num" />
<result property="qualityQualifiedNum" column="quality_qualified_num" /> <result property="qualityQualifiedNum" column="quality_qualified_num" />
<result property="refundsExchangesNum" column="refunds_exchanges_num" /> <result property="refundsExchangesNum" column="refunds_exchanges_num" />
@ -52,6 +53,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="temporaryRemark" column="temporary_remark" /> <result property="temporaryRemark" column="temporary_remark" />
<result property="temporaryReportUrl" column="temporary_report_url" /> <result property="temporaryReportUrl" column="temporary_report_url" />
<result property="storageLocation" column="storage_location" /> <result property="storageLocation" column="storage_location" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="customerContactPeople" column="customer_contact_people" />
<result property="customerContactNumber" column="customer_contact_number" />
<result property="customerCompanyAddress" column="customer_company_address" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@ -59,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWarehouseStorageOrderDetailVo"> <sql id="selectWarehouseStorageOrderDetailVo">
select warehouse_storage_detail_id, warehouse_storage_code, related_order_code, warehouse_storage_status, warehouse_quality_status, warehouse_storage_type, warehouse_storage_class, warehouse_order_type, warehouse_dept_type, warehouse_employee, warehouse_code, warehouse_name, warehouse_detail_address, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, material_dept_type, make_total, notify_has_arrived_num, notify_arrive_num, actual_has_arrived_num, actual_arrive_num, temporary_has_qualified_num, temporary_qualified_num, has_storage_num, storage_num, quality_has_qualified_num, quality_qualified_num, refunds_exchanges_num, arrived_time, temporary_time, delivery_inspection_time, quality_time, storage_time, temporary_remark, temporary_report_url, storage_location, create_time, create_by, update_by, update_time from warehouse_storage_order_detail select warehouse_storage_detail_id, warehouse_storage_code, related_order_code, warehouse_storage_status, warehouse_quality_status, warehouse_storage_type, warehouse_storage_class, warehouse_order_type, warehouse_dept_type, warehouse_employee, warehouse_code, warehouse_name, warehouse_detail_address, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, customer_id, customer_name, customer_contact_people, customer_contact_number, customer_company_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, material_dept_type, make_total, notify_has_arrived_num, notify_arrive_num, actual_has_arrived_num, actual_arrive_num, temporary_has_qualified_num, temporary_qualified_num, has_storage_num, storage_num, make_storage_num ,quality_has_qualified_num, quality_qualified_num, refunds_exchanges_num, arrived_time, temporary_time, delivery_inspection_time, quality_time, storage_time, temporary_remark, temporary_report_url, storage_location, create_time, create_by, update_by, update_time from warehouse_storage_order_detail
</sql> </sql>
<select id="selectWarehouseStorageOrderDetailList" parameterType="WarehouseStorageOrderDetail" resultMap="WarehouseStorageOrderDetailResult"> <select id="selectWarehouseStorageOrderDetailList" parameterType="WarehouseStorageOrderDetail" resultMap="WarehouseStorageOrderDetailResult">
@ -84,6 +90,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and supplier_code = #{supplierCode} and supplier_code = #{supplierCode}
and material_no = #{materialNo} and material_no = #{materialNo}
</select> </select>
<select id="selectWarehouseStorageMakeOrderByObject" parameterType="WarehouseStorageOrder" resultMap="WarehouseStorageOrderDetailResult">
<include refid="selectWarehouseStorageOrderDetailVo"/>
where warehouse_storage_code = #{warehouseStorageCode}
and customer_id = #{customerId}
and material_no = #{materialNo}
</select>
<insert id="insertWarehouseStorageOrderDetail" parameterType="WarehouseStorageOrderDetail" useGeneratedKeys="true" keyProperty="warehouseStorageDetailId"> <insert id="insertWarehouseStorageOrderDetail" parameterType="WarehouseStorageOrderDetail" useGeneratedKeys="true" keyProperty="warehouseStorageDetailId">
insert into warehouse_storage_order_detail insert into warehouse_storage_order_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -104,6 +119,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerContact != null">customer_contact,</if> <if test="customerContact != null">customer_contact,</if>
<if test="contactNumber != null">contact_number,</if> <if test="contactNumber != null">contact_number,</if>
<if test="supplierAddress != null">supplier_address,</if> <if test="supplierAddress != null">supplier_address,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null">customer_name,</if>
<if test="customerContactPeople != null">customer_contact_people,</if>
<if test="customerContactNumber != null">customer_contact_number,</if>
<if test="customerCompanyAddress != null">customer_company_address,</if>
<if test="materialNo != null">material_no,</if> <if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if> <if test="materialType != null">material_type,</if>
@ -122,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="temporaryQualifiedNum != null">temporary_qualified_num,</if> <if test="temporaryQualifiedNum != null">temporary_qualified_num,</if>
<if test="hasStorageNum != null">has_storage_num,</if> <if test="hasStorageNum != null">has_storage_num,</if>
<if test="storageNum != null">storage_num,</if> <if test="storageNum != null">storage_num,</if>
<if test="makeStorageNum != null">make_storage_num,</if>
<if test="qualityHasQualifiedNum != null">quality_has_qualified_num,</if> <if test="qualityHasQualifiedNum != null">quality_has_qualified_num,</if>
<if test="qualityQualifiedNum != null">quality_qualified_num,</if> <if test="qualityQualifiedNum != null">quality_qualified_num,</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num,</if> <if test="refundsExchangesNum != null">refunds_exchanges_num,</if>
@ -156,6 +177,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerContact != null">#{customerContact},</if> <if test="customerContact != null">#{customerContact},</if>
<if test="contactNumber != null">#{contactNumber},</if> <if test="contactNumber != null">#{contactNumber},</if>
<if test="supplierAddress != null">#{supplierAddress},</if> <if test="supplierAddress != null">#{supplierAddress},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="customerContactPeople != null">#{customerContactPeople},</if>
<if test="customerContactNumber != null">#{customerContactNumber},</if>
<if test="customerCompanyAddress != null">#{customerCompanyAddress},</if>
<if test="materialNo != null">#{materialNo},</if> <if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if> <if test="materialType != null">#{materialType},</if>
@ -174,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="temporaryQualifiedNum != null">#{temporaryQualifiedNum},</if> <if test="temporaryQualifiedNum != null">#{temporaryQualifiedNum},</if>
<if test="hasStorageNum != null">#{hasStorageNum},</if> <if test="hasStorageNum != null">#{hasStorageNum},</if>
<if test="storageNum != null">#{storageNum},</if> <if test="storageNum != null">#{storageNum},</if>
<if test="makeStorageNum != null">#{makeStorageNum},</if>
<if test="qualityHasQualifiedNum != null">#{qualityHasQualifiedNum},</if> <if test="qualityHasQualifiedNum != null">#{qualityHasQualifiedNum},</if>
<if test="qualityQualifiedNum != null">#{qualityQualifiedNum},</if> <if test="qualityQualifiedNum != null">#{qualityQualifiedNum},</if>
<if test="refundsExchangesNum != null">#{refundsExchangesNum},</if> <if test="refundsExchangesNum != null">#{refundsExchangesNum},</if>
@ -212,6 +239,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerContact != null">customer_contact = #{customerContact},</if> <if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if> <if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="supplierAddress != null">supplier_address = #{supplierAddress},</if> <if test="supplierAddress != null">supplier_address = #{supplierAddress},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="customerContactPeople != null">customer_contact_people = #{customerContactPeople},</if>
<if test="customerContactNumber != null">customer_contact_number = #{customerContactNumber},</if>
<if test="customerCompanyAddress != null">customer_company_address = #{customerCompanyAddress},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
@ -230,6 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="temporaryQualifiedNum != null">temporary_qualified_num = #{temporaryQualifiedNum},</if> <if test="temporaryQualifiedNum != null">temporary_qualified_num = #{temporaryQualifiedNum},</if>
<if test="hasStorageNum != null">has_storage_num = #{hasStorageNum},</if> <if test="hasStorageNum != null">has_storage_num = #{hasStorageNum},</if>
<if test="storageNum != null">storage_num = #{storageNum},</if> <if test="storageNum != null">storage_num = #{storageNum},</if>
<if test="makeStorageNum != null">make_storage_num = #{makeStorageNum},</if>
<if test="qualityHasQualifiedNum != null">quality_has_qualified_num = #{qualityHasQualifiedNum},</if> <if test="qualityHasQualifiedNum != null">quality_has_qualified_num = #{qualityHasQualifiedNum},</if>
<if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if> <if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if> <if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if>
@ -270,6 +303,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerContact != null">customer_contact = #{customerContact},</if> <if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if> <if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="supplierAddress != null">supplier_address = #{supplierAddress},</if> <if test="supplierAddress != null">supplier_address = #{supplierAddress},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="customerContactPeople != null">customer_contact_people = #{customerContactPeople},</if>
<if test="customerContactNumber != null">customer_contact_number = #{customerContactNumber},</if>
<if test="customerCompanyAddress != null">customer_company_address = #{customerCompanyAddress},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
@ -288,6 +326,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="temporaryQualifiedNum != null">temporary_qualified_num = #{temporaryQualifiedNum},</if> <if test="temporaryQualifiedNum != null">temporary_qualified_num = #{temporaryQualifiedNum},</if>
<if test="hasStorageNum != null">has_storage_num = #{hasStorageNum},</if> <if test="hasStorageNum != null">has_storage_num = #{hasStorageNum},</if>
<if test="storageNum != null">storage_num = #{storageNum},</if> <if test="storageNum != null">storage_num = #{storageNum},</if>
<if test="makeStorageNum != null">make_storage_num = #{makeStorageNum},</if>
<if test="qualityHasQualifiedNum != null">quality_has_qualified_num = #{qualityHasQualifiedNum},</if> <if test="qualityHasQualifiedNum != null">quality_has_qualified_num = #{qualityHasQualifiedNum},</if>
<if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if> <if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if> <if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if>
@ -309,6 +348,75 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and material_no = #{materialNo} and material_no = #{materialNo}
</update> </update>
<update id="updateWarehouseStorageMakeOrderDetailByObject" parameterType="WarehouseStorageOrderDetail">
update warehouse_storage_order_detail
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseStorageCode != null">warehouse_storage_code = #{warehouseStorageCode},</if>
<if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if>
<if test="warehouseStorageStatus != null">warehouse_storage_status = #{warehouseStorageStatus},</if>
<if test="warehouseQualityStatus != null">warehouse_quality_status = #{warehouseQualityStatus},</if>
<if test="warehouseStorageType != null">warehouse_storage_type = #{warehouseStorageType},</if>
<if test="warehouseStorageClass != null">warehouse_storage_class = #{warehouseStorageClass},</if>
<if test="warehouseOrderType != null">warehouse_order_type = #{warehouseOrderType},</if>
<if test="warehouseDeptType != null">warehouse_dept_type = #{warehouseDeptType},</if>
<if test="warehouseEmployee != null">warehouse_employee = #{warehouseEmployee},</if>
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
<if test="warehouseDetailAddress != null">warehouse_detail_address = #{warehouseDetailAddress},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="supplierAddress != null">supplier_address = #{supplierAddress},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="customerContactPeople != null">customer_contact_people = #{customerContactPeople},</if>
<if test="customerContactNumber != null">customer_contact_number = #{customerContactNumber},</if>
<if test="customerCompanyAddress != null">customer_company_address = #{customerCompanyAddress},</if>
<if test="materialNo != null">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_photoUrl = #{materialPhotourl},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialDeptType != null">material_dept_type = #{materialDeptType},</if>
<if test="makeTotal != null">make_total = #{makeTotal},</if>
<if test="notifyHasArrivedNum != null">notify_has_arrived_num = #{notifyHasArrivedNum},</if>
<if test="notifyArriveNum != null">notify_arrive_num = #{notifyArriveNum},</if>
<if test="actualHasArrivedNum != null">actual_has_arrived_num = #{actualHasArrivedNum},</if>
<if test="actualArriveNum != null">actual_arrive_num = #{actualArriveNum},</if>
<if test="temporaryHasQualifiedNum != null">temporary_has_qualified_num = #{temporaryHasQualifiedNum},</if>
<if test="temporaryQualifiedNum != null">temporary_qualified_num = #{temporaryQualifiedNum},</if>
<if test="hasStorageNum != null">has_storage_num = #{hasStorageNum},</if>
<if test="storageNum != null">storage_num = #{storageNum},</if>
<if test="makeStorageNum != null">make_storage_num = #{makeStorageNum},</if>
<if test="qualityHasQualifiedNum != null">quality_has_qualified_num = #{qualityHasQualifiedNum},</if>
<if test="qualityQualifiedNum != null">quality_qualified_num = #{qualityQualifiedNum},</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if>
<if test="arrivedTime != null">arrived_time = #{arrivedTime},</if>
<if test="temporaryTime != null">temporary_time = #{temporaryTime},</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="qualityTime != null">quality_time = #{qualityTime},</if>
<if test="storageTime != null">storage_time = #{storageTime},</if>
<if test="temporaryRemark != null">temporary_remark = #{temporaryRemark},</if>
<if test="temporaryReportUrl != null">temporary_report_url = #{temporaryReportUrl},</if>
<if test="storageLocation != null">storage_location = #{storageLocation},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where warehouse_storage_code = #{warehouseStorageCode}
and customer_id = #{customerId}
and material_no = #{materialNo}
</update>
<delete id="deleteWarehouseStorageOrderDetailById" parameterType="Long"> <delete id="deleteWarehouseStorageOrderDetailById" parameterType="Long">
delete from warehouse_storage_order_detail where warehouse_storage_detail_id = #{warehouseStorageDetailId} delete from warehouse_storage_order_detail where warehouse_storage_detail_id = #{warehouseStorageDetailId}
</delete> </delete>

343
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageMake.html

@ -0,0 +1,343 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('入库-生产订单(生产入库)')" />
<th:block th:include="include :: datetimepicker-css" />
<style>
.supplier-value span {
margin-right: 10px;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-temporaryPurchaseWarehouse-edit" th:object="${warehouseStorageOrder}">
<input name="warehouseStorageId" th:field="*{warehouseStorageId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="warehouseStorageCode" th:field="*{warehouseStorageCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="col-xs-12">
<label class="col-sm-1 control-label">入库类型:</label>
<div class="col-sm-4">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">到货时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="arrivedTime" th:value="${#dates.format(warehouseStorageOrder.arrivedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交检时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryInspectionTime" th:value="${#dates.format(warehouseStorageOrder.deliveryInspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label is-required">仓库ID:</label>
<div class="col-sm-8">
<select class="form-control" id="warehouseCode" name="warehouseCode" th:field="*{warehouseCode}" required>
<!-- 这里动态生成仓库ID选项 -->
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">仓库名称:</label>
<div class="col-sm-8">
<input name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库详情地址:</label>
<div class="col-sm-8">
<input name="warehouseDetailAddress" th:field="*{warehouseDetailAddress}" class="form-control" type="text">
</div>
</div>
<div class="container">
<!--客户物料相关-->
<div class="row">
<div class="col-sm-12" id="tablesContainer">
<!-- 表格将在这里动态生成 -->
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]
var warehouseCode = [[${warehouseStorageOrder.warehouseCode}]]
var prefix = ctx + "warehouse/storageOrder";
$("#form-temporaryPurchaseWarehouse-edit").validate({
focusCleanup: true
});
//生成的不同table的id集合
var tableDatas = [];
function submitHandler() {
const storageOrderData = $("#form-temporaryPurchaseWarehouse-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 初始化一个数组用于存放所有表格的数据
let allMaterialDataList = [];
for(let i in tableDatas){
$('#' + tableDatas[i]).each(function() {
const tableData = $(this).bootstrapTable('getData');
console.log(JSON.stringify(tableData));
// 将表数据转换成与qualityReportData格式一致的数组
var materialDataList = tableData.map(function (item) {
// 根据实际字段名调整
return {
"customerId": item.customerId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"qualityHasQualifiedNum": item.qualityHasQualifiedNum,
"hasStorageNum": item.hasStorageNum,
"makeStorageNum": item.makeStorageNum,
"storageNum": item.storageNum,
"storageLocation": item.storageLocation,
// ...其他字段
};
});
allMaterialDataList = allMaterialDataList.concat(materialDataList);
});
}
const combinedData = Object.assign({}, storageOrderData, {
warehouseStorageOrderDetailList: allMaterialDataList
});
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/storageMake", jsonData);
}
$("input[name='arrivedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var warehouseStorageCode = [[${warehouseStorageOrder.warehouseStorageCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/storageMakeDetail?warehouseStorageCode=" + warehouseStorageCode, function(data) {
for (var customerId in data) {
if (data.hasOwnProperty(customerId)) {
var customerData = data[customerId];
createTableForCustomer(customerId, customerData);
}
}
});
});
function createTableForCustomer(customerId, customerData) {
var tableId = 'bootstrap-table-' + customerId.replace(/[^a-z0-9]/gi, '_').toLowerCase();
tableDatas.push(tableId);
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保customerData至少有一条记录,并从中提取客户详细信息
var customerInfo = customerData.length > 0 ? customerData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外客户信息的标题字符串
var headerTitle ='客户'+'</br>'+customerId + ' - ' + (customerInfo.customerName || 'N/A') +
' </br> ' + (customerInfo.customerContactPeople || 'N/A') +
' - ' + (customerInfo.customerContactNumber || 'N/A') +
' - ' + (customerInfo.customerCompanyAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: customerData,
columns: [{
checkbox: true
},
{
title: '客户ID',
field: 'customerId',
visible: false
},
{
title: '料号',
field: 'materialNo'
}, {
title: '物料名称',
field: 'materialName'
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '物料图片地址',
field: 'materialPhotourl',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasQualifiedNum',
},
{
title: '已入库数',
field: 'hasStorageNum',
},
{
title: '生产入库数',
field: 'makeStorageNum',
},
{
title: '入库数',
field: 'storageNum',
editable:{
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
}
}
},
{
title: '存放位置',
field: 'storageLocation',
editable: true
}]
});
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
}
//根据仓库ID查询仓库名称
$(document).ready(function() {
// 初始化时默认加载仓库ID列表
loadWarehouseCodes();
// 监听仓库ID下拉框的变化
$('#warehouseCode').on('change', function() {
var selectedWarehouseCode = $(this).val(); // 获取选中的仓库ID
if (selectedWarehouseCode) {
// 发起Ajax请求获取仓库名称
$.ajax({
type: 'GET',
url: ctx +'stock/stockInfo/getStockNameByWarehouseCode/' + selectedWarehouseCode,
dataType: 'json', // 假设返回的数据格式是JSON
success: function(data) {
console.log(data);
// 将获取到的仓库名称填充到输入框
if(data.data == null){
// 如果返回的数据有问题,可以给出提示或处理
$.modal.alertWarning('未能获取到仓库名称!');
}
$('input[name="warehouseName"]').val(data.data.stockname);
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error:', textStatus, errorThrown);
$.modal.alertWarning('查询仓库名称时发生错误!');
}
});
} else {
// 如果没有选择仓库ID,清空仓库名称输入框
$('input[name="warehouseName"]').val('');
}
});
});
// 加载仓库Id列表函数
function loadWarehouseCodes() {
var url = ctx + 'stock/stockInfo/getAllWarehouseCode';
$.ajax({
type: 'GET', // 请求类型
url: url, // 后端接口URL
dataType: 'json', // 预期服务器返回的数据类型
success: function(data) {
if (data && Array.isArray(data)) {
var selectElement = $('#warehouseCode'); // 获取仓库编号下拉框元素
// 清空下拉框现有选项
selectElement.empty();
// 添加默认选项(如果需要)编辑时不需要添加默认选项
selectElement.append('<option value="">所有</option>');
// 遍历返回的数据,添加为下拉框的选项
$.each(data, function(index, item) {
// 仓库ID
selectElement.append('<option value="' + item.stockNO + '">' + item.stockNO + '</option>');
});
// $('#warehouseCode').val(stockNO);
} else {
$.modal.errMsg("数据为空");
}
}
});
}
</script>
</body>
</html>

13
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/storageOrder.html

@ -79,7 +79,7 @@
var temporaryPurchaseFlag = [[${@permission.hasPermi('warehouse:storageOrder:temporaryPurchase')}]]; var temporaryPurchaseFlag = [[${@permission.hasPermi('warehouse:storageOrder:temporaryPurchase')}]];
var storagePurchaseFlag = [[${@permission.hasPermi('warehouse:storageOrder:storagePurchase')}]]; var storagePurchaseFlag = [[${@permission.hasPermi('warehouse:storageOrder:storagePurchase')}]];
var storagePurchaseWarehouseFlag = [[${@permission.hasPermi('warehouse:storageOrder:storagePurchaseWarehouse')}]]; var storagePurchaseWarehouseFlag = [[${@permission.hasPermi('warehouse:storageOrder:storagePurchaseWarehouse')}]];
var storageMakeFlag = [[${@permission.hasPermi('warehouse:storageOrder:storageMake')}]];
var warehouseStorageStatusDatas = [[${@dict.getType('warehouse_storage_status')}]]; var warehouseStorageStatusDatas = [[${@dict.getType('warehouse_storage_status')}]];
var warehouseQualityStatusDatas = [[${@dict.getType('warehouse_quality_status')}]]; var warehouseQualityStatusDatas = [[${@dict.getType('warehouse_quality_status')}]];
@ -241,11 +241,14 @@
if ( row.warehouseDeptType == 0 && row.warehouseOrderType == 0 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){ if ( row.warehouseDeptType == 0 && row.warehouseOrderType == 0 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){
actions.push('<a class="btn btn-success btn-xs ' + storagePurchaseFlag + '" href="javascript:void(0)" onclick="storagePurchase(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> '); actions.push('<a class="btn btn-success btn-xs ' + storagePurchaseFlag + '" href="javascript:void(0)" onclick="storagePurchase(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> ');
} }
/*入库-采购单(仓库入库)*/ /*入库-采购单(仓库入库)*/
if ( row.warehouseDeptType == 1 && row.warehouseOrderType == 0 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){ if ( row.warehouseDeptType == 1 && row.warehouseOrderType == 0 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){
actions.push('<a class="btn btn-success btn-xs ' + storagePurchaseWarehouseFlag + '" href="javascript:void(0)" onclick="storagePurchaseWarehouse(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> '); actions.push('<a class="btn btn-success btn-xs ' + storagePurchaseWarehouseFlag + '" href="javascript:void(0)" onclick="storagePurchaseWarehouse(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> ');
} }
/*入库-生产订单(生产入库)*/
if ( row.warehouseDeptType == 1 && row.warehouseOrderType == 1 && (row.warehouseStorageStatus == 2 || row.warehouseStorageStatus == 3) ){
actions.push('<a class="btn btn-success btn-xs ' + storageMakeFlag + '" href="javascript:void(0)" onclick="storageMake(\'' + row.warehouseStorageId + '\')"><i class="fa fa-edit"></i>入库</a> ');
}
return actions.join(''); return actions.join('');
} }
}] }]
@ -277,6 +280,12 @@
$.modal.open("入库",url); $.modal.open("入库",url);
}; };
/*入库-生产订单(生产入库)*/
function storageMake(warehouseStorageId){
var url = ctx + 'warehouse/storageOrder/storageMake/' + warehouseStorageId;
$.modal.open("入库",url);
};
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save