Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8961100b31
3 files changed
+23
-13
No files matched your search
+1
-1
@@ -95,7 +95,7 @@ public class ZyTest {
|
||||
dto.setEPID("1");
|
||||
dto.setAccName("测试部门");
|
||||
dto.setEPID("1");
|
||||
ZyMerSyncAccountInfoVo vo = zyMerService.syncAccountInfoApi(List.of(dto));
|
||||
ZyMerSyncAccountInfoVo.DataVo vo = zyMerService.syncAccountInfoApi(List.of(dto));
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
|
||||
+10
-4
@@ -23,9 +23,11 @@ import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.code.MchCollectionCodeVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.MchManageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.MchManageService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletThirdZyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -56,6 +58,8 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final RemoteDeptService remoteDeptService;
|
||||
private final RemoteFileService remoteFileService;
|
||||
@Lazy
|
||||
private final WalletThirdZyService walletThirdZyService;
|
||||
|
||||
private final StringRedisTemplate redisTemplate;
|
||||
|
||||
@@ -74,9 +78,6 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
if (existDeptId(dto.getDeptId(), null)) {
|
||||
throw new RuntimeException("该部门已经绑定过商户");
|
||||
}
|
||||
// 查询父部门
|
||||
|
||||
// dto.setHardGroupId();
|
||||
baseMapper.insert(dto);
|
||||
try {
|
||||
MchCollectionCodeVo mchCollectionCode = new MchCollectionCodeVo();
|
||||
@@ -94,6 +95,7 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
e.printStackTrace();
|
||||
log.error("|{}|新增商户,生成收款码错误dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
walletThirdZyService.syncAllMch(dto.getId(), Boolean.FALSE);
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
@@ -111,6 +113,7 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
throw new RuntimeException("商户不存在");
|
||||
}
|
||||
baseMapper.updateById(dto);
|
||||
walletThirdZyService.syncAllMch(dto.getId(), Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,7 +121,10 @@ public class MchManageServiceImpl extends ServiceImpl<MchManageMapper, MchManage
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
baseMapper.deleteByIds(list);
|
||||
// 删除缓存
|
||||
list.forEach(v -> redisTemplate.opsForValue().getAndDelete(CacheConstants.WALLET_MCH + v));
|
||||
list.forEach(v -> {
|
||||
redisTemplate.opsForValue().getAndDelete(CacheConstants.WALLET_MCH + v);
|
||||
walletThirdZyService.syncAllMch(v, Boolean.TRUE);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
-8
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysRole;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteRoleService;
|
||||
@@ -46,7 +47,7 @@ import java.util.Optional;
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class MchThirdZyServiceImpl implements WalletThirdZyService {
|
||||
public class WalletThirdZyServiceImpl implements WalletThirdZyService {
|
||||
|
||||
private static final String TAG = "用户模块同步到正元信息";
|
||||
|
||||
@@ -107,23 +108,26 @@ public class MchThirdZyServiceImpl implements WalletThirdZyService {
|
||||
@Override
|
||||
public void syncAllDept(Long deptId, Boolean isDel) {
|
||||
MchManageDto dto = new MchManageDto();
|
||||
if(ObjectUtil.isNotEmpty(deptId)){
|
||||
if (ObjectUtil.isNotEmpty(deptId)) {
|
||||
MchManageVo mchManageVo = mchManageService.getFirstMchByDeptId(deptId);
|
||||
if(ObjectUtil.isNotEmpty(mchManageVo)){
|
||||
if (ObjectUtil.isNotEmpty(mchManageVo)) {
|
||||
dto.setDeptId(mchManageVo.getDeptId());
|
||||
}
|
||||
}
|
||||
List<MchManageVo> mchList = mchManageService.list(dto);
|
||||
if (ObjectUtil.isEmpty(mchList)) {
|
||||
log.info("|{}|同步到正元全部商户部门信息错误mchList为空", TAG);
|
||||
List<SysDept> deptList = remoteDeptService.getAllDept(null).getData();
|
||||
if (ObjectUtil.isNotEmpty(deptId)) {
|
||||
deptList = deptList.stream().filter(v -> ObjectUtil.equals(v.getDeptId(), deptId)).toList();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(deptList)) {
|
||||
log.info("|{}|同步到正元全部商户部门信息错误deptList为空", TAG);
|
||||
return;
|
||||
}
|
||||
List<ZyMerSyncEnterpriseInfoDto> syncList = new ArrayList<>();
|
||||
String syncAllMchVersion = getSyncAllMchVersion();
|
||||
for (MchManageVo v : mchList) {
|
||||
for (SysDept v : deptList) {
|
||||
ZyMerSyncEnterpriseInfoDto entity = new ZyMerSyncEnterpriseInfoDto();
|
||||
entity.setEPID(v.getDeptId().toString());
|
||||
entity.setEPName(v.getDeptName());
|
||||
entity.setEPName(v.getName());
|
||||
entity.setIsValid(getIsValid(v.getDelFlag(), isDel));
|
||||
entity.setFixId(syncAllMchVersion);
|
||||
syncList.add(entity);
|
||||
Reference in new issue
Block a user