Prechádzať zdrojové kódy

2024年6月13日17:05:39

纪新园 1 rok pred
rodič
commit
c6dc14954a

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

@@ -98,7 +98,9 @@ public class BillsController extends BladeController {
 			Bills::getStlCrStatusDescr, Bills::getStlDrStatusDescr, Bills::getInvoiceCrStatusDescr, Bills::getInvoiceDrStatusDescr, Bills::getCreateUserName,
 			Bills::getCreateTime, Bills::getUpdateUserName, Bills::getUpdateTime, Bills::getStatus, Bills::getBillStatus,
 			Bills::getAccountStatus, Bills::getRemarks, Bills::getPackingUnit, Bills::getBillDate, Bills::getTeamName,
-			Bills::getCreateUser, Bills::getTeu, Bills::getIssueType, Bills::getBookingNo, Bills::getQuantityCntrDescr);
+			Bills::getCreateUser, Bills::getTeu, Bills::getIssueType, Bills::getBookingNo, Bills::getQuantityCntrDescr,
+			Bills::getCyCnName,Bills::getCarrierCnName,Bills::getSrcType,Bills::getSrcCnName,Bills::getBookingAgentCnName,
+			Bills::getHconsigneeCnName,Bills::getCreateDeptName,Bills::getLineCnName);
 		lambdaQueryWrapper.eq(Bills::getIsDeleted, 0)
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.and(i -> i.isNull(Bills::getMasterId).or()
@@ -467,7 +469,9 @@ public class BillsController extends BladeController {
 			Bills::getStlCrStatusDescr, Bills::getStlDrStatusDescr, Bills::getInvoiceCrStatusDescr, Bills::getInvoiceDrStatusDescr, Bills::getCreateUserName,
 			Bills::getCreateTime, Bills::getUpdateUserName, Bills::getUpdateTime, Bills::getStatus, Bills::getBillStatus,
 			Bills::getAccountStatus, Bills::getRemarks, Bills::getPackingUnit, Bills::getBillDate, Bills::getTeamName,
-			Bills::getCreateUser, Bills::getTeu, Bills::getIssueType, Bills::getBookingNo, Bills::getQuantityCntrDescr);
+			Bills::getCreateUser, Bills::getTeu, Bills::getIssueType, Bills::getBookingNo, Bills::getQuantityCntrDescr,
+			Bills::getCyCnName,Bills::getCarrierCnName,Bills::getSrcType,Bills::getSrcCnName,Bills::getBookingAgentCnName,
+			Bills::getHconsigneeCnName,Bills::getCreateDeptName,Bills::getLineCnName);
 		lambdaQueryWrapper.eq(Bills::getIsDeleted, 0)
 			.eq(Bills::getTenantId, AuthUtil.getTenantId())
 			.and(i -> i.isNull(Bills::getMasterId).or()

+ 10 - 6
blade-service/blade-los/src/main/java/org/springblade/los/check/service/impl/AuditProecessServiceImpl.java

@@ -1462,14 +1462,18 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 		for (FeeCenter item : rateListC) {
 			rateCRmb = rateCRmb.add(item.getAmount().multiply(item.getExrate()));
 		}
-		rateC = rateCRmb.divide(amountCUsd, MathContext.DECIMAL32).setScale(4, RoundingMode.HALF_UP);
+		if (new BigDecimal("0.00").compareTo(rateCRmb) != 0) {
+			rateC = rateCRmb.divide(amountCUsd, MathContext.DECIMAL32).setScale(4, RoundingMode.HALF_UP);
+		}
 		BigDecimal rateD = new BigDecimal("0.00");
 		BigDecimal rateDRmb = new BigDecimal("0.00");
 		List<FeeCenter> rateListD = feeCenterList.stream().filter(e -> "USD".equals(e.getCurCode()) && "D".equals(e.getDc())).collect(Collectors.toList());
 		for (FeeCenter item : rateListD) {
 			rateDRmb = rateDRmb.add(item.getAmount().multiply(item.getExrate()));
 		}
-		rateD = rateDRmb.divide(amountDUsd, MathContext.DECIMAL32).setScale(4, RoundingMode.HALF_UP);
+		if (new BigDecimal("0.00").compareTo(rateDRmb) != 0) {
+			rateD = rateDRmb.divide(amountDUsd, MathContext.DECIMAL32).setScale(4, RoundingMode.HALF_UP);
+		}
 		//创建凭证主表信息
 		FinVouchers finVouchers = new FinVouchers();
 		String deptId = "";
@@ -1622,9 +1626,9 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 				}
 				//计算借,贷人民币与美金合计人民币金额
 				finVouchersItems.setAmountDrLoc(ObjectUtils.isNull(finVouchersItems.getAmountDr()) ? new BigDecimal("0") : finVouchersItems.getAmountDr()
-					.add(bCurrencyService.converterCny("USD", ObjectUtils.isNull(finVouchersItems.getAmountDrUsd()) ? new BigDecimal("0") : finVouchersItems.getAmountDrUsd(), "D","1")));
+					.add(bCurrencyService.converterCny("USD", ObjectUtils.isNull(finVouchersItems.getAmountDrUsd()) ? new BigDecimal("0") : finVouchersItems.getAmountDrUsd(), "D", "1")));
 				finVouchersItems.setAmountCrLoc(ObjectUtils.isNull(finVouchersItems.getAmountCr()) ? new BigDecimal("0") : finVouchersItems.getAmountCr()
-					.add(bCurrencyService.converterCny("USD", ObjectUtils.isNull(finVouchersItems.getAmountCrUsd()) ? new BigDecimal("0") : finVouchersItems.getAmountCrUsd(), "C","1")));
+					.add(bCurrencyService.converterCny("USD", ObjectUtils.isNull(finVouchersItems.getAmountCrUsd()) ? new BigDecimal("0") : finVouchersItems.getAmountCrUsd(), "C", "1")));
 				finVouchersItems.setIsCorp(accounts.getIsCorp());
 				//判断是否核算客户 true 向明细中客户字段复制
 				if (1 == finVouchersItems.getIsCorp()) {
@@ -1752,8 +1756,8 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, L
 			.filter(e -> "USD".equals(e.getCurCode()) && "C".equals(e.getDc())).map(FinVouchersItems::getAmountCrUsd)
 			.filter(ObjectUtils::isNotNull).reduce(BigDecimal.ZERO, BigDecimal::add));
 		finVouchers.setAmountCrUsd(amountCrUSD);
-		finVouchers.setAmountDrLoc(amountDrCNY.add(bCurrencyService.converterCny("USD", amountDrUSD, "D","1")));
-		finVouchers.setAmountCrLoc(amountCrCNY.add(bCurrencyService.converterCny("USD", amountCrUSD, "C","1")));
+		finVouchers.setAmountDrLoc(amountDrCNY.add(bCurrencyService.converterCny("USD", amountDrUSD, "D", "1")));
+		finVouchers.setAmountCrLoc(amountCrCNY.add(bCurrencyService.converterCny("USD", amountCrUSD, "C", "1")));
 		finVouchers.setDescr(finVouchersItemsList.get(0).getDescr());
 		if (finVouchersItemsList.stream().anyMatch(e -> "USD".equals(e.getCurCode()))) {
 			finVouchers.setIsForeign(1);

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/accountManagement/controller/AccountManagementController.java

@@ -149,6 +149,9 @@ public class AccountManagementController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		if (!AuthUtil.getUserRole().contains("admin")) {
+			throw new RuntimeException("暂无权限,删除失败");
+		}
 		List<Long> list = Func.toLongList(ids);
 		if (!list.isEmpty()) {
 			if (settlementService.count(new LambdaQueryWrapper<PjSettlement>()

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/controller/BrandDescController.java

@@ -196,6 +196,9 @@ public class BrandDescController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		if (!AuthUtil.getUserRole().contains("admin")) {
+			throw new RuntimeException("暂无权限,请联系管理员");
+		}
 		List<Long> list = Func.toLongList(ids);
 		if (!list.isEmpty()) {
 			if (goodsDescService.count(new LambdaQueryWrapper<PjGoodsDesc>()

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java

@@ -220,7 +220,7 @@ public class CorpsDescController extends BladeController {
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		if (!AuthUtil.getUserRole().contains("admin") && !AuthUtil.getUserRole().contains("基础资料")) {
+		if (!AuthUtil.getUserRole().contains("admin")) {
 			throw new RuntimeException("暂无权限,删除失败");
 		}
 		List<Long> list = Func.toLongList(ids);

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java

@@ -220,6 +220,9 @@ public class GoodsDescController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		if (!AuthUtil.getUserRole().contains("admin")) {
+			throw new RuntimeException("暂无权限,请联系管理员");
+		}
 		List<Long> list = Func.toLongList(ids);
 		if (!list.isEmpty()) {
 			if (orderItemsService.count(new LambdaQueryWrapper<PjOrderItems>()

+ 1 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/controller/OrderController.java

@@ -114,6 +114,7 @@ public class OrderController extends BladeController {
 			.eq(ObjectUtils.isNotEmpty(order.getStorageId()), PjOrder::getStorageId, order.getStorageId())//仓库
 			.eq(ObjectUtils.isNotEmpty(order.getReturnsStatus()), PjOrder::getReturnsStatus, order.getReturnsStatus())//退货状态
 			.like(ObjectUtils.isNotEmpty(order.getStorageName()), PjOrder::getStorageName, order.getStorageName())
+			.like(ObjectUtils.isNotEmpty(order.getSalerName()), PjOrder::getSalerName, order.getSalerName())
 			.eq(ObjectUtils.isNotEmpty(order.getCustomerId()), PjOrder::getCustomerId, order.getCustomerId())//客户
 			.eq(ObjectUtils.isNotEmpty(order.getGenerateTask()), PjOrder::getGenerateTask, order.getGenerateTask())//客户
 			.eq(ObjectUtils.isNotEmpty(order.getSalerId()), PjOrder::getSalerId, order.getSalerId())//业务员

+ 4 - 4
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml

@@ -297,7 +297,7 @@
             and o.bs_type = 'CG'
         </if>
         GROUP BY
-        o.saler_id,o.customer_name,
+        o.saler_id,o.customer_id,
             DATE_FORMAT(
                 o.busines_date,
                 '%Y-%m')
@@ -354,7 +354,7 @@
             and o.bs_type = 'CG'
         </if>
         GROUP BY
-        o.saler_id,o.customer_name,
+        o.saler_id,o.customer_id,
         DATE_FORMAT(
         o.busines_date,
         '%Y-%m')
@@ -563,7 +563,7 @@
             po.customer_name AS customerName,
             po.customer_id as id,
         </if>
-        sum(if(po.freight,po.freight,0)) as freight,
+        sum( IF ( po.`status` != '已取消', po.freight, 0 ))AS freight,
         SUM( if(poi.goods_num,poi.goods_num,0) ) AS salesQuantity,
         SUM( if(poi.returns_number,poi.returns_number,0) ) AS returnQuantity,
         SUM( if(poi.sub_total_money,poi.sub_total_money,0.00) ) AS salesAmount,
@@ -628,7 +628,7 @@
             po.customer_name AS customerName,
             po.customer_id as id,
         </if>
-        sum(if(po.freight,po.freight,0)) as freight,
+        sum( IF ( po.`status` != '已取消', po.freight, 0 ))AS freight,
         SUM( if(poi.goods_num,poi.goods_num,0) ) AS salesQuantity,
         SUM( if(poi.returns_number,poi.returns_number,0) ) AS returnQuantity,
         SUM( if(poi.sub_total_money,poi.sub_total_money,0.00) ) AS salesAmount,

+ 3 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/statistics/service/impl/StatisticsServiceImpl.java

@@ -562,6 +562,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 					for (SaleDetailDto items : saleDetailDtoList) {
 						if ("已取消".equals(items.getStatus())) {
 							items.setBalanceAmount(new BigDecimal("0.00"));
+							items.setFreight(new BigDecimal("0.00"));
 						} else {
 							if ("TKXS".equals(item.getBsType())) {
 								if (saleDetailDtoList.size() == 1 && number.compareTo(new BigDecimal(1)) <= 0 &&
@@ -641,7 +642,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 			BigDecimal profitReturns = saleDetailDtoList.stream().filter(e -> "已完成".equals(e.getStatus()))
 				.map(SaleDetailDto::getProfit).reduce(BigDecimal.ZERO, BigDecimal::add)
 				.setScale(0, RoundingMode.HALF_UP);
-			if ("TKXS".equals(saleDetailDto.getBsType()) || "TKGS".equals(saleDetailDto.getBsType())) {
+			if ("TKXS".equals(saleDetailDto.getBsType()) || "TKCG".equals(saleDetailDto.getBsType())) {
 				map.put("goodsSum", new BigDecimal("0"));
 				map.put("amount", new BigDecimal("0"));
 				map.put("costprie", new BigDecimal("0"));
@@ -696,6 +697,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
 					for (SaleDetailDto items : saleDetailDtoList) {
 						if ("已取消".equals(items.getStatus())) {
 							items.setBalanceAmount(new BigDecimal("0.00"));
+							items.setFreight(new BigDecimal("0.00"));
 						} else {
 							if ("TKXS".equals(item.getBsType())) {
 								if (saleDetailDtoList.size() == 1 && number.compareTo(new BigDecimal(1)) <= 0 &&

+ 3 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/storage/controller/StorageDescController.java

@@ -153,6 +153,9 @@ public class StorageDescController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		if (!AuthUtil.getUserRole().contains("admin")) {
+			throw new RuntimeException("暂无权限,删除失败");
+		}
 		List<Long> list = Func.toLongList(ids);
 		if (!list.isEmpty()) {
 			if (orderService.count(new LambdaQueryWrapper<PjOrder>()