|
@@ -30,6 +30,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
+import vip.xiaonuo.biz.modular.bizauditlog.entity.BizAuditLog;
|
|
|
+import vip.xiaonuo.biz.modular.bizauditlog.service.BizAuditLogService;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
|
|
|
import vip.xiaonuo.biz.modular.bizloadappoint.param.*;
|
|
@@ -39,7 +41,9 @@ import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.param.BizOrderExportResult;
|
|
|
import vip.xiaonuo.biz.modular.bizorderconfig.entity.BizOrderConfig;
|
|
|
import vip.xiaonuo.biz.modular.bizservicecustomer.entity.BizServiceCustomerAccount;
|
|
|
+import vip.xiaonuo.biz.modular.bizservicecustomer.entity.BizServiceCustomerFlow;
|
|
|
import vip.xiaonuo.biz.modular.bizservicecustomer.service.BizServiceCustomerAccountService;
|
|
|
+import vip.xiaonuo.biz.modular.bizservicecustomer.service.BizServiceCustomerFlowService;
|
|
|
import vip.xiaonuo.biz.modular.bizsettle.entity.BizSettle;
|
|
|
import vip.xiaonuo.biz.modular.utils.CommonExportUtil;
|
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
@@ -77,9 +81,15 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
@Resource
|
|
|
private BizServiceCustomerAccountService bizServiceCustomerAccountService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BizServiceCustomerFlowService bizServiceCustomerFlowService;
|
|
|
+
|
|
|
@Resource
|
|
|
private BizConfigService bizConfigService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BizAuditLogService bizAuditLogService;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<BizLoadAppoint> page(BizLoadAppointPageParam bizLoadAppointPageParam) {
|
|
|
QueryWrapper<BizLoadAppoint> queryWrapper = getQueryWrapper(bizLoadAppointPageParam);
|
|
@@ -279,21 +289,25 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
@Override
|
|
|
public void delete(List<BizLoadAppointIdParam> bizLoadAppointIdParamList) {
|
|
|
// 执行删除
|
|
|
- //删除供应商
|
|
|
for(BizLoadAppointIdParam bizLoadAppointIdParam : bizLoadAppointIdParamList){
|
|
|
+ //删除供应商
|
|
|
List<BizLoadAppointSupplier> list = bizLoadAppointSupplierService.list(new QueryWrapper<BizLoadAppointSupplier>().lambda().
|
|
|
eq(BizLoadAppointSupplier::getAppointId, bizLoadAppointIdParam.getId()));
|
|
|
bizLoadAppointSupplierService.removeByIds(CollStreamUtil.toList(list,BizLoadAppointSupplier::getId));
|
|
|
|
|
|
+ //释放金额
|
|
|
BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointIdParam.getId());
|
|
|
BizServiceCustomerAccount oldCustomerAccount = bizServiceCustomerAccountService.getOne(new QueryWrapper<BizServiceCustomerAccount>().lambda().
|
|
|
eq(BizServiceCustomerAccount::getServiceCustomerId, bizLoadAppoint.getCustomerId()).
|
|
|
last("limit 1"));
|
|
|
if(ObjectUtil.isNotNull(oldCustomerAccount)){
|
|
|
- //订单起卸费(起卸单价*订单数量)
|
|
|
- BigDecimal olderPrice = bizLoadAppoint.getLoadPrice().divide(new BigDecimal(1000)).multiply(bizLoadAppoint.getOrderWeight());
|
|
|
- oldCustomerAccount.setLockAmount(oldCustomerAccount.getLockAmount().subtract(olderPrice));
|
|
|
- bizServiceCustomerAccountService.updateById(oldCustomerAccount);
|
|
|
+ if(StringUtils.equals(bizLoadAppoint.getPayType(),"1")){
|
|
|
+ //预付释放锁定金额
|
|
|
+ //订单起卸费(起卸单价*订单数量)
|
|
|
+ BigDecimal olderPrice = bizLoadAppoint.getLoadPrice().multiply(bizLoadAppoint.getOrderWeight()).divide(new BigDecimal(1000));
|
|
|
+ oldCustomerAccount.setLockAmount(oldCustomerAccount.getLockAmount().subtract(olderPrice));
|
|
|
+ bizServiceCustomerAccountService.updateById(oldCustomerAccount);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -352,6 +366,26 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
this.updateById(bizLoadAppoint);
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public void endCustomerSign(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
+ BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|
|
|
+ if(ObjectUtil.isEmpty(bizLoadAppointEditParam.getEndSign())){
|
|
|
+ throw new CommonException("签名不能为空!");
|
|
|
+ }
|
|
|
+ String endSign = bizLoadAppointEditParam.getEndSign();
|
|
|
+ if(bizLoadAppointEditParam.getEndSign().contains(StrUtil.COMMA)) {
|
|
|
+ endSign = StrUtil.split(endSign, StrUtil.COMMA).get(1);
|
|
|
+ }
|
|
|
+ String base64 = ImgUtil.toBase64DataUri(ImgUtil.scale(ImgUtil.toImage(endSign),
|
|
|
+ 100, 50, null), ImgUtil.IMAGE_TYPE_PNG);
|
|
|
+
|
|
|
+ bizLoadAppoint.setEndSign(base64);
|
|
|
+ bizLoadAppoint.setStatus("9");
|
|
|
+ bizLoadAppoint.setEndSignTime(new Date());
|
|
|
+ this.updateById(bizLoadAppoint);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void exportRecord(BizLoadAppointPageParam bizLoadAppointPageParam, HttpServletResponse response) {
|
|
|
QueryWrapper<BizLoadAppoint> queryWrapper = getQueryWrapper(bizLoadAppointPageParam);
|
|
@@ -384,6 +418,7 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
|
|
|
@Override
|
|
|
public void endLoad(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
+ //修改订单状态待填报
|
|
|
BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|
|
|
bizLoadAppoint.setEndReason(bizLoadAppointEditParam.getEndReason());
|
|
|
bizLoadAppoint.setStatus("7");
|
|
@@ -392,6 +427,7 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
|
|
|
@Override
|
|
|
public void fillLoad(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
+ //填报成功,待客户确认
|
|
|
BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|
|
|
bizLoadAppoint.setStatus("8");
|
|
|
bizLoadAppoint.setFillWeight(bizLoadAppointEditParam.getFillWeight().multiply(new BigDecimal(1000)));
|
|
@@ -399,6 +435,34 @@ public class BizLoadAppointServiceImpl extends ServiceImpl<BizLoadAppointMapper,
|
|
|
this.updateById(bizLoadAppoint);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void rejectOrder(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
+ BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|
|
|
+ bizLoadAppoint.setStatus("12");
|
|
|
+ this.updateById(bizLoadAppoint);
|
|
|
+
|
|
|
+ //插入审核记录
|
|
|
+ BizAuditLog bizAuditLog = new BizAuditLog();
|
|
|
+ bizAuditLog.setType("QXDD");
|
|
|
+ bizAuditLog.setDataId(bizLoadAppoint.getId());
|
|
|
+ bizAuditLog.setStatus("2");
|
|
|
+ bizAuditLog.setRemark(bizLoadAppointEditParam.getRejectRemark());
|
|
|
+ bizAuditLogService.save(bizAuditLog);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void sendConfirmLoad(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
+ BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|
|
|
+ if(StringUtils.equals(bizLoadAppoint.getLoadType(),"1")){
|
|
|
+ //内场
|
|
|
+ bizLoadAppoint.setStatus("11");
|
|
|
+ }else{
|
|
|
+ //外场
|
|
|
+ bizLoadAppoint.setStatus("6");
|
|
|
+ }
|
|
|
+ this.updateById(bizLoadAppoint);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void updateAppointNumber(BizLoadAppointEditParam bizLoadAppointEditParam) {
|
|
|
BizLoadAppoint bizLoadAppoint = this.queryEntity(bizLoadAppointEditParam.getId());
|