master
guochaojie 3 months ago
parent d453cefa39
commit a8483ee3aa

@ -571,15 +571,16 @@ public class RecycleDeliveryOrderServiceImpl extends ServiceImpl<RecycleDelivery
.set(RecycleDeliveryOrderEntity::getLastModifyTime, form.getLastModifyTime()) .set(RecycleDeliveryOrderEntity::getLastModifyTime, form.getLastModifyTime())
.eq(RecycleDeliveryOrderEntity::getId, form.getId()); .eq(RecycleDeliveryOrderEntity::getId, form.getId());
//如果重量不一致则改为调整通过 //如果重量不一致则改为调整通过
if (!entity.getReportWeight().equals(form.getAdjustWeight()) && "1".equals(form.getAdjustStatus())) { if (entity.getReportWeight().compareTo(form.getAdjustWeight()) != 0 && "1".equals(form.getAdjustStatus())) {
wrapper.lambda().set(RecycleDeliveryOrderEntity::getAdjustStatus, "2"); wrapper.lambda().set(RecycleDeliveryOrderEntity::getAdjustStatus, "2");
} }
//如果是拒绝的话 将审核重量以及单价全部改为0 //如果是拒绝的话 将审核重量以及单价全部改为0
if ("4".equals(form.getAdjustStatus())) { if ("3".equals(form.getAdjustStatus())) {
wrapper.lambda().set(RecycleDeliveryOrderEntity::getAdjustWeight, 0) wrapper.lambda().set(RecycleDeliveryOrderEntity::getAdjustWeight, 0)
.set(RecycleDeliveryOrderEntity::getAdjustPrice, 0); .set(RecycleDeliveryOrderEntity::getAdjustPrice, 0);
} }
boolean update = this.update(wrapper); boolean update = this.update(wrapper);
entity = this.getById(form.getId());
if (update) { if (update) {
BigDecimal price = entity.getAdjustPrice(); BigDecimal price = entity.getAdjustPrice();
String orderNo = entity.getOrderNo(); String orderNo = entity.getOrderNo();
@ -653,6 +654,7 @@ public class RecycleDeliveryOrderServiceImpl extends ServiceImpl<RecycleDelivery
enterpriseAccountBillService.save(billEntity); enterpriseAccountBillService.save(billEntity);
// 添加散户流水 // 添加散户流水
ClientAccountDetailEntity clientAccountDetail = new ClientAccountDetailEntity(); ClientAccountDetailEntity clientAccountDetail = new ClientAccountDetailEntity();
clientAccountDetail.setOrderNumber(orderNo);
clientAccountDetail.setClientId(client.getId()); clientAccountDetail.setClientId(client.getId());
clientAccountDetail.setAmount(amount); clientAccountDetail.setAmount(amount);
clientAccountDetail.setChangeType("1"); clientAccountDetail.setChangeType("1");

@ -649,15 +649,15 @@ public class RecycleOrderServiceImpl extends ServiceImpl<RecycleOrderMapper, Rec
} }
//散户下单 //散户下单
response.setDoorRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.SH_ORDER.getCode())).count()); response.setDoorRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.SH_ORDER.getCode())).count());
response.setDoorRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.SH_ORDER.getCode())) response.setDoorRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.SH_ORDER.getCode()) && Objects.nonNull(obj.getOrderAmount()))
.map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); .map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
//定时回收 //定时回收
response.setRegularRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.TM_RECOVERY.getCode())).count()); response.setRegularRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.TM_RECOVERY.getCode())).count());
response.setRegularRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.TM_RECOVERY.getCode())) response.setRegularRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.TM_RECOVERY.getCode())&& Objects.nonNull(obj.getOrderAmount()))
.map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); .map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
//到站回收 //到站回收
response.setInboundRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.DZ_RECOVERY.getCode())).count()); response.setInboundRecycleOrders((int) list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.DZ_RECOVERY.getCode())).count());
response.setInboundRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.DZ_RECOVERY.getCode())) response.setInboundRecyclePrice(list.stream().filter(obj -> obj.getOrderTypeId().equals(OrderTypeEnum.DZ_RECOVERY.getCode())&& Objects.nonNull(obj.getOrderAmount()))
.map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add)); .map(RecycleOrderEntity::getOrderAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
return response; return response;
} }

@ -411,20 +411,21 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
}else{ }else{
} }
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
RecycleStationStaffEntity saved = this.getById(entity.getId());
//RecycleStaffDevice子表数据新增修改 //RecycleStaffDevice子表数据新增修改
if(!isSave){ if(!isSave){
QueryWrapper<RecycleStaffDeviceEntity> RecycleStaffDevicequeryWrapper = new QueryWrapper<>(); QueryWrapper<RecycleStaffDeviceEntity> RecycleStaffDevicequeryWrapper = new QueryWrapper<>();
RecycleStaffDevicequeryWrapper.lambda().eq(RecycleStaffDeviceEntity::getOpenId, entity.getOpenid()); RecycleStaffDevicequeryWrapper.lambda().eq(RecycleStaffDeviceEntity::getOpenId, saved.getOpenid());
recycleStaffDeviceService.remove(RecycleStaffDevicequeryWrapper); recycleStaffDeviceService.remove(RecycleStaffDevicequeryWrapper);
} }
if (recycleStationStaffForm.getRecycleStaffDeviceList()!=null){ if (recycleStationStaffForm.getRecycleStaffDeviceList()!=null){
List<RecycleStaffDeviceEntity> tableField114 = JsonUtil.getJsonToList(recycleStationStaffForm.getRecycleStaffDeviceList(),RecycleStaffDeviceEntity.class); List<RecycleStaffDeviceEntity> tableField114 = JsonUtil.getJsonToList(recycleStationStaffForm.getRecycleStaffDeviceList(),RecycleStaffDeviceEntity.class);
for(RecycleStaffDeviceEntity entitys : tableField114){ for(RecycleStaffDeviceEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setStationId(entity.getStationId()); entitys.setStationId(saved.getStationId());
entitys.setOpenId(entity.getOpenid()); entitys.setOpenId(saved.getOpenid());
entitys.setUserName(entity.getStaffsName()); entitys.setUserName(saved.getStaffsName());
entitys.setPhone(entity.getMobilePhone()); entitys.setPhone(saved.getMobilePhone());
if(isSave){ if(isSave){
}else{ }else{
} }

Loading…
Cancel
Save