送货计划
This commit is contained in:
parent
d81634f69d
commit
1e5d89a6e6
@ -11,6 +11,7 @@ import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
@ -98,23 +99,13 @@ public class DeliveryPlanController extends JeecgController<DeliveryPlan, IDeliv
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result<String> add(@RequestBody DeliveryPlan deliveryPlan) {
|
||||
List<DeliveryPlanDetail> deliveryPlanDetailList = deliveryPlan.getDeliveryPlanDetailList();
|
||||
String pn = StringUtils.join(deliveryPlanDetailList.stream()
|
||||
.map(DeliveryPlanDetail::getPn)
|
||||
.filter(po -> po != null && !po.isEmpty())
|
||||
.toArray(), ",");
|
||||
String unit = StringUtils.join(deliveryPlanDetailList.stream()
|
||||
.map(DeliveryPlanDetail::getUnit)
|
||||
.filter(po -> po != null && !po.isEmpty())
|
||||
.toArray(), ",");
|
||||
deliveryPlan.setPn(pn)
|
||||
.setUnit(unit);
|
||||
String sequence = generalSequenceService.getSequence(GeneralSequenceConstant.IN_DEMAND_NO);
|
||||
deliveryPlan.setSgNo(sequence);
|
||||
deliveryPlanService.save(deliveryPlan);
|
||||
deliveryPlanDetailList.forEach(item ->{
|
||||
item.setDeliveryPlanId(deliveryPlan.getId());
|
||||
});
|
||||
deliveryPlanDetailService.saveOrUpdateBatch(deliveryPlanDetailList);
|
||||
deliveryPlanDetailService.saveBatch(deliveryPlanDetailList);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@ -131,21 +122,14 @@ public class DeliveryPlanController extends JeecgController<DeliveryPlan, IDeliv
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody DeliveryPlan deliveryPlan) {
|
||||
List<DeliveryPlanDetail> deliveryPlanDetailList = deliveryPlan.getDeliveryPlanDetailList();
|
||||
String pn = StringUtils.join(deliveryPlanDetailList.stream()
|
||||
.map(DeliveryPlanDetail::getPn)
|
||||
.filter(po -> po != null && !po.isEmpty())
|
||||
.toArray(), ",");
|
||||
String unit = StringUtils.join(deliveryPlanDetailList.stream()
|
||||
.map(DeliveryPlanDetail::getUnit)
|
||||
.filter(po -> po != null && !po.isEmpty())
|
||||
.toArray(), ",");
|
||||
deliveryPlan.setPn(pn)
|
||||
.setUnit(unit);
|
||||
LambdaQueryWrapper<DeliveryPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DeliveryPlanDetail::getDeliveryPlanId, deliveryPlan.getId());
|
||||
deliveryPlanDetailService.remove(lambdaQueryWrapper);
|
||||
deliveryPlanService.updateById(deliveryPlan);
|
||||
deliveryPlanDetailList.forEach(item ->{
|
||||
item.setDeliveryPlanId(deliveryPlan.getId());
|
||||
});
|
||||
deliveryPlanDetailService.saveOrUpdateBatch(deliveryPlanDetailList);
|
||||
deliveryPlanDetailService.saveBatch(deliveryPlanDetailList);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
|
||||
<select id="getByPo" resultType="org.jeecg.modules.tms.carinout.deliveryplandetail.entity.DeliveryPlanDetail"
|
||||
parameterType="java.lang.String">
|
||||
select a.SUPPLIERNO supplier,b.MATERIALSPECNAME pn,b.MATERIALUNIT unit,b.REQUESTQUANTITY planQty
|
||||
select a.SUPPLIERNO supplier,b.MATERIALSPECNAME pn,b.MATERIALUNIT unit,b.REQUESTQUANTITY planQty,
|
||||
a.RECEIVEREQUESTNAME po
|
||||
from MATERIALRECEIVEREQUEST a
|
||||
left join MATERIALRECEIVEREQUESTDETAIL b
|
||||
on a.RECEIVEREQUESTNAME = b.RECEIVEREQUESTNAME
|
||||
|
@ -177,7 +177,7 @@ public class DeliveryPlanDetailController extends JeecgController<DeliveryPlanDe
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getByDeliveryPlanId")
|
||||
public Result<?> getByPo(String id) {
|
||||
public Result<?> getByDeliveryPlanId(String id) {
|
||||
LambdaQueryWrapper<DeliveryPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DeliveryPlanDetail::getDeliveryPlanId, id);
|
||||
List<DeliveryPlanDetail> list = deliveryPlanDetailService.list(lambdaQueryWrapper);
|
||||
|
@ -4,10 +4,8 @@ import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@ -77,4 +75,6 @@ public class DeliveryPlanDetail implements Serializable {
|
||||
private String supplier;
|
||||
/**送货计划 id*/
|
||||
private String deliveryPlanId;
|
||||
@TableField(exist = false)
|
||||
private Boolean selected = false;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import org.jeecg.modules.tms.basicdata.iogisticsprice.mapper.TmsIogisticsPriceMa
|
||||
import org.jeecg.modules.tms.basicdata.logisticsroute.mapper.LogisticsRouteMapper;
|
||||
import org.jeecg.modules.tms.basicdata.vehiclepallet.entity.VehiclePallet;
|
||||
import org.jeecg.modules.tms.basicdata.vehiclepallet.mapper.VehiclePalletMapper;
|
||||
import org.jeecg.modules.tms.constant.TmsConstants;
|
||||
import org.jeecg.modules.tms.outbound.deliverydemand.mapper.DeliveryDemandMapper;
|
||||
import org.jeecg.modules.tms.outbound.vehicledemand.entity.Solution;
|
||||
import org.jeecg.modules.tms.outbound.vehicledemand.entity.VehicleDemand;
|
||||
@ -78,7 +79,7 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
|
||||
// 5.新增
|
||||
vehicleDemandCountService.saveBatch(vehicleDemandCounts);
|
||||
// 6.更新发货需求当前状态
|
||||
deliveryDemandMapper.updateByVdNo(vehicleDemand.getVdNo(), "2");
|
||||
deliveryDemandMapper.updateByVdNo(vehicleDemand.getVdNo(), TmsConstants.currentStatus_2);
|
||||
log.info("用车需求计算,用车需求编号:{},方案:{},费用:{}",vehicleDemand.getVdNo(),
|
||||
solution.getVehicleCounts(),solution.getTotalCost());
|
||||
return Result.OK("用车计算成功!");
|
||||
@ -156,6 +157,8 @@ public class VehicleDemandServiceImpl extends ServiceImpl<VehicleDemandMapper, V
|
||||
VehicleDemandCount vehicleDemandCount = new VehicleDemandCount();
|
||||
vehicleDemandCount.setCarType(carType)
|
||||
.setCarLong(carLong)
|
||||
.setSystemCarType(carType)
|
||||
.setSystemCarLong(carLong)
|
||||
.setSupplierCode(supplierCode)
|
||||
.setVdNo(vehicleDemand.getVdNo())
|
||||
.setShipType(vehicleDemand.getShipType())
|
||||
|
@ -62,12 +62,20 @@ public class VehicleDemandCount implements Serializable {
|
||||
@Dict(dicCode = "ship_type")
|
||||
@ApiModelProperty(value = "发货类型")
|
||||
private java.lang.String shipType;
|
||||
/**车型*/
|
||||
@Excel(name = "车型", width = 15)
|
||||
/**系统车型*/
|
||||
@Excel(name = "系统车型", width = 15)
|
||||
@ApiModelProperty(value = "车型")
|
||||
private java.lang.String systemCarType;
|
||||
/**车长*/
|
||||
@Excel(name = "系统车长", width = 15)
|
||||
@ApiModelProperty(value = "系统车长")
|
||||
private java.lang.Double systemCarLong;
|
||||
/**车型*/
|
||||
@Excel(name = "车型", width = 15)
|
||||
@ApiModelProperty(value = "车型")
|
||||
private java.lang.String carType;
|
||||
/**车长*/
|
||||
@Excel(name = "车长", width = 15)
|
||||
/**车长*/
|
||||
@Excel(name = "车长", width = 15)
|
||||
@ApiModelProperty(value = "车长")
|
||||
private java.lang.Double carLong;
|
||||
/**供应商编码*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user