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