|
|
@@ -1274,7 +1274,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
if (item.getStatus() > 0 && item.getStatus() < 3) {
|
|
|
throw new RuntimeException("分单提交请核,操作失败");
|
|
|
}
|
|
|
- item.setMblno(bills.getMblno());
|
|
|
item.setEtd(bills.getEtd());
|
|
|
item.setEta(bills.getEta());
|
|
|
item.setActualEta(bills.getActualEta());
|
|
|
@@ -1283,6 +1282,33 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setVesselCnName(bills.getVesselCnName());
|
|
|
item.setVesselEnName(bills.getVesselEnName());
|
|
|
item.setVoyageNo(bills.getVoyageNo());
|
|
|
+ item.setCarrierId(bills.getCarrierId());
|
|
|
+ item.setCarrierCnName(bills.getCarrierCnName());
|
|
|
+ item.setCarrierEnName(bills.getCarrierEnName());
|
|
|
+ item.setCarrierArgreementNo(bills.getCarrierArgreementNo());
|
|
|
+ item.setIssueDate(bills.getIssueDate());
|
|
|
+ item.setBranchId(bills.getBranchId());
|
|
|
+ item.setBranchName(bills.getBranchName());
|
|
|
+ item.setHpaymode(bills.getHpaymode());
|
|
|
+ item.setMpaymode(bills.getMpaymode());
|
|
|
+ item.setCyRemarks(bills.getCyRemarks());
|
|
|
+ item.setPolId(bills.getPolId());
|
|
|
+ item.setPolCode(bills.getPolCode());
|
|
|
+ item.setPolCnName(bills.getPolCnName());
|
|
|
+ item.setPolEnName(bills.getPolEnName());
|
|
|
+ item.setPodId(bills.getPodId());
|
|
|
+ item.setPodCode(bills.getPodCode());
|
|
|
+ item.setPodCnName(bills.getPodCnName());
|
|
|
+ item.setPodEnName(bills.getPodEnName());
|
|
|
+ item.setPlaceDeliveryId(bills.getPlaceDeliveryId());
|
|
|
+ item.setPlaceDeliveryName(bills.getPlaceDeliveryName());
|
|
|
+ item.setPlaceDeliveryCode(bills.getPlaceDeliveryCode());
|
|
|
+ item.setIssueAtId(bills.getIssueAtId());
|
|
|
+ item.setIssueAt(bills.getIssueAt());
|
|
|
+ item.setMblno(bills.getMblno());
|
|
|
+ item.setShippingAgencyId(bills.getShippingAgencyId());
|
|
|
+ item.setShippingAgencyCname(bills.getShippingAgencyCname());
|
|
|
+ item.setShippingAgencyEname(bills.getShippingAgencyEname());
|
|
|
item.setCyTrailerTime(bills.getCyTrailerTime());
|
|
|
item.setCyReturnTime(bills.getCyReturnTime());
|
|
|
item.setLineId(bills.getLineId());
|
|
|
@@ -1293,14 +1319,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setBookingAgentCnName(bills.getBookingAgentCnName());
|
|
|
item.setBookingAgentEnName(bills.getBookingAgentEnName());
|
|
|
item.setBookingDate(bills.getBookingDate());
|
|
|
- item.setShippingAgencyId(bills.getShippingAgencyId());
|
|
|
- item.setShippingAgencyCname(bills.getShippingAgencyCname());
|
|
|
- item.setShippingAgencyEname(bills.getShippingAgencyEname());
|
|
|
item.setMasterId(bills.getId());
|
|
|
item.setMasterBillNo(bills.getBillNo());
|
|
|
- item.setPlaceDeliveryId(bills.getPlaceDeliveryId());
|
|
|
- item.setPlaceDeliveryName(bills.getPlaceDeliveryName());
|
|
|
- item.setPlaceDeliveryCode(bills.getPlaceDeliveryCode());
|
|
|
item.setDestinationId(bills.getDestinationId());
|
|
|
item.setDestinationName(bills.getDestinationName());
|
|
|
item.setDestinationCode(bills.getDestinationCode());
|
|
|
@@ -1310,10 +1330,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setForeignAgencyEnName(bills.getForeignAgencyEnName());
|
|
|
item.setForeignAgencyDetails(bills.getForeignAgencyDetails());
|
|
|
item.setForeignCntyName(bills.getForeignCntyName());
|
|
|
- item.setCarrierId(bills.getCarrierId());
|
|
|
- item.setCarrierCnName(bills.getCarrierCnName());
|
|
|
- item.setCarrierEnName(bills.getCarrierEnName());
|
|
|
- item.setCarrierArgreementNo(bills.getCarrierArgreementNo());
|
|
|
item.setBoxBelongsTo(bills.getBoxBelongsTo());
|
|
|
item.setPortTerminalCyId(bills.getPortTerminalCyId());
|
|
|
item.setPortTerminalCyCode(bills.getPortTerminalCyCode());
|
|
|
@@ -1328,11 +1344,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
item.setCyAddress(bills.getCyAddress());
|
|
|
item.setCyContacts(bills.getCyContacts());
|
|
|
item.setCyTel(bills.getCyTel());
|
|
|
- item.setCyRemarks(bills.getCyRemarks());
|
|
|
- item.setHpaymode(bills.getHpaymode());
|
|
|
- item.setMpaymode(bills.getMpaymode());
|
|
|
- item.setIssueAtId(bills.getIssueAtId());
|
|
|
- item.setIssueAt(bills.getIssueAt());
|
|
|
item.setUpdateTime(new Date());
|
|
|
item.setUpdateUser(AuthUtil.getUserId());
|
|
|
item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
@@ -3925,6 +3936,8 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
}
|
|
|
this.updateBatchById(billsHList);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ idMList = billsList.stream().map(Bills::getId).collect(Collectors.toList());
|
|
|
}
|
|
|
Integer actId = null;
|
|
|
String processType = "";
|
|
|
@@ -5368,6 +5381,174 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
|
|
|
return R.data(billsFd);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public R submitConfirm(Bills bills) throws Exception {
|
|
|
+ Bills billsFd = baseMapper.selectOne(new LambdaQueryWrapper<Bills>()
|
|
|
+ .eq(Bills::getTenantId,AuthUtil.getTenantId())
|
|
|
+ .eq(Bills::getIsDeleted,0)
|
|
|
+ .eq(Bills::getTemporaryId,bills.getId()));
|
|
|
+ if (billsFd != null){
|
|
|
+ if (ObjectUtils.isNotNull(billsFd.getCyTrailerTime()) && billsFd.getCyTrailerTime().compareTo(new Date()) < 0) {
|
|
|
+ throw new RuntimeException("当前时间已超过截单日期,不允许修改");
|
|
|
+ }
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ String formatted = now.format(formatter);
|
|
|
+ //发送消息
|
|
|
+ if (ObjectUtils.isNotNull(billsFd.getOperatorId())) {
|
|
|
+ R<User> userR = userClient.userInfoById(billsFd.getOperatorId());
|
|
|
+ if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
+ User datum = userR.getData();
|
|
|
+ Message sendMessage = new Message();
|
|
|
+ sendMessage.setParameter(billsFd.getId() + "");
|
|
|
+ sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
+ sendMessage.setUserId(null);
|
|
|
+ sendMessage.setToUserId(datum.getId());
|
|
|
+ sendMessage.setToUserName(datum.getName());
|
|
|
+ sendMessage.setMessageType(1);
|
|
|
+ sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
+ sendMessage.setCreateUser(null);
|
|
|
+ sendMessage.setCreateTime(new Date());
|
|
|
+ sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
|
|
|
+ sendMessage.setPageLabel("海运出口");
|
|
|
+ sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
+ sendMessage.setMessageBody("您有客户订舱已提交确认,请及时待处理!提单号:" + billsFd.getMblno() + "时间:" + formatted);
|
|
|
+ R save = messageClient.save(sendMessage);
|
|
|
+ if (!save.isSuccess()) {
|
|
|
+ throw new SecurityException("发送消息失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //发送消息
|
|
|
+ if (ObjectUtils.isNotNull(billsFd.getCustomerServiceId())) {
|
|
|
+ R<User> userR = userClient.userInfoById(billsFd.getCustomerServiceId());
|
|
|
+ if (userR.isSuccess() && ObjectUtils.isNotNull(userR.getData())) {
|
|
|
+ User datum = userR.getData();
|
|
|
+ Message sendMessage = new Message();
|
|
|
+ sendMessage.setParameter(billsFd.getId() + "");
|
|
|
+ sendMessage.setUserName(AuthUtil.getUserName());
|
|
|
+ sendMessage.setUserId(null);
|
|
|
+ sendMessage.setToUserId(datum.getId());
|
|
|
+ sendMessage.setToUserName(datum.getName());
|
|
|
+ sendMessage.setMessageType(1);
|
|
|
+ sendMessage.setTenantId(AuthUtil.getTenantId());
|
|
|
+ sendMessage.setCreateUser(null);
|
|
|
+ sendMessage.setCreateTime(new Date());
|
|
|
+ sendMessage.setUrl("/iosBasicData/SeafreightExportF/bills/index");
|
|
|
+ sendMessage.setPageLabel("海运出口");
|
|
|
+ sendMessage.setPageStatus("this.$store.getters.domSaleStatus");
|
|
|
+ sendMessage.setMessageBody("您有客户订舱已提交确认,请及时待处理!提单号:" + billsFd.getMblno() + "时间:" + formatted);
|
|
|
+ R save = messageClient.save(sendMessage);
|
|
|
+ if (!save.isSuccess()) {
|
|
|
+ throw new SecurityException("发送消息失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bills.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ bills.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ bills.setUpdateTime(new Date());
|
|
|
+ bills.setConfirmStatus("1");
|
|
|
+ Integer V20 = 0;
|
|
|
+ Integer V40 = 0;
|
|
|
+ Integer V40HC = 0;
|
|
|
+ Integer V45 = 0;
|
|
|
+ Integer V48 = 0;
|
|
|
+ Integer other = 0;
|
|
|
+ BigDecimal teu = new BigDecimal("0.00");
|
|
|
+ StringBuilder boxTypeSum = new StringBuilder();
|
|
|
+ if (ObjectUtils.isNotNull(bills.getPreContainersList())) {
|
|
|
+ for (PreContainers item : bills.getPreContainersList()) {
|
|
|
+ if (ObjectUtils.isNull(item.getCntrTypeCode())) {
|
|
|
+ throw new RuntimeException("箱型不能为空");
|
|
|
+ }
|
|
|
+ if (item.getId() == null) {
|
|
|
+ item.setCreateTime(new Date());
|
|
|
+ item.setCreateUser(AuthUtil.getUserId());
|
|
|
+ item.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ } else {
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ }
|
|
|
+ item.setPid(bills.getId());
|
|
|
+ if (item.getCntrTypeCode().equals("20GP")) {
|
|
|
+ V20 += item.getQuantity();
|
|
|
+ } else if (item.getCntrTypeCode().equals("20HC")) {
|
|
|
+ V45 += item.getQuantity();
|
|
|
+ } else if (item.getCntrTypeCode().equals("40FR")) {
|
|
|
+ V48 += item.getQuantity();
|
|
|
+ } else if (item.getCntrTypeCode().equals("40GP")) {
|
|
|
+ V40 += item.getQuantity();
|
|
|
+ } else if (item.getCntrTypeCode().equals("40HC")) {
|
|
|
+ V40HC += item.getQuantity();
|
|
|
+ } else {
|
|
|
+ other += item.getQuantity();
|
|
|
+ }
|
|
|
+ boxTypeSum.append(item.getCntrTypeCode()).append("*").append(item.getQuantity()).append(",");
|
|
|
+ if (ObjectUtils.isNotNull(item.getQuantity()) && ObjectUtils.isNotNull(item.getTeu())) {
|
|
|
+ teu = teu.add(new BigDecimal(item.getQuantity()).multiply(item.getTeu()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ preContainersService.saveOrUpdateBatch(bills.getPreContainersList());
|
|
|
+ if (boxTypeSum.length() > 0) {
|
|
|
+ boxTypeSum = new StringBuilder(boxTypeSum.substring(0, boxTypeSum.length() - 1));
|
|
|
+ bills.setQuantityCntrDescr(boxTypeSum.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bills.setQuantityV20(V20);
|
|
|
+ bills.setQuantityV40(V40);
|
|
|
+ bills.setQuantityV40hc(V40HC);
|
|
|
+ bills.setQuantityV45(V45);
|
|
|
+ bills.setQuantityV48(V48);
|
|
|
+ bills.setQuantityOther(other);
|
|
|
+ bills.setTeu(teu.intValue());
|
|
|
+ baseMapper.updateById(bills);
|
|
|
+ if (ObjectUtils.isNotNull(bills.getContainersList())) {
|
|
|
+ for (Containers item : bills.getContainersList()) {
|
|
|
+ item.setPid(bills.getId());
|
|
|
+ if (item.getId() == null) {
|
|
|
+ item.setCreateTime(new Date());
|
|
|
+ item.setCreateUser(AuthUtil.getUserId());
|
|
|
+ item.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ } else {
|
|
|
+ item.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ item.setUpdateTime(new Date());
|
|
|
+ item.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ containersService.saveOrUpdateBatch(bills.getContainersList());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(bills.getDetail())) {
|
|
|
+ Object seaBillsDetailObject = StringTools.handle(bills.getDetail(), "SeaBillsDetail");
|
|
|
+ SeaBillsDetail seaBillsDetail = JSONObject.parseObject(JSONObject.toJSONString(seaBillsDetailObject), SeaBillsDetail.class);
|
|
|
+ if (ObjectUtils.isNotNull(seaBillsDetail.getId())) {
|
|
|
+ seaBillsDetail.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ seaBillsDetail.setUpdateUserName(AuthUtil.getUserName());
|
|
|
+ seaBillsDetail.setUpdateTime(new Date());
|
|
|
+ } else {
|
|
|
+ seaBillsDetail.setPid(bills.getId());
|
|
|
+ seaBillsDetail.setBranchId(bills.getBranchId());
|
|
|
+ seaBillsDetail.setCreateUser(AuthUtil.getUserId());
|
|
|
+ seaBillsDetail.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ seaBillsDetail.setCreateDept(bills.getCreateDept());
|
|
|
+ seaBillsDetail.setCreateDeptName(bills.getCreateDeptName());
|
|
|
+ seaBillsDetail.setCreateTime(new Date());
|
|
|
+ }
|
|
|
+ seaBillsDetailService.saveOrUpdate(seaBillsDetail);
|
|
|
+ String text = "";
|
|
|
+ if (ObjectUtils.isNotNull(seaBillsDetail.getHconsigneeDetails())) {
|
|
|
+ text = text + seaBillsDetail.getHconsigneeDetails() + ";";
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(seaBillsDetail.getHshipperDetails())) {
|
|
|
+ text = text + seaBillsDetail.getHshipperDetails() + ";";
|
|
|
+ }
|
|
|
+ bills.setReceivingAndShipping(text);
|
|
|
+ }
|
|
|
+ return R.data(bills);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除海运进出口明细表
|
|
|
*
|