Browse Source

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

纪新园 7 months ago
parent
commit
12cd024990

+ 5 - 0
blade-common/src/main/java/org/springblade/common/enums/CommonEnum.java

@@ -18,6 +18,11 @@ public enum CommonEnum {
 	TWO("2"),
 
 	/**
+	 * 3
+	 */
+	THREE("3"),
+
+	/**
 	 * 4
 	 */
 	FOUR("4"),

+ 10 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/basic/zr/vo/ZrSendVo.java

@@ -0,0 +1,10 @@
+package org.springblade.los.basic.zr.vo;
+
+/**
+ * @author Rain
+ */
+public class ZrSendVo {
+
+
+
+}

+ 33 - 8
blade-service/blade-los/src/main/java/org/springblade/los/basic/reports/service/impl/ReportsServiceImpl.java

@@ -78,6 +78,7 @@ import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import java.math.BigDecimal;
@@ -2936,7 +2937,18 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 							if (feeCenterListMh.isEmpty()) {
 								throw new RuntimeException("请先维护费用信息");
 							}
+							List<Long> amendIds = feeCenterListMh.stream().filter(f -> AmendType.isAmendType(f.getBusinessType())).map(FeeCenter::getPid).distinct().collect(Collectors.toList());
 							allFeeCenter.addAll(feeCenterListMh);
+							if (!CollectionUtils.isEmpty(amendIds)) {
+								List<Amends> amendsList = amendsService.list(new LambdaQueryWrapper<Amends>()
+									.select(Amends::getId, Amends::getStatus).in(Amends::getId, amendIds));
+								feeCenterListMh = feeCenterListMh.stream().filter(fc -> {
+									// 是 amend 类型并没审核通过的不计入
+									Amends amends = amendsList.stream().filter(a -> a.getId().equals(fc.getPid())).findFirst().orElse(null);
+									return amends == null || CommonEnum.THREE.info.equals(String.valueOf(amends.getStatus()));
+								}).collect(Collectors.toList());
+							}
+
 							for (FeeCenter item : feeCenterListMh) {
 								if (ObjectUtils.isNotNull(item.getShortName())) {
 									item.setCorpCnName(item.getShortName());
@@ -3024,7 +3036,17 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 						.eq(FeeCenter::getMblno, bills.getMblno())
 						.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
 						.eq(FeeCenter::getIsDeleted, 0));
+					List<Long> amendIds = feeCenterList.stream().filter(f -> AmendType.isAmendType(f.getBusinessType())).map(FeeCenter::getPid).distinct().collect(Collectors.toList());
 					allFeeCenter.addAll(feeCenterList);
+					List<Amends> amendsList = amendsService.list(new LambdaQueryWrapper<Amends>()
+						.select(Amends::getId, Amends::getStatus).in(Amends::getId, amendIds));
+					if (!CollectionUtils.isEmpty(amendIds)) {
+						feeCenterList = feeCenterList.stream().filter(fc -> {
+							// 是 amend 类型并没审核通过的不计入
+							Amends amends = amendsList.stream().filter(a -> a.getId().equals(fc.getPid())).findFirst().orElse(null);
+							return amends == null || CommonEnum.THREE.info.equals(String.valueOf(amends.getStatus()));
+						}).collect(Collectors.toList());
+					}
 
 					List<FeeCenter> feeD = feeCenterList.stream().filter(e -> MagicValues.D.equals(e.getDc())).collect(Collectors.toList());
 					bills.setFeeCenterListD(feeD);
@@ -3049,10 +3071,6 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 								Comparator.comparing(f -> f.getFeeId() + f.getCorpId() + f.getCurCode() + f.getDc()))), ArrayList::new));
 						List<FeeCenterReports> feeCenterReportList = new ArrayList<>();
 						for (FeeCenter fee : feeCenters) {
-/*							if (AmendType.isAmendType(fee.getBusinessType()) && !CommonEnum.FOUR.info.equals(fee.getAuditStatus())) {
-								// 是 amend 类型并没审核通过的不计入
-								continue;
-							}*/
 							FeeCenterReports feeCenterReports = new FeeCenterReports();
 							feeCenterReports.setRemarks(fee.getRemarks());
 							feeCenterReports.setPid(bills.getId());
@@ -3113,6 +3131,7 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 						throw new RuntimeException("请先维护费用");
 					}
 					list.add(0, bills);
+					map.put(MagicValues.DATA, list);
 				} else if (MagicValues.MH.equals(bills.getBillType())) {
 					// 分单
 					Bills details = billsService.getOne(new LambdaQueryWrapper<Bills>()
@@ -3567,12 +3586,18 @@ public class ReportsServiceImpl extends ServiceImpl<ReportsMapper, Reports> impl
 
 						BigDecimal sumOFPS = new BigDecimal(BigInteger.ZERO);
 						if (item.equals(bills)) {
+							List<Long> amendIds = allFeeCenter.stream().filter(f -> AmendType.isAmendType(f.getBusinessType())).map(FeeCenter::getPid).distinct().collect(Collectors.toList());
+							List<Amends> amendsList = amendsService.list(new LambdaQueryWrapper<Amends>()
+								.select(Amends::getId, Amends::getStatus).in(Amends::getId, amendIds));
 							// 当前单据,计算 ProfitStatus
 							for (FeeCenter fee : allFeeCenter) {
-/*								if (AmendType.isAmendType(fee.getBusinessType()) && !CommonEnum.FOUR.info.equals(fee.getAuditStatus())) {
-									// 是 amend 类型并没审核通过的不计入
-									continue;
-								}*/
+								if (AmendType.isAmendType(fee.getBusinessType()) && !CollectionUtils.isEmpty(amendsList)) {
+									Amends amends = amendsList.stream().filter(a -> a.getId().equals(fee.getPid())).findFirst().orElse(null);
+									if (amends != null && !CommonEnum.THREE.info.equals(String.valueOf(amends.getStatus()))) {
+										// 是 amend 类型并没审核通过的不计入
+										continue;
+									}
+								}
 								if (MagicValues.C.equals(fee.getDc()) && "P/S".equals(fee.getFeeCode())) {
 									// if("USD".equals(fee.getCurCode())){
 									sumOFPS = sumOFPS.add(fee.getAmountLoc()).setScale(2, BigDecimal.ROUND_HALF_UP);

+ 2 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -532,8 +532,8 @@ public class UserController {
 	 */
 	@GetMapping("/selectListLos")
 	@ApiOperationSupport(order = 3)
-	public R<List<User>> selectListLos(@RequestParam("roles") String roles) {
-		return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(), roles));
+	public R<List<User>> selectListLos(@RequestParam("roles") String roles, @RequestParam(value = "account", required = false) String account) {
+		return userService.selectUserByRolesAndAccount(SysCache.getRoleIds(AuthUtil.getTenantId(), roles), account);
 	}
 
 

+ 10 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/service/IUserService.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.entity.UserInfo;
 import org.springblade.system.user.entity.UserOauth;
@@ -244,4 +245,13 @@ public interface IUserService extends BaseService<User> {
     List<User> selectListNotTenantId(String tenantId, String ids);
 
 	void updateByIdPointsBalance(List<User> users);
+
+	/**
+	 * 根据用户角色和账号查询用户
+	 *
+	 * @param roleIds 角色id
+	 * @param account 账号名
+	 * @return 结果
+	 */
+	R<List<User>> selectUserByRolesAndAccount(String roleIds, String account);
 }

+ 15 - 0
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -522,6 +522,21 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
 		}
 	}
 
+	@Override
+	public R<List<User>> selectUserByRolesAndAccount(String roleIds, String account) {
+		List<Long> roleIdList = Func.toLongList(roleIds);
+		LambdaQueryWrapper<User> queryWrapper = Wrappers.lambdaQuery();
+		String status = sysClient.getParamServiceNew("mall.data");
+		if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
+			queryWrapper.apply("find_in_set(dept_id,'" + AuthUtil.getDeptId() + "')");
+		}
+		if (StringUtil.isNotBlank(account)) {
+			queryWrapper.like(User::getAccount, account);
+		}
+		roleIdList.forEach(id -> queryWrapper.like(User::getRoleId, id).or());
+		return R.data(this.list(queryWrapper));
+	}
+
 	/**
 	 * 查询顶级部门ID
 	 */