订单变更问题修改
This commit is contained in:
parent
21b00913ed
commit
83a96ad0bd
@ -194,16 +194,16 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
|
||||
LambdaQueryWrapper<OrderYsDO> eq = new LambdaQueryWrapper<OrderYsDO>().eq(OrderYsDO::getCode, updateReqVO.getCode());
|
||||
OrderYsDO orderYsDO = orderYsMapper.selectOne(eq);
|
||||
if (ObjectUtil.isEmpty(orderYsDO)){
|
||||
if (updateReqVO.getHasPrice().equals(1)) {
|
||||
if (updateReqVO.getHasPrice().equals(1)) {
|
||||
if (ObjectUtil.isEmpty(orderYsDO)) {
|
||||
orderYsDO = new OrderYsDO();
|
||||
orderYsDO.setCode(updateReqVO.getCode());
|
||||
orderYsDO.setProjectName(updateReqVO.getProjectName());
|
||||
orderYsDO.setCgTime(LocalDateTime.now());
|
||||
orderYsDO.setCgKhname(customerService.getCustomer(updateReqVO.getCustomerId()).getName());
|
||||
if(updateReqVO.getPrice()==null){
|
||||
if (updateReqVO.getPrice() == null) {
|
||||
orderYsDO.setCgYs(new BigDecimal(0));
|
||||
}else {
|
||||
} else {
|
||||
orderYsDO.setCgYs(updateReqVO.getPrice());
|
||||
LocalDateTime[] paymentTimes = {
|
||||
updateReqVO.getSixFuKuanTime(),
|
||||
@ -220,28 +220,30 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
orderYsMapper.insert(orderYsDO);
|
||||
}else {
|
||||
orderYsDO.setCgYs(updateReqVO.getPrice());
|
||||
LocalDateTime[] paymentTimes = {
|
||||
updateReqVO.getSixFuKuanTime(),
|
||||
updateReqVO.getFiveFuKuanTime(),
|
||||
updateReqVO.getFourFuKuanTime(),
|
||||
updateReqVO.getThreeFuKuanTime(),
|
||||
updateReqVO.getTwoFuKuanTime(),
|
||||
updateReqVO.getShouFuKuanTime()
|
||||
};
|
||||
for (LocalDateTime paymentTime : paymentTimes) {
|
||||
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||
orderYsDO.setPaymentDate(paymentTime);
|
||||
break;
|
||||
orderYsMapper.insert(orderYsDO);
|
||||
} else {
|
||||
orderYsDO.setCgYs(updateReqVO.getPrice());
|
||||
LocalDateTime[] paymentTimes = {
|
||||
updateReqVO.getSixFuKuanTime(),
|
||||
updateReqVO.getFiveFuKuanTime(),
|
||||
updateReqVO.getFourFuKuanTime(),
|
||||
updateReqVO.getThreeFuKuanTime(),
|
||||
updateReqVO.getTwoFuKuanTime(),
|
||||
updateReqVO.getShouFuKuanTime()
|
||||
};
|
||||
for (LocalDateTime paymentTime : paymentTimes) {
|
||||
if (!ObjectUtil.isEmpty(paymentTime)) {
|
||||
orderYsDO.setPaymentDate(paymentTime);
|
||||
break;
|
||||
}
|
||||
}
|
||||
orderYsMapper.updateById(orderYsDO);
|
||||
}
|
||||
}else{
|
||||
if (ObjectUtil.isNotEmpty(orderYsDO)) {
|
||||
orderYsMapper.deleteById(orderYsDO.getId());
|
||||
}
|
||||
orderYsMapper.updateById(orderYsDO);
|
||||
}
|
||||
ProjectOrderDO updateObj = BeanUtils.toBean(updateReqVO, ProjectOrderDO.class);
|
||||
projectOrderMapper.updateById(updateObj);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -516,6 +518,7 @@ public class ProjectOrderServiceImpl implements ProjectOrderService {
|
||||
}else{
|
||||
if ("ALTER".equals(operateReqVO.getActive())){
|
||||
updateProjectOrderPrice(operateReqVO);
|
||||
updateProjectOrder(operateReqVO);
|
||||
}else {
|
||||
updateProjectOrder(operateReqVO);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user