|
|
@@ -46,9 +46,15 @@ import org.springblade.los.basic.corps.service.IBCorpsTypeDefineService;
|
|
|
import org.springblade.los.basic.corps.service.IBCorpsTypesService;
|
|
|
import org.springblade.los.basic.corps.vo.BCorpsVO;
|
|
|
import org.springblade.los.basic.utils.ExtendedData;
|
|
|
+import org.springblade.los.business.amends.entity.Amends;
|
|
|
+import org.springblade.los.business.amends.service.IAmendsService;
|
|
|
+import org.springblade.los.business.sea.entity.Bills;
|
|
|
+import org.springblade.los.business.sea.service.IBillsService;
|
|
|
import org.springblade.los.excel.BCorpsExcel;
|
|
|
import org.springblade.los.finance.fee.entity.FeeCenter;
|
|
|
+import org.springblade.los.finance.fee.entity.FinAccBills;
|
|
|
import org.springblade.los.finance.fee.service.IFeeCenterService;
|
|
|
+import org.springblade.los.finance.fee.service.IFinAccBillsService;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
@@ -85,6 +91,12 @@ public class BCorpsController extends BladeController {
|
|
|
|
|
|
private final IFeeCenterService feeCenterService;
|
|
|
|
|
|
+ private final IFinAccBillsService finAccBillsService;
|
|
|
+
|
|
|
+ private final IBillsService billsService;
|
|
|
+
|
|
|
+ private final IAmendsService amendsService;
|
|
|
+
|
|
|
private final IBCorpsAttnService corpsAttnService;
|
|
|
|
|
|
/**
|
|
|
@@ -528,4 +540,118 @@ public class BCorpsController extends BladeController {
|
|
|
return R.data(corps);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 客户修改及同步业务数据
|
|
|
+ */
|
|
|
+ @PostMapping("/updateSynchronize")
|
|
|
+ @RepeatSubmit
|
|
|
+ public R updateSynchronize(@Valid @RequestBody BCorps bCorps) throws Exception {
|
|
|
+ List<FeeCenter> feeCenterList = feeCenterService.list(new LambdaQueryWrapper<FeeCenter>()
|
|
|
+ .eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FeeCenter::getIsDeleted, 0)
|
|
|
+ .and(i -> i.eq(FeeCenter::getCorpId, bCorps.getId()).or()
|
|
|
+ .eq(FeeCenter::getBillCorpId, bCorps.getId()).or()
|
|
|
+ .eq(FeeCenter::getBookingAgentId, bCorps.getId()).or()
|
|
|
+ .eq(FeeCenter::getGenerationCorpId, bCorps.getId())));
|
|
|
+ if (!feeCenterList.isEmpty()){
|
|
|
+ for (FeeCenter item : feeCenterList){
|
|
|
+ if (bCorps.getId().equals(item.getCorpId())){
|
|
|
+ item.setCorpCnName(bCorps.getCnName());
|
|
|
+ item.setCorpEnName(bCorps.getEnName());
|
|
|
+ item.setShortName(bCorps.getShortName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getBillCorpId())){
|
|
|
+ item.setBillCorpCnName(bCorps.getCnName());
|
|
|
+ item.setBillCorpEnName(bCorps.getEnName());
|
|
|
+ item.setBillShortName(bCorps.getShortName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getBookingAgentId())){
|
|
|
+ item.setBookingAgentCnName(bCorps.getCnName());
|
|
|
+ item.setBookingAgentEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getGenerationCorpId())){
|
|
|
+ item.setGenerationCorpCnName(bCorps.getCnName());
|
|
|
+ item.setGenerationCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ feeCenterService.updateBatchById(feeCenterList);
|
|
|
+ }
|
|
|
+ List<FinAccBills> finAccBillsList = finAccBillsService.list(new LambdaQueryWrapper<FinAccBills>()
|
|
|
+ .eq(FinAccBills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(FinAccBills::getIsDeleted, 0)
|
|
|
+ .and(i -> i.eq(FinAccBills::getCorpId, bCorps.getId()).or()
|
|
|
+ .eq(FinAccBills::getBillCorpId, bCorps.getId()).or()
|
|
|
+ .eq(FinAccBills::getBookingAgentId, bCorps.getId()).or()
|
|
|
+ .eq(FinAccBills::getGenerationCorpId, bCorps.getId())));
|
|
|
+ if (!finAccBillsList.isEmpty()){
|
|
|
+ for (FinAccBills item : finAccBillsList){
|
|
|
+ if (bCorps.getId().equals(item.getCorpId())){
|
|
|
+ item.setCorpCnName(bCorps.getCnName());
|
|
|
+ item.setCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getBillCorpId())){
|
|
|
+ item.setBillCorpCnName(bCorps.getCnName());
|
|
|
+ item.setBillCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getBookingAgentId())){
|
|
|
+ item.setBookingAgentCnName(bCorps.getCnName());
|
|
|
+ item.setBookingAgentEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getGenerationCorpId())){
|
|
|
+ item.setGenerationCorpCnName(bCorps.getCnName());
|
|
|
+ item.setGenerationCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ finAccBillsService.updateBatchById(finAccBillsList);
|
|
|
+ }
|
|
|
+ List<Bills> billsList = billsService.list(new LambdaQueryWrapper<Bills>()
|
|
|
+ .eq(Bills::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Bills::getIsDeleted, 0)
|
|
|
+ .and(i -> i.eq(Bills::getCorpId, bCorps.getId()).or()
|
|
|
+ .eq(Bills::getCarrierId, bCorps.getId()).or()
|
|
|
+ .eq(Bills::getBookingAgentId, bCorps.getId()).or()
|
|
|
+ .eq(Bills::getForeignAgencyId, bCorps.getId())));
|
|
|
+ if (!billsList.isEmpty()){
|
|
|
+ for (Bills item : billsList){
|
|
|
+ if (bCorps.getId().equals(item.getCorpId())){
|
|
|
+ item.setCorpCnName(bCorps.getCnName());
|
|
|
+ item.setCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getCarrierId())){
|
|
|
+ item.setCarrierCnName(bCorps.getCnName());
|
|
|
+ item.setCarrierEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getBookingAgentId())){
|
|
|
+ item.setBookingAgentCnName(bCorps.getCnName());
|
|
|
+ item.setBookingAgentEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getForeignAgencyId())){
|
|
|
+ item.setForeignAgencyCnName(bCorps.getCnName());
|
|
|
+ item.setForeignAgencyEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ billsService.updateBatchById(billsList);
|
|
|
+ }
|
|
|
+ List<Amends> amendsList = amendsService.list(new LambdaQueryWrapper<Amends>()
|
|
|
+ .eq(Amends::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(Amends::getIsDeleted, 0)
|
|
|
+ .and(i -> i.eq(Amends::getCorpId, bCorps.getId()).or()
|
|
|
+ .eq(Amends::getCarrierId, bCorps.getId())));
|
|
|
+ if (!amendsList.isEmpty()){
|
|
|
+ for (Amends item : amendsList){
|
|
|
+ if (bCorps.getId().equals(item.getCorpId())){
|
|
|
+ item.setCorpCnName(bCorps.getCnName());
|
|
|
+ item.setCorpEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ if (bCorps.getId().equals(item.getCarrierId())){
|
|
|
+ item.setCarrierCnName(bCorps.getCnName());
|
|
|
+ item.setCarrierEnName(bCorps.getEnName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ amendsService.updateBatchById(amendsList);
|
|
|
+ }
|
|
|
+ return bCorpsService.submit(bCorps);
|
|
|
+ }
|
|
|
+
|
|
|
}
|