Browse Source

[fix] 生产管理 仓库管理

修改 生产、委内入库单页面 新增入库数字段
修改 品质单实体类新增 入库数字段
修改品质mapper层查询方法
修改仓库入库暂收 物料入库部门为仓库的后端接口方法
dev
liuxiaoxu 4 months ago
parent
commit
824fdbd64a
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseStorageOrderController.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java
  4. 52
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  5. 6
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  6. 2
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

12
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrder.java

@ -59,6 +59,9 @@ public class QualityOrder extends BaseEntity
@Excel(name = "品质不合格数")
private Integer qualityUnqualifiedNum;
/** 入库数 */
private Integer storageNum;
/** 委内加工费总价 */
private BigDecimal makeInTotalPrice;
@ -224,6 +227,14 @@ public class QualityOrder extends BaseEntity
this.qualityOrderDetailList = qualityOrderDetailList;
}
public Integer getStorageNum() {
return storageNum;
}
public void setStorageNum(Integer storageNum) {
this.storageNum = storageNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -248,6 +259,7 @@ public class QualityOrder extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("storageNum",getStorageNum())
.toString();
}
}

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

@ -139,7 +139,7 @@ public class WarehouseStorageOrderController extends BaseController
@ResponseBody
public AjaxResult temporaryPurchaseWarehouseSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder)
{
return toAjax(warehouseStorageOrderService.updateWarehouseStorageOrder(warehouseStorageOrder));
return toAjax(warehouseStorageOrderService.updateTemporaryPurchaseWarehouse(warehouseStorageOrder));
}

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

@ -118,4 +118,9 @@ public interface IWarehouseStorageOrderService
* 修改保存入库-生产订单(委内入库)
* */
int updateStorageMakeIn(WarehouseStorageOrder warehouseStorageOrder);
/**
* 修改保存暂收-采购单(仓库入库)
*/
int updateTemporaryPurchaseWarehouse(WarehouseStorageOrder warehouseStorageOrder);
}

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

@ -523,6 +523,58 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
}
/**
* 修改保存暂收-采购单(仓库入库)
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateTemporaryPurchaseWarehouse(WarehouseStorageOrder warehouseStorageOrder) {
String loginName = ShiroUtils.getLoginName();
warehouseStorageOrder.setUpdateBy(loginName);
warehouseStorageOrder.setUpdateTime(DateUtils.getNowDate());
//改变状态为已暂收
warehouseStorageOrder.setWarehouseStorageStatus("1");
//设置品质状态,为待品质
warehouseStorageOrder.setWarehouseQualityStatus("0");
warehouseStorageOrder.setWarehouseEmployee(loginName);
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
//入库单主表的实际到货数为子表的合计
int actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
//入库单主表的暂收合格数为子表的合计
int temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
if (actualArriveNum < temporaryQualifiedNum) {
throw new BusinessException("暂收合格数不能大于实际到货数");
}
//插入实际到货数
warehouseStorageOrder.setActualArrivedNum(actualArriveNum);
//插入暂收合格数
warehouseStorageOrder.setTemporaryQualifiedNum(temporaryQualifiedNum);
//插入暂收不合格数
warehouseStorageOrder.setTemporaryUnqualifiedNum(Math.max(0, actualArriveNum - temporaryQualifiedNum));
//设置暂存时间
warehouseStorageOrder.setTemporaryTime(new Date());
int updateDetailResult = updateTemporaryPurchaseDetails(warehouseStorageOrder);
if (updateDetailResult != warehouseStorageOrder.getWarehouseStorageOrderDetailList().size()) {
throw new BusinessException("更新入库单明细记录失败");
}
int updateResult = warehouseStorageOrderMapper.updateWarehouseStorageOrder(warehouseStorageOrder);
if (updateResult <= 0) {
throw new BusinessException("更新入库单主记录失败");
}
try {
qualityOrderService.insertQualityOrderByWarehouseStorageOrder(warehouseStorageOrder, warehouseStorageOrder.getWarehouseStorageOrderDetailList());
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("生成品质单时发生错误", e);
throw new BusinessException("生成品质单时发生错误");
}
return updateResult;
}
/**
* 修改保存暂收-采购单(采购入库) 子表数据
* */

6
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml

@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="thisArrivedNum" column="this_arrived_num" />
<result property="qualityQualifiedNum" column="quality_qualified_num" />
<result property="qualityUnqualifiedNum" column="quality_unqualified_num" />
<result property="storageNum" column="storage_num" />
<result property="makeInTotalPrice" column="make_in_total_price" />
<result property="deliveryInspectionTime" column="delivery_inspection_time" />
<result property="qualityEmployee" column="quality_employee" />
@ -98,8 +99,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qo.create_time,
qo.update_by,
qo.update_time,
qo.make_in_total_price
qo.make_in_total_price,
wso.storage_num
from quality_order qo
left join warehouse_storage_order wso on wso.related_order_code = qo.related_order_code
<where>
<if test="qualityOrderCode != null and qualityOrderCode != ''"> and qo.quality_order_code = #{qualityOrderCode}</if>
<if test="inStorageCode != null and inStorageCode != ''"> and qo.in_storage_code = #{inStorageCode}</if>

2
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -165,7 +165,7 @@
{
title: '入库数',
field: 'storage_num',
field: 'storageNum',
},
// {

Loading…
Cancel
Save