提交 8397094e 作者: zhangqiliang

校验辅材新增发货的时候,发货数量的总和不能大于批准数量;

根据申请单号到发货表中获取该申请单号下的所有物流单号;
父级 81a1b5d4
......@@ -97,23 +97,23 @@ public class DeliveryController {
for (DeliveryAddVo deliveryAddVo:deliveryAddVoList){
quantity=quantity+deliveryAddVo.getQuantity();
}
if (!StringUtils.isEmpty(tauxiliarymaterials)){
if (Integer.parseInt(tauxiliarymaterials.getApprovedQuantity())>quantity){
throw new ServiceException("400","辅材申请的数量不能大于审批数量!");
if (!StringUtils.isEmpty(tauxiliarymaterials) && !StringUtils.isEmpty(tauxiliarymaterials.getApprovedQuantity())){
if (quantity.compareTo(Integer.parseInt(tauxiliarymaterials.getApprovedQuantity())) > 0){
throw new ServiceException("400","发货数量的总和不能大于批准数量!");
}
}
}
da.setInstallStatus(0);
Delivery deliveryInstallOrder=deliveryMapper.selectByInstallOrder(da.getInstallOrder());
if (!StringUtils.isEmpty(deliveryInstallOrder)){
throw new ServiceException("400","订单号重复!");
}
Delivery delivery= DeliveryConvert.INSTANCE.convertAddVo(da);
delivery.setDeliveryOrder("FH"+NumberUtil.getRandomOrderId());
if(!StringUtils.isEmpty(delivery.getLogisticOrder())){
delivery.setLogisticStatus(TauxiliarymaterialStatusEnum.已发货.name());
}
if(!ProductType.辅材.name().equals(delivery.getIsproduct())){
Delivery deliveryInstallOrder=deliveryMapper.selectByInstallOrder(da.getInstallOrder());
if (!StringUtils.isEmpty(deliveryInstallOrder)){
throw new ServiceException("400","订单号重复!");
}
if (da.getArrivalWarehouseId().equals(da.getWarehouseId())){
throw new ServiceException("400","发货仓库和到货仓库请选择不同的仓库!");
}
......
......@@ -78,6 +78,7 @@ public class TauxiliarymaterialsController {
tauxiliarymaterials.setCreatedTime(now);
tauxiliarymaterials.setUpdatedBy(sessionInfo.getUserId());
tauxiliarymaterials.setUpdatedTime(now);
tauxiliarymaterials.setAreaName(tauxiliarymaterialsVo.getAreaName());
tauxiliarymaterials.setWarehouseName(tauxiliarymaterialsVo.getWarehouseName());
//暂时代替申请单号
tauxiliarymaterials.setApplyOrder("FC"+NumberUtil.getRandomOrderId());
......
......@@ -679,6 +679,7 @@
<if test="applyInventory != null and applyInventory != ''"> and t.apply_inventory = #{applyInventory}</if>
<if test="applyOrder != null and applyOrder != ''"> and t.apply_order like concat('%', #{applyOrder}, '%')</if>
</where>
group by t.apply_order
</select>
<select id="getRecentTAuxiliaryMaterials" resultMap="BaseResultMap">
......
package com.starcharge.wios.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
......@@ -258,4 +259,11 @@ public class TauxiliarymaterialsExcelVo {
*/
@ExcelProperty(value = "绑定仓库id")
private String warehouseId;
/**
* 所属区域
*
* @mbg.generated
*/
@ApiModelProperty(value = "所属区域")
private String areaName;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论