Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

liyuan 7 mesi fa
parent
commit
f701328799

+ 10 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/business/sea/entity/Bills.java

@@ -1120,6 +1120,16 @@ public class Bills implements Serializable {
 	@TableField(updateStrategy = FieldStrategy.IGNORED)
 	private Date cyReturnTime;
 	/**
+	 * 实际开船日期
+	 */
+	@TableField(exist = false)
+	private Date actualEtd;
+	/**
+	 * 实际到港日期
+	 */
+	@TableField(exist = false)
+	private Date actualEta;
+	/**
 	 * IEIEC
 	 */
 	@TableField(exist = false)

+ 18 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/statisticAnalysis/FinanceProfitDtoList.java

@@ -159,6 +159,12 @@ public class FinanceProfitDtoList {
 	private BigDecimal realAmountDrUsd;
 
 	/**
+	 * 未收美元
+	 */
+	@ExcelProperty(value = "未收美元")
+	private BigDecimal notReceivedDrUsd;
+
+	/**
 	 * 应收(CNY)
 	 */
 	@ExcelProperty(value = "应收人民币")
@@ -171,6 +177,12 @@ public class FinanceProfitDtoList {
 	private BigDecimal realAmountDr;
 
 	/**
+	 * 未收人民币
+	 */
+	@ExcelProperty(value = "未收人民币")
+	private BigDecimal notReceivedDr;
+
+	/**
 	 * 合计应收
 	 */
 	@ExcelProperty(value = "合计应收")
@@ -183,6 +195,12 @@ public class FinanceProfitDtoList {
 	private BigDecimal realAmountDrLoc;
 
 	/**
+	 * 实际未收
+	 */
+	@ExcelProperty(value = "未收合计")
+	private BigDecimal notReceivedLoc;
+
+	/**
 	 * 应付(USD)
 	 */
 	@ExcelProperty(value = "应付美元")

+ 40 - 4
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/BillsController.java

@@ -201,11 +201,23 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getBillType()), Bills::getBillType, bills.getBillType())
 			.eq(ObjectUtils.isNotNull(bills.getBusinessType()), Bills::getBusinessType, bills.getBusinessType())
 			.eq(ObjectUtils.isNotNull(bills.getSeaType()), Bills::getSeaType, bills.getSeaType())
-			.eq(ObjectUtils.isNotNull(bills.getBillStatus()), Bills::getBillStatus, bills.getBillStatus())
 			.eq(ObjectUtils.isNotNull(bills.getStlDrStatusDescr()), Bills::getStlDrStatusDescr, bills.getStlDrStatusDescr())
 			.eq(ObjectUtils.isNotNull(bills.getStlCrStatusDescr()), Bills::getStlCrStatusDescr, bills.getStlCrStatusDescr())
 			.eq(ObjectUtils.isNotNull(bills.getAccountStatus()), Bills::getAccountStatus, bills.getAccountStatus())
 			.eq(ObjectUtils.isNotNull(bills.getStatus()), Bills::getStatus, bills.getStatus());
+		if (ObjectUtils.isNotNull(bills.getBillStatus())){
+			if ("1,2,3".contains(bills.getBillStatus()+"")){
+				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+			}else if (0 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNull(Bills::getMblno);
+			}else if (4 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getMblno);
+			}else if (5 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+			}else if (6 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+			}
+		}
 		if ("SE".equals(bills.getBusinessType())) {
 			if ("1".equals(bills.getBillSort())) {
 				lambdaQueryWrapper.orderByDesc(Bills::getEtd);
@@ -337,8 +349,20 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getSeaType()), Bills::getSeaType, bills.getSeaType())
 
 			.eq(ObjectUtils.isNotNull(bills.getMasterBillNo()), Bills::getMasterBillNo, bills.getMasterBillNo())
-			.eq(ObjectUtils.isNotNull(bills.getMasterId()), Bills::getMasterId, bills.getMasterId())
-			.eq(ObjectUtils.isNotNull(bills.getBillStatus()), Bills::getBillStatus, bills.getBillStatus());
+			.eq(ObjectUtils.isNotNull(bills.getMasterId()), Bills::getMasterId, bills.getMasterId());
+		if (ObjectUtils.isNotNull(bills.getBillStatus())){
+			if ("1,2,3".contains(bills.getBillStatus()+"")){
+				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+			}else if (0 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNull(Bills::getMblno);
+			}else if (4 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getMblno);
+			}else if (5 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+			}else if (6 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+			}
+		}
 		if ("SE".equals(bills.getBusinessType())) {
 			if ("1".equals(bills.getBillSort())) {
 				lambdaQueryWrapper.orderByDesc(Bills::getEtd);
@@ -705,9 +729,21 @@ public class BillsController extends BladeController {
 			.eq(ObjectUtils.isNotNull(bills.getBillType()), Bills::getBillType, bills.getBillType())
 			.eq(ObjectUtils.isNotNull(bills.getBusinessType()), Bills::getBusinessType, bills.getBusinessType())
 			.eq(ObjectUtils.isNotNull(bills.getSeaType()), Bills::getSeaType, bills.getSeaType())
-			.eq(ObjectUtils.isNotNull(bills.getBillStatus()), Bills::getBillStatus, bills.getBillStatus())
 			.eq(ObjectUtils.isNotNull(bills.getStatus()), Bills::getStatus, bills.getStatus())
 			.orderByDesc(Bills::getCreateTime);
+		if (ObjectUtils.isNotNull(bills.getBillStatus())){
+			if ("1,2,3".contains(bills.getBillStatus()+"")){
+				lambdaQueryWrapper.eq(Bills::getBillStatus, bills.getBillStatus());
+			}else if (0 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNull(Bills::getMblno);
+			}else if (4 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getMblno);
+			}else if (5 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEtd);
+			}else if (6 == bills.getBillStatus()){
+				lambdaQueryWrapper.isNotNull(Bills::getActualEta);
+			}
+		}
 		List<Bills> list = billsService.list(lambdaQueryWrapper);
 		List<BillsExcel> billsExcelList = new ArrayList<>();
 		R<List<DictBiz>> res1 = dictBizClient.getList("account_status");

+ 41 - 0
blade-service/blade-los/src/main/java/org/springblade/los/email/service/ISendMailLogService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.email.service;
+
+
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.los.mail.entity.SendMailLog;
+import org.springblade.los.mail.vo.SendMailLogVO;
+
+/**
+ * 邮件发送日志表 服务类
+ *
+ * @author Rain
+ */
+public interface ISendMailLogService extends BaseService<SendMailLog> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page        分页
+	 * @param sendMailLog 参数
+	 * @return 结果
+	 */
+	IPage<SendMailLogVO> selectSendMailLogPage(IPage<SendMailLogVO> page, SendMailLogVO sendMailLog);
+
+}

+ 12 - 4
blade-service/blade-los/src/main/java/org/springblade/los/finance/fee/mapper/FinAccBillsMapper.xml

@@ -571,8 +571,12 @@
             los_fin_acc_bills acc
         WHERE
         acc.is_deleted = '0'
-          and acc.stl_amount_dr_loc != acc.amount_dr_loc
-          and acc.stl_amount_cr_loc != acc.amount_cr_loc
+        <if test='fee.dc != null and fee.dc != "" and fee.dc == "D"'>
+            and acc.stl_amount_dr_loc != acc.amount_dr_loc
+        </if>
+        <if test='fee.dc != null and fee.dc != "" and fee.dc == "C"'>
+            and acc.stl_amount_cr_loc != acc.amount_cr_loc
+        </if>
         <if test='fee.tenantId != null and fee.tenantId != ""'>
             and acc.tenant_id = #{fee.tenantId}
         </if>
@@ -672,8 +676,12 @@
         los_fin_acc_bills acc
         WHERE
         acc.is_deleted = '0'
-        and acc.stl_amount_dr_loc != acc.amount_dr_loc
-        and acc.stl_amount_cr_loc != acc.amount_cr_loc
+        <if test='fee.dc != null and fee.dc != "" and fee.dc == "D"'>
+            and acc.stl_amount_dr_loc != acc.amount_dr_loc
+        </if>
+        <if test='fee.dc != null and fee.dc != "" and fee.dc == "C"'>
+            and acc.stl_amount_cr_loc != acc.amount_cr_loc
+        </if>
         <if test='fee.tenantId != null and fee.tenantId != ""'>
             and acc.tenant_id = #{fee.tenantId}
         </if>

+ 6 - 0
blade-service/blade-los/src/main/java/org/springblade/los/statisticAnalysis/service/impl/StatisticAnalysisServiceImpl.java

@@ -321,6 +321,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			item.setRealAmountDrLoc(item.getRealAmountDrUsd().multiply(exrateC).add(item.getRealAmountDr()).setScale(2, RoundingMode.HALF_UP));
 			item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
 			item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedDr(item.getAmountDr().subtract(item.getRealAmountDr()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedDrUsd(item.getAmountDrUsd().subtract(item.getRealAmountDrUsd()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedLoc(item.getAmountDrLoc().subtract(item.getRealAmountDrLoc()).setScale(2, RoundingMode.HALF_UP));
 		}
 		return R.data(page.setRecords(financeProfitList));
 	}
@@ -1498,6 +1501,9 @@ public class StatisticAnalysisServiceImpl implements IStatisticAnalysisService {
 			item.setRealAmountDrLoc(item.getRealAmountDrUsd().multiply(exrateC).add(item.getRealAmountDr()).setScale(2, RoundingMode.HALF_UP));
 			item.setAmountProfitLoc(item.getAmountDrLoc().subtract(item.getAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
 			item.setRealAmountProfitLoc(item.getRealAmountDrLoc().subtract(item.getRealAmountCrLoc()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedDr(item.getAmountDr().subtract(item.getRealAmountDr()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedDrUsd(item.getAmountDrUsd().subtract(item.getRealAmountDrUsd()).setScale(2, RoundingMode.HALF_UP));
+			item.setNotReceivedLoc(item.getAmountDrLoc().subtract(item.getRealAmountDrLoc()).setScale(2, RoundingMode.HALF_UP));
 		}
 		return financeProfitList;
 	}

+ 77 - 0
blade-service/blade-los/src/main/java/org/springblade/los/trade/service/impl/DispatchVehiclesServiceImpl.java

@@ -24,8 +24,12 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.los.Util.IDeptUtils;
+import org.springblade.los.basic.fees.entity.BFees;
+import org.springblade.los.basic.fees.service.IBFeesService;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.mapper.BillsMapper;
+import org.springblade.los.finance.fee.entity.FeeCenter;
+import org.springblade.los.finance.fee.mapper.FeeCenterMapper;
 import org.springblade.los.trade.entity.AgentItems;
 import org.springblade.los.trade.entity.DispatchVehicles;
 import org.springblade.los.trade.entity.InOutStorage;
@@ -39,6 +43,8 @@ import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -64,6 +70,10 @@ public class DispatchVehiclesServiceImpl extends ServiceImpl<DispatchVehiclesMap
 
 	private final AgentItemsMapper agentItemsMapper;
 
+	private final FeeCenterMapper feeCenterMapper;
+
+	private final IBFeesService bFeesService;
+
 	@Override
 	public IPage<DispatchVehiclesVO> selectDispatchVehiclesPage(IPage<DispatchVehiclesVO> page, DispatchVehiclesVO dispatchVehicles) {
 		return page.setRecords(baseMapper.selectDispatchVehiclesPage(page, dispatchVehicles));
@@ -178,6 +188,60 @@ public class DispatchVehiclesServiceImpl extends ServiceImpl<DispatchVehiclesMap
 		dispatchVehicles.setUpdateUserName(AuthUtil.getUserName());
 		dispatchVehicles.setDispatchVehiclesDate(new Date());
 		baseMapper.updateById(dispatchVehicles);
+		if (ObjectUtils.isNotNull(dispatchVehicles.getFreightPrice())
+			&& new BigDecimal("0.00").compareTo(dispatchVehicles.getFreightPrice()) != 0) {
+			BFees fees = bFeesService.getOne(new LambdaQueryWrapper<BFees>()
+				.eq(BFees::getTenantId, AuthUtil.getTenantId())
+				.eq(BFees::getIsDeleted, 0)
+				.eq(BFees::getCode, "LYF"));
+			if (fees == null) {
+				throw new RuntimeException("请先维护仓储费用基础信息");
+			}
+			FeeCenter feeCenter = new FeeCenter();
+			feeCenter.setCreateTime(new Date());
+			feeCenter.setCreateUser(AuthUtil.getUserId());
+			feeCenter.setCreateUserName(AuthUtil.getUserName());
+			if (ObjectUtils.isNotNull(AuthUtil.getDeptId())) {
+				feeCenter.setCreateDept(bills.getCreateDept());
+				feeCenter.setBranchId(bills.getBranchId());
+				feeCenter.setCreateDeptName(bills.getCreateDeptName());
+			}
+			feeCenter.setBusinessType(bills.getBusinessType());
+			feeCenter.setPid(bills.getId());
+			feeCenter.setLineNo(1L);
+			feeCenter.setBillNo(bills.getBillNo());
+			feeCenter.setBillDate(bills.getBillDate());
+			feeCenter.setCorpId(dispatchVehicles.getFleetId());
+			feeCenter.setCorpCnName(dispatchVehicles.getFleetName());
+			feeCenter.setBillCorpId(bills.getCorpId());
+			feeCenter.setBillCorpCnName(bills.getCorpCnName());
+			feeCenter.setMblno(bills.getMblno());
+			feeCenter.setPolId(bills.getPolId());
+			feeCenter.setPolCode(bills.getPolCode());
+			feeCenter.setPolCnName(bills.getPolCnName());
+			feeCenter.setPolEnName(bills.getPolEnName());
+			feeCenter.setPodId(bills.getPodId());
+			feeCenter.setPodCode(bills.getPodCode());
+			feeCenter.setPodCnName(bills.getPodCnName());
+			feeCenter.setPodEnName(bills.getPodEnName());
+			feeCenter.setFeeId(fees.getId());
+			feeCenter.setFeeCode(fees.getCode());
+			feeCenter.setFeeCnName(fees.getCnName());
+			feeCenter.setFeeEnName(fees.getEnName());
+			feeCenter.setDc("C");
+			feeCenter.setCurCode(fees.getCurNo());
+			feeCenter.setSort(1);
+			feeCenter.setElementsId(fees.getAccElementId());
+			feeCenter.setElementsCode(fees.getElementsCode());
+			feeCenter.setElementsCnName(fees.getAccElementName());
+			feeCenter.setElementsEnName(fees.getElementsEnName());
+			feeCenter.setUnitNo("JOB");
+			feeCenter.setQuantity(new BigDecimal("1.00"));
+			feeCenter.setPrice(dispatchVehicles.getFreightPrice());
+			feeCenter.setAmount(dispatchVehicles.getFreightPrice());
+			feeCenter.setSrcItemId(dispatchVehicles.getId());
+			feeCenterMapper.insert(feeCenter);
+		}
 		return R.data(dispatchVehicles);
 	}
 
@@ -208,6 +272,19 @@ public class DispatchVehiclesServiceImpl extends ServiceImpl<DispatchVehiclesMap
 		dispatchVehicles.setUpdateUserName(AuthUtil.getUserName());
 		dispatchVehicles.setDispatchVehiclesDate(new Date());
 		baseMapper.updateById(dispatchVehicles);
+		if (ObjectUtils.isNotNull(dispatchVehicles.getFreightPrice())
+			&& new BigDecimal("0.00").compareTo(dispatchVehicles.getFreightPrice()) != 0) {
+			FeeCenter feeCenter = feeCenterMapper.selectOne(new LambdaQueryWrapper<FeeCenter>()
+				.eq(FeeCenter::getTenantId,AuthUtil.getTenantId())
+				.eq(FeeCenter::getIsDeleted,0)
+				.eq(FeeCenter::getPid,bills.getId())
+				.eq(FeeCenter::getFeeCode,"LYF")
+				.eq(FeeCenter::getSrcItemId,dispatchVehicles.getId())
+				.eq(FeeCenter::getDc,"C"));
+			if (feeCenter != null){
+				feeCenterMapper.deleteById(feeCenter.getId());
+			}
+		}
 		return R.data(dispatchVehicles);
 	}