Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
2419c32cbf
80 files changed
+1927
-274
No files matched your search
+6
@@ -133,4 +133,10 @@ public interface CacheConstants {
|
||||
String WALLET_SETTING_DETAIL = "wallet:detail:setting";
|
||||
|
||||
/* ************************************* end 钱包相关 end ************************************* */
|
||||
|
||||
/* ************************************* start 第三方对接相关 start ************************************* */
|
||||
|
||||
String THIRDPARTY_ZY_MER_TOKEN = "thirdparty:zy:mer_token";
|
||||
|
||||
/* ************************************* end 第三方对接相关 end ************************************* */
|
||||
}
|
||||
+8
@@ -30,6 +30,14 @@ public enum HardOrderStatusEnum {
|
||||
);
|
||||
}
|
||||
|
||||
public static List<String> getPayPrice() {
|
||||
return List.of(
|
||||
HardOrderStatusEnum.PAY.type,
|
||||
HardOrderStatusEnum.CANCEL.type,
|
||||
HardOrderStatusEnum.REFUND.type
|
||||
);
|
||||
}
|
||||
|
||||
public static List<String> getPayErrorCodes() {
|
||||
return List.of(
|
||||
HardOrderStatusEnum.REFUND.type
|
||||
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardDeptTotalDto {
|
||||
public class HardDeptTotalDto implements BaseIsIncludeTreeInterface {
|
||||
|
||||
@Schema(description = "饭卡类型id")
|
||||
private Long walletTypeId;
|
||||
@@ -18,10 +19,13 @@ public class HardDeptTotalDto {
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "是否深度搜索deptId")
|
||||
@Schema(description = "是否深度搜索deptIds")
|
||||
private Boolean isDeepDept;
|
||||
|
||||
@Schema(description = "部门ids")
|
||||
private List<Long> deptIds;
|
||||
|
||||
@Schema(description = "是否包含deptIds")
|
||||
private Boolean isInclude = false;
|
||||
|
||||
}
|
||||
+3
-7
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,16 +9,11 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardOrderDto extends HardOrderEntity {
|
||||
|
||||
/**
|
||||
* 订单部门id极其子部门id
|
||||
*/
|
||||
private Long deptIdIdDeepen;
|
||||
public class HardOrderDto extends HardOrderEntity implements BaseIsIncludeTreeInterface {
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Boolean isDeepDept = false;
|
||||
private Boolean isInclude = false;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ public class HardOrderTotalController {
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 批量充值
|
||||
|
||||
+10
-26
@@ -24,12 +24,14 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
|
||||
default Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
|
||||
private LambdaQueryWrapper<HardOrderEntity> commonWrapper(HardOrderDto dto) {
|
||||
LambdaQueryWrapper<HardOrderEntity> wrapper = new LambdaQueryWrapper<HardOrderEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getOrderType()), HardOrderEntity::getOrderType, dto.getOrderType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getPayType()), HardOrderEntity::getPayType, dto.getPayType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getOrderStatus()), HardOrderEntity::getOrderStatus, dto.getOrderStatus())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHourType()), HardOrderEntity::getHourType, dto.getHourType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), HardOrderEntity::getDeptId, dto.getDeptId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), HardOrderEntity::getUserId, dto.getUserId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getOrderIds()), HardOrderEntity::getId, dto.getOrderIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardOrderEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getHardIds()), HardOrderEntity::getHardId, dto.getHardIds())
|
||||
@@ -48,7 +50,11 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(HardOrderEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, DataScope.of());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
default Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
|
||||
Page list = selectPageByScope(page, commonWrapper(dto), DataScope.of());
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), HardOrderVo.class));
|
||||
return list;
|
||||
}
|
||||
@@ -60,6 +66,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
.selectAs(HardManagerEntity::getType, HardOrderVo::getHardType)
|
||||
.leftJoin(HardManagerEntity.class, HardManagerEntity::getId, HardOrderEntity::getHardId)
|
||||
.eqIfExists(HardOrderEntity::getUserId, dto.getUserId())
|
||||
.eqIfExists(HardOrderEntity::getDeptId, dto.getDeptId())
|
||||
.eqIfExists(HardOrderEntity::getOrderType, dto.getOrderType())
|
||||
.eqIfExists(HardOrderEntity::getPayType, dto.getPayType())
|
||||
.eqIfExists(HardOrderEntity::getOrderStatus, dto.getOrderStatus())
|
||||
@@ -79,30 +86,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
|
||||
}
|
||||
|
||||
default List<HardOrderEntity> list(HardOrderDto dto) {
|
||||
LambdaQueryWrapper<HardOrderEntity> wrapper = new LambdaQueryWrapper<HardOrderEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getOrderType()), HardOrderEntity::getOrderType, dto.getOrderType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getPayType()), HardOrderEntity::getPayType, dto.getPayType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getOrderStatus()), HardOrderEntity::getOrderStatus, dto.getOrderStatus())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getHourType()), HardOrderEntity::getHourType, dto.getHourType())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getOrderIds()), HardOrderEntity::getId, dto.getOrderIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), HardOrderEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getHardIds()), HardOrderEntity::getHardId, dto.getHardIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getMchIds()), HardOrderEntity::getMerchantId, dto.getMchIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserDeptIds()), HardOrderEntity::getDeptId, dto.getUserDeptIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
HardOrderEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()),
|
||||
HardOrderEntity::getPayTime,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getPayTimeList()) ? dto.getPayTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(HardOrderEntity::getCreateTime);
|
||||
return selectListByScope(wrapper, DataScope.of());
|
||||
return selectListByScope(commonWrapper(dto), DataScope.of());
|
||||
}
|
||||
|
||||
Page<HardOrderSbVo> pageListSb(Page page, @Param("dto") HardOrderDto dto);
|
||||
|
||||
-8
@@ -116,14 +116,6 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
|
||||
@Override
|
||||
public Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIdIdDeepen())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptIdIdDeepen()).getData();
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).toList());
|
||||
} else {
|
||||
dto.setUserDeptIds(List.of(-1L));
|
||||
}
|
||||
}
|
||||
Page<HardOrderVo> list = baseMapper.scopePageList(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
|
||||
+2
-48
@@ -52,16 +52,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
|
||||
@Override
|
||||
public Page<HardOrderSbVo> pageListSb(Page page, HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
Page<HardOrderSbVo> list = hardOrderMapper.pageListSb(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 商户
|
||||
@@ -88,16 +78,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
|
||||
@Override
|
||||
public List<HardOrderSbVo> listSb(HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
List<HardOrderSbVo> list = hardOrderMapper.listSb(dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 商户
|
||||
@@ -124,16 +104,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
|
||||
@Override
|
||||
public Page<HardOrderCsVo> pageListCs(Page page, HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
Page<HardOrderCsVo> list = hardOrderMapper.pageListCs(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 商户
|
||||
@@ -150,16 +120,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
|
||||
@Override
|
||||
public List<HardOrderCsVo> listCs(HardOrderDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
List<HardOrderCsVo> list = hardOrderMapper.listCs(dto);
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 商户
|
||||
@@ -177,15 +137,9 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
@Override
|
||||
public List<HardDeptTotalVo> pageListDept(HardDeptTotalDto dto) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = remoteDeptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
CompletableFuture<List<SysDept>> deptFuture = CompletableFuture.supplyAsync(() -> {
|
||||
DeptAllListDto deptDto = new DeptAllListDto();
|
||||
deptDto.setIsInclude(dto.getIsInclude());
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
deptDto.setDeptId(dto.getDeptId());
|
||||
}
|
||||
@@ -264,7 +218,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> payFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto payDto = new HardOrderSumAndCountDto();
|
||||
payDto.setDeptIds(deptIds);
|
||||
payDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
payDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
payDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
|
||||
+11
-1
@@ -81,7 +81,17 @@
|
||||
and a.dept_id = #{dto.deptId}
|
||||
</if>
|
||||
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
|
||||
and a.dept_id in
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and a.dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and a.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
|
||||
+1
-1
@@ -42,5 +42,5 @@
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencies>
|
||||
</project>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.foreign;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取区域编码
|
||||
*/
|
||||
@Data
|
||||
public class ZyForeignGetRegionIdByTokenDto {
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.foreign;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 本地一卡通交易数据同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyForeignSyncNativeCardTradeInfoDto {
|
||||
|
||||
/**
|
||||
* 区域编码,取【获取区域编码】接口返回值参regionCode
|
||||
*/
|
||||
private String regionCode;
|
||||
|
||||
/**
|
||||
* 就餐总人数,从推广公务餐之日起,即总人数
|
||||
*/
|
||||
private Long totalNum;
|
||||
|
||||
/**
|
||||
* 就餐总金额,从推广公务餐之日起,即总金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 当年就餐总人数,从当年1月1日开始
|
||||
*/
|
||||
private Long totalNumYear;
|
||||
|
||||
/**
|
||||
* 当年就餐总金额,从当年1月1日开始
|
||||
*/
|
||||
private BigDecimal totalMoneyYear;
|
||||
|
||||
/**
|
||||
* 当月就餐总人数,从当月1日开始
|
||||
*/
|
||||
private Long totalNumMonth;
|
||||
|
||||
/**
|
||||
* 当月就餐总金额,从当月1日开始
|
||||
*/
|
||||
private BigDecimal totalMoneyMonth;
|
||||
|
||||
/**
|
||||
* 当日就餐总人数
|
||||
*/
|
||||
private Long totalNumDay;
|
||||
|
||||
/**
|
||||
* 当日就餐总金额
|
||||
*/
|
||||
private BigDecimal totalMoneyDay;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.mer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerGetTokenDto {
|
||||
|
||||
private String appid;
|
||||
|
||||
private String appsecret;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.mer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 身份信息同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncAccClassInfoDto {
|
||||
|
||||
/**
|
||||
* 身份编号
|
||||
*/
|
||||
private String AccClassID;
|
||||
|
||||
/**
|
||||
* 身份名称
|
||||
*/
|
||||
private String AccClassName;
|
||||
|
||||
/**
|
||||
* 所属记账单位编号
|
||||
*/
|
||||
private String EPID;
|
||||
|
||||
/**
|
||||
* 每次推送版本号,格式化为14位字符串,如果是数字不足14位的,前面补0。
|
||||
*/
|
||||
private String FixId;
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.mer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 账户信息同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncAccountInfoDto {
|
||||
|
||||
/**
|
||||
* 账户姓名
|
||||
*/
|
||||
private String AccName;
|
||||
|
||||
/**
|
||||
* 账号,人员的唯一属性
|
||||
*/
|
||||
private String AccNum;
|
||||
|
||||
/**
|
||||
* 卡账号,卡片的唯一属性
|
||||
*/
|
||||
private Long CardAccNum;
|
||||
|
||||
/**
|
||||
* 物理卡号,行业标准
|
||||
*/
|
||||
private String CardSID;
|
||||
|
||||
/**
|
||||
* 卡片状态,0销卡;1有效;2挂失;3冻结;4预销卡;5锁卡,默认1
|
||||
*/
|
||||
private String CardStatus;
|
||||
|
||||
/**
|
||||
* 该卡在所属接入系统中的所属单位编号
|
||||
*/
|
||||
private String EPID;
|
||||
|
||||
/**
|
||||
* 人员编号
|
||||
*/
|
||||
private String PerCode;
|
||||
|
||||
/**
|
||||
* 身份编号,必须是【身份信息】中的值
|
||||
*/
|
||||
private String AccClassID;
|
||||
|
||||
/**
|
||||
* 手机号码,建议同步,否则将无法使用移动端应用
|
||||
*/
|
||||
private String PhoneNo;
|
||||
|
||||
/**
|
||||
* 版本号,规则同记账单位同步
|
||||
*/
|
||||
private String FixId;
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.mer;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 商户信息同步
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ZyMerSyncDealerInfoDto {
|
||||
/**
|
||||
* 商户所在系统的键值
|
||||
*/
|
||||
private String DealerKeyObj;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
private String DealerName;
|
||||
|
||||
/**
|
||||
* 商户是否有效0:禁用 1:有效
|
||||
*/
|
||||
private Integer IsValid;
|
||||
|
||||
/**
|
||||
* 所属记账单位编号
|
||||
*/
|
||||
private String EPID;
|
||||
|
||||
/**
|
||||
* 每次推送版本号,格式化为14位字符串,如果是数字不足14位的,前面补0。
|
||||
*/
|
||||
private String FixId;
|
||||
|
||||
/**
|
||||
* 商户类型,0食堂餐厅,1超市,2普通商家,3其他;不传默认是食堂餐厅类型
|
||||
*/
|
||||
private String DealerType;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.mer;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 记账单位同步
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ZyMerSyncEnterpriseInfoDto {
|
||||
|
||||
/**
|
||||
* 记账单位在自己系统中的编号,必须使用数字,禁止字母、汉字、特殊字符等其他字符串
|
||||
*/
|
||||
private String EPID;
|
||||
|
||||
/**
|
||||
* 记账单位名称,即不同接入单位的名称,本地一卡通可根据实际情况自行判断属性范围
|
||||
*/
|
||||
private String EPName;
|
||||
|
||||
/**
|
||||
* 记账单位是否有效0:禁用 1:有效
|
||||
*/
|
||||
private String IsValid;
|
||||
|
||||
/**
|
||||
* 每次推送版本号,格式化为14位字符串,如果是数字不足14位的,前面补0。
|
||||
*/
|
||||
private String FixId;
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.self;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方url健康探测
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfCheckSystemStatusDto {
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.self;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方一卡通系统提供冲正接口
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfCorrectDto {
|
||||
|
||||
/**
|
||||
* 智慧园区通刷服务平台冲正所产生的平台记录流水号
|
||||
*/
|
||||
private String serialNum;
|
||||
|
||||
/**
|
||||
* 待冲正流水号,该流水号是调用第三方扣费接口返回的流水号,即第三方的订单号
|
||||
*/
|
||||
private String correctSerialNum;
|
||||
|
||||
/**
|
||||
* 冲正金额,不传表示全额冲正,且仅支持全额冲正退款
|
||||
*/
|
||||
private String amount;
|
||||
|
||||
/**
|
||||
* 访问对接系统中配置的opId值,即该退款账户所在的记账单位编号
|
||||
*/
|
||||
private String opId;
|
||||
|
||||
/**
|
||||
* 签名值,明文不加密
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.self;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方提供获取token
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfGetTokenDto {
|
||||
|
||||
/**
|
||||
* 第三方app用户id
|
||||
*/
|
||||
private String appid;
|
||||
|
||||
/**
|
||||
* 第三方app用户密钥
|
||||
*/
|
||||
private String appsecret;
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.self;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方一卡通系统提供扣费接口
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfPayDto {
|
||||
|
||||
/**
|
||||
* 一卡通帐号,可以通过【获取账户信息接口】获得
|
||||
*/
|
||||
private String accNum;
|
||||
|
||||
/**
|
||||
* 卡账号,用户多卡情况下选择对应卡账号来扣费,不填的是默认用户主卡扣费。
|
||||
*/
|
||||
private String cardAccNum;
|
||||
|
||||
/**
|
||||
* 消费金额,格式是XX.XX元
|
||||
*/
|
||||
private String amount;
|
||||
|
||||
/**
|
||||
* 智慧园区通刷服务平台扣费流水号
|
||||
*/
|
||||
private String serialNum;
|
||||
|
||||
/**
|
||||
* 交易时间,格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String dealTime;
|
||||
|
||||
/**
|
||||
* 在访问对接配置里面配置的opId值,第三方一卡通系统根据需要获取
|
||||
*/
|
||||
private String opId;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String sign;
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.stride;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 统一身份验证功能
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideAuthenticationDto {
|
||||
|
||||
/**
|
||||
* 物理卡号,当Type不传(默认为0)时,该值必填;当Type为1时,该值可为空
|
||||
*/
|
||||
private String CardSID;
|
||||
|
||||
/**
|
||||
* 商户号(商户所在单位主键)
|
||||
*/
|
||||
private String DealerKeyObj;
|
||||
|
||||
/**
|
||||
* 消费机设备序列号(唯一),用于终端查流水使用
|
||||
*/
|
||||
private String TerminalNum;
|
||||
|
||||
/**
|
||||
* 商户所在系统的单位编号
|
||||
*/
|
||||
private String EPID;
|
||||
|
||||
/**
|
||||
* 消费认证方式(0-刷卡;1-扫码),默认为0
|
||||
*/
|
||||
private String Type;
|
||||
|
||||
/**
|
||||
* 设备读取到的完整的二维码字符串,当Type为1时,该值必填
|
||||
*/
|
||||
private String Qrcode;
|
||||
|
||||
/**
|
||||
* 签名,明文传输
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.stride;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 智慧园区通刷平台提供消费接口
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideConsumptionDto {
|
||||
|
||||
/**
|
||||
* 商户在所在系统的编号(主键值)
|
||||
*/
|
||||
private String DealerKeyObj;
|
||||
|
||||
/**
|
||||
* 消费金额(元)
|
||||
*/
|
||||
private String money;
|
||||
|
||||
/**
|
||||
* 订单号(统一身份验证通过后返回的订单号)
|
||||
*/
|
||||
private String recNum;
|
||||
|
||||
/**
|
||||
* POS机发起交易的时间,yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String dealTime;
|
||||
|
||||
/**
|
||||
* 签名值,明文不加密
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.zy.stride;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 智慧园区通刷平台提供冲正接口
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideCorrectDto {
|
||||
|
||||
/**
|
||||
* 消费金额(元),末笔全额冲正,现在只支持全额冲正,传过来也无效
|
||||
*/
|
||||
private String money;
|
||||
|
||||
/**
|
||||
* POS机收到的末笔订单号(统一身份验证通过后智慧园区通刷服务平台返回的订单号)
|
||||
*/
|
||||
private String recNum;
|
||||
|
||||
/**
|
||||
* POS机发起冲正的时间,yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String dealTime;
|
||||
|
||||
/**
|
||||
* 签名值,明文不加密
|
||||
*/
|
||||
private String sign;
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ZyBaseVo {
|
||||
|
||||
public static String successCode = "0";
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String msg;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return ObjectUtil.equal(code, ZyBaseVo.successCode);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.foreign;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取区域编码
|
||||
*/
|
||||
@Data
|
||||
public class ZyForeignGetRegionIdByTokenVo extends ZyBaseVo {
|
||||
|
||||
private VoData data;
|
||||
|
||||
@Data
|
||||
static class VoData {
|
||||
/**
|
||||
* 区域编码
|
||||
*/
|
||||
private String regionCode;
|
||||
/**
|
||||
* 地市全名称
|
||||
*/
|
||||
private String regionAllName;
|
||||
/**
|
||||
* 地市简称
|
||||
*/
|
||||
private String regionName;
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.foreign;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 本地一卡通交易数据同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyForeignSyncNativeCardTradeInfoVo extends ZyBaseVo {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.mer;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerGetTokenVo extends ZyBaseVo {
|
||||
|
||||
private String access_token;
|
||||
|
||||
private String expires_in;
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.mer;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 身份信息同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncAccClassInfoVo extends ZyBaseVo {
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.mer;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 账户信息同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncAccountInfoVo extends ZyBaseVo {
|
||||
|
||||
@Data
|
||||
static class DataVo{
|
||||
/**
|
||||
* 当前智慧园区通刷服务平台保存的最新同步版本号,返回该版本号,要求第三方一卡通系统同步这个大于这个版本号的数据
|
||||
*/
|
||||
private String currentFixId;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.mer;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 商户信息同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncDealerInfoVo extends ZyBaseVo {
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.mer;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 记账单位同步
|
||||
*/
|
||||
@Data
|
||||
public class ZyMerSyncEnterpriseInfoVo extends ZyBaseVo {
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.self;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.xml.stream.events.StartDocument;
|
||||
|
||||
/**
|
||||
* 第三方url健康探测
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfCheckSystemStatusVo extends ZyBaseVo {
|
||||
|
||||
/**
|
||||
* 当前系统时间 格式yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String systemTime;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.self;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方一卡通系统提供冲正接口
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfCorrectVo extends ZyBaseVo {
|
||||
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.self;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方提供获取token
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfGetTokenVo extends ZyBaseVo {
|
||||
|
||||
private String access_token;
|
||||
|
||||
private String expires_in;
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.self;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方一卡通系统提供扣费接口
|
||||
*/
|
||||
@Data
|
||||
public class ZySelfPayVo extends ZyBaseVo {
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.stride;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 统一身份验证功能
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideAuthenticationVo extends ZyBaseVo {
|
||||
|
||||
/**
|
||||
* 物理卡号
|
||||
*/
|
||||
private String CardSID;
|
||||
|
||||
/**
|
||||
* 如果返回成功,则返回订单号
|
||||
*/
|
||||
private String recNum;
|
||||
|
||||
/**
|
||||
* 卡户所属单位名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String AccName;
|
||||
|
||||
/**
|
||||
* 个人编号
|
||||
*/
|
||||
private String PerCode;
|
||||
|
||||
/**
|
||||
* 是否是本地一卡通人员,true-是,false-不是
|
||||
*/
|
||||
private String IsOwner;
|
||||
|
||||
/**
|
||||
* 个人账号
|
||||
*/
|
||||
private String AccNum;
|
||||
|
||||
/**
|
||||
* 易通为记账单位编号,4.0为园区号
|
||||
*/
|
||||
private String ChargeId;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.stride;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 智慧园区通刷平台提供消费接口
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideConsumptionVo extends ZyBaseVo {
|
||||
|
||||
/**
|
||||
* 商户在所在系统的编号(主键值)
|
||||
*/
|
||||
private String DealerKeyObj;
|
||||
|
||||
/**
|
||||
* 消费金额(元)
|
||||
*/
|
||||
private String money;
|
||||
|
||||
/**
|
||||
* 订单号(统一身份验证通过后返回的订单号)
|
||||
*/
|
||||
private String recNum;
|
||||
|
||||
/**
|
||||
* POS机发起交易的时间,yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String dealTime;
|
||||
|
||||
/**
|
||||
* 签名值,明文不加密
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.zy.stride;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 智慧园区通刷平台提供冲正接口
|
||||
*/
|
||||
@Data
|
||||
public class ZyStrideCorrectVo extends ZyBaseVo {
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String recNum;
|
||||
|
||||
/**
|
||||
* 入流水时间(服务器)
|
||||
*/
|
||||
private String dealTime;
|
||||
|
||||
/**
|
||||
* 冲正金额
|
||||
*/
|
||||
private String money;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String accName;
|
||||
|
||||
/**
|
||||
* 个人编号
|
||||
*/
|
||||
private String perCode;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String sign;
|
||||
}
|
||||
+8
-7
@@ -76,13 +76,13 @@
|
||||
<!--选配: mybatis 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
</dependency>
|
||||
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: druid 连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
</dependency>
|
||||
<artifactId>druid-spring-boot-3-starter</artifactId>
|
||||
</dependency>
|
||||
<!--选配: mysql 数据库驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
@@ -97,8 +97,9 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- 引入分布式事务-->
|
||||
<!--引入分布式事务-->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-seata</artifactId>
|
||||
@@ -115,7 +116,7 @@
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
@@ -125,7 +126,7 @@
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.thirdparty.config;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "zy")
|
||||
@Data
|
||||
public class ZyConfig {
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
private String appId;
|
||||
|
||||
private String appSecret;
|
||||
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl;
|
||||
|
||||
public interface ZyForeignService {
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccClassInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccountInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncDealerInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncEnterpriseInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.mer.*;
|
||||
|
||||
public interface ZyMerService {
|
||||
|
||||
/**
|
||||
* 商户信息同步
|
||||
*/
|
||||
ZyMerSyncDealerInfoVo syncDealerInfoApi(ZyMerSyncDealerInfoDto dto);
|
||||
|
||||
/**
|
||||
* 记账单位同步
|
||||
*/
|
||||
ZyMerSyncEnterpriseInfoVo syncEnterpriseInfoApi(ZyMerSyncEnterpriseInfoDto dto);
|
||||
|
||||
/**
|
||||
* 账户信息同步
|
||||
*/
|
||||
ZyMerSyncAccountInfoVo syncAccountInfoApi(ZyMerSyncAccountInfoDto dto);
|
||||
|
||||
/**
|
||||
* 身份信息同步
|
||||
*/
|
||||
ZyMerSyncAccClassInfoVo syncAccClassInfo(ZyMerSyncAccClassInfoDto dto);
|
||||
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl;
|
||||
|
||||
public interface ZySelfService {
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl;
|
||||
|
||||
public interface ZyStrideService {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.zy;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.ZyForeignService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ZyForeignServiceImpl implements ZyForeignService {
|
||||
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.zy;
|
||||
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.common.core.constant.CacheConstants;
|
||||
import com.bsd.pjcloud.thirdparty.config.ZyConfig;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccClassInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccountInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncDealerInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncEnterpriseInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.ZyMerService;
|
||||
import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApi;
|
||||
import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApiTool;
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.mer.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.commons.codec.digest.DigestUtils.md5Hex;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ZyMerServiceImpl implements ZyMerService {
|
||||
|
||||
private final String TAG = "ZyMerServiceImpl";
|
||||
|
||||
private final ZyConfig zyConfig;
|
||||
|
||||
private final ZyApiTool zyApiTool;
|
||||
|
||||
/**
|
||||
* 商户信息同步
|
||||
*/
|
||||
@Override
|
||||
public ZyMerSyncDealerInfoVo syncDealerInfoApi(ZyMerSyncDealerInfoDto dto) {
|
||||
String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_DEALER_INFO;
|
||||
try {
|
||||
url = String.format(url, zyApiTool.getToken());
|
||||
Map<String, Object> encryptionBody = new HashMap<>();
|
||||
encryptionBody.put("dealers", dto);
|
||||
String body = zyApiTool.getEncryptionDto(encryptionBody);
|
||||
String res = HttpRequest.post(url)
|
||||
.body(body)
|
||||
.execute()
|
||||
.body();
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
throw new RuntimeException("response is empty");
|
||||
}
|
||||
ZyMerSyncDealerInfoVo vo = JSONUtil.toBean(res, ZyMerSyncDealerInfoVo.class);
|
||||
if (!vo.isSuccess()) {
|
||||
throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body));
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}||syncDealerInfo|意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 记账单位同步
|
||||
*/
|
||||
@Override
|
||||
public ZyMerSyncEnterpriseInfoVo syncEnterpriseInfoApi(ZyMerSyncEnterpriseInfoDto dto) {
|
||||
String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ENTERPRISE_INFO;
|
||||
try {
|
||||
url = String.format(url, zyApiTool.getToken());
|
||||
Map<String, Object> encryptionBody = new HashMap<>();
|
||||
encryptionBody.put("enterprises", dto);
|
||||
String body = zyApiTool.getEncryptionDto(encryptionBody);
|
||||
String res = HttpRequest.post(url)
|
||||
.body(body)
|
||||
.execute()
|
||||
.body();
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
throw new RuntimeException("response is empty");
|
||||
}
|
||||
ZyMerSyncEnterpriseInfoVo vo = JSONUtil.toBean(res, ZyMerSyncEnterpriseInfoVo.class);
|
||||
if (!vo.isSuccess()) {
|
||||
throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body));
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}||syncEnterpriseInfo|意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 账户信息同步
|
||||
*/
|
||||
@Override
|
||||
public ZyMerSyncAccountInfoVo syncAccountInfoApi(ZyMerSyncAccountInfoDto dto) {
|
||||
String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ACCOUNT_INFO;
|
||||
try {
|
||||
url = String.format(url, zyApiTool.getToken());
|
||||
Map<String, Object> encryptionBody = new HashMap<>();
|
||||
encryptionBody.put("accounts", dto);
|
||||
String body = zyApiTool.getEncryptionDto(encryptionBody);
|
||||
String res = HttpRequest.post(url)
|
||||
.body(body)
|
||||
.execute()
|
||||
.body();
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
throw new RuntimeException("response is empty");
|
||||
}
|
||||
ZyMerSyncAccountInfoVo vo = JSONUtil.toBean(res, ZyMerSyncAccountInfoVo.class);
|
||||
if (!vo.isSuccess()) {
|
||||
throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body));
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}||syncAccountInfo|意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 身份信息同步
|
||||
*/
|
||||
@Override
|
||||
public ZyMerSyncAccClassInfoVo syncAccClassInfo(ZyMerSyncAccClassInfoDto dto) {
|
||||
String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ACC_CLASS_INFO;
|
||||
try {
|
||||
url = String.format(url, zyApiTool.getToken());
|
||||
Map<String, Object> encryptionBody = new HashMap<>();
|
||||
encryptionBody.put("accClasses", dto);
|
||||
String body = zyApiTool.getEncryptionDto(encryptionBody);
|
||||
String res = HttpRequest.post(url)
|
||||
.body(body)
|
||||
.execute()
|
||||
.body();
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
throw new RuntimeException("response is empty");
|
||||
}
|
||||
ZyMerSyncAccClassInfoVo vo = JSONUtil.toBean(res, ZyMerSyncAccClassInfoVo.class);
|
||||
if (!vo.isSuccess()) {
|
||||
throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body));
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}||syncAccClassInfo|意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.zy;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.ZySelfService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ZySelfServiceImpl implements ZySelfService {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.service.impl.zy;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.ZyStrideService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ZyStrideServiceImpl implements ZyStrideService {
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.bsd.pjcloud.thirdparty.utils.zy.api;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
@UtilityClass
|
||||
public class ZyApi {
|
||||
|
||||
|
||||
|
||||
// 商户信息同步
|
||||
public static class Mer {
|
||||
// 获取token
|
||||
public static final String GET_TOKEN = "/api/getToken?appId=%s&appSecret=%s";
|
||||
// 商户信息同步
|
||||
public static final String SYNC_DEALER_INFO = "/api/syncDealerInfo?access_token=%s";
|
||||
// 记账单位同步
|
||||
public static final String SYNC_ENTERPRISE_INFO = "/api/syncEnterpriseInfo?access_token=%s";
|
||||
// 账户信息同步
|
||||
public static final String SYNC_ACCOUNT_INFO = "/api/syncAccountInfo?access_token=%s";
|
||||
// 身份信息同步
|
||||
public static final String SYNC_ACC_CLASS_INFO = "/api/syncAccClassInfo?access_token=%s";
|
||||
}
|
||||
|
||||
// 统一身份验证功能
|
||||
public class Stride {
|
||||
// 统一身份验证功能
|
||||
public static final String AUTHENTICATION = "/authentication?access_token={access_token}";
|
||||
// 智慧园区通刷平台提供消费接口
|
||||
public static final String CONSUMPTION = "/consumption?access_token={access_token}";
|
||||
// 智慧园区通刷平台提供冲正接口
|
||||
public static final String CORRECT = "/correct?access_token={access_token}";
|
||||
}
|
||||
|
||||
// 本地一卡通交易数据同步
|
||||
public static class Foreign {
|
||||
// 本地一卡通交易数据同步
|
||||
public static final String SYNC_NATIVE_CARD_TRADE_INFO = "/getToken/syncNativeCardTradeInfo?access_token={access_token}";
|
||||
// 获取区域编码
|
||||
public static final String GET_REGION_ID_BY_TOKEN = "/getRegionIdByToken?access_token={access_token}";
|
||||
}
|
||||
|
||||
// 第三方需提供的接口
|
||||
public static class Self {
|
||||
// 第三方url健康探测
|
||||
public static final String CHECK_SYSTEM_STATUS = "/checkSystemStatus";
|
||||
// 第三方一卡通系统提供冲正接口
|
||||
public static final String CORRECT = "/correct?access_token={access_token}";
|
||||
// 第三方一卡通系统提供扣费接口
|
||||
public static final String PAY = "/pay?access_token={access_token}";
|
||||
// 第三方提供获取token
|
||||
public static final String GET_TOKEN = "/getToken?appId={appid}&appSecret={appsecret}_1730169197889";
|
||||
}
|
||||
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.bsd.pjcloud.thirdparty.utils.zy.api;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.common.core.constant.CacheConstants;
|
||||
import com.bsd.pjcloud.thirdparty.config.ZyConfig;
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.mer.ZyMerGetTokenVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.commons.codec.digest.DigestUtils.md5Hex;
|
||||
|
||||
@Component
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class ZyApiTool {
|
||||
|
||||
private final String TAG = "正元请求工具类";
|
||||
|
||||
private final ZyConfig zyConfig;
|
||||
|
||||
private final StringRedisTemplate redisTemplate;
|
||||
|
||||
public ZyMerGetTokenVo getTokenApi() {
|
||||
String url = zyConfig.getBaseUrl() + ZyApi.Mer.GET_TOKEN;
|
||||
url = String.format(url, zyConfig.getAppId(), zyConfig.getAppSecret());
|
||||
try {
|
||||
String res = HttpRequest.get(url)
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.execute()
|
||||
.body();
|
||||
if (ObjectUtil.isEmpty(res)) {
|
||||
throw new RuntimeException("response is empty");
|
||||
}
|
||||
ZyMerGetTokenVo vo = JSONUtil.toBean(res, ZyMerGetTokenVo.class);
|
||||
if (!vo.isSuccess()) {
|
||||
throw new RuntimeException(String.format("请求错误res|%s|url|%s|", res, url));
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}||getTokenApi|意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
try {
|
||||
String redisKey = CacheConstants.THIRDPARTY_ZY_MER_TOKEN;
|
||||
String token = redisTemplate.opsForValue().get(redisKey);
|
||||
if (ObjectUtil.isEmpty(token)) {
|
||||
ZyMerGetTokenVo vo = getTokenApi();
|
||||
if (ObjectUtil.isNotEmpty(vo)) {
|
||||
String accessToken = vo.getAccess_token();
|
||||
redisTemplate.opsForValue().set(redisKey, accessToken);
|
||||
return accessToken;
|
||||
}
|
||||
}
|
||||
return token;
|
||||
} catch (Exception e) {
|
||||
log.error("|{}|token获取错误无法进行,意外的错误error|{}|", TAG, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public <T> String getEncryptionDto(T params) {
|
||||
String json = JSONUtil.toJsonStr(params);
|
||||
String encodedData = Base64.getEncoder().encodeToString(json.getBytes(StandardCharsets.UTF_8));
|
||||
String stringToSign = String.format("data=%s&key=%s", json, zyConfig.getAppId());
|
||||
String sign = md5Hex(stringToSign);
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("data", encodedData);
|
||||
body.put("sign", sign);
|
||||
return JSONUtil.toJsonStr(body);
|
||||
}
|
||||
|
||||
}
|
||||
+7
-8
@@ -40,11 +40,10 @@ oauth2:
|
||||
shjn_token_url: /prod-api/login/shpj
|
||||
# 浙证钉和诗画公用的获取用户信息接口
|
||||
zzd_sh_user_info_url: /prod-api/oauth2/apis/sso/v1/fetch_user_by_uabase_token
|
||||
# datasource:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# druid:
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# username: root
|
||||
# password: root
|
||||
# # url: jdbc:mysql://pjcloud-mysql:3306/pjcloudx_thirdparty?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
# url: jdbc:mysql://${MYSQL_HOST:pjcloud-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pjcloudx_thirdparty}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
|
||||
# 正元智慧
|
||||
# https://gwyc.zj.gov.cn/API/%E7%9C%81%E5%B9%B3%E5%8F%B0API%E5%AF%B9%E6%8E%A5%E6%8E%A5%E5%8F%A3.html
|
||||
zy:
|
||||
base-url: http://60.191.37.212:18079
|
||||
app-id: 03D9608D1735D424F984733BA71321C6
|
||||
app-secret: 65497A86DB1401B252FEA6DE0A080766
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
package com.bsd.pjcloud.admin;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.thirdparty.ThirdPartyApp;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccClassInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccountInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncDealerInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncEnterpriseInfoDto;
|
||||
import com.bsd.pjcloud.thirdparty.service.impl.ZyMerService;
|
||||
import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApiTool;
|
||||
import com.bsd.pjcloud.thirdparty.vo.zy.mer.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@SpringBootTest(classes = ThirdPartyApp.class)
|
||||
public class ZyTest {
|
||||
|
||||
@Resource
|
||||
private ZyMerService zyMerService;
|
||||
|
||||
@Resource
|
||||
private ZyApiTool zyApiTool;
|
||||
|
||||
/************************** start mer start **************************/
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*/
|
||||
@Test
|
||||
public void merGetTokenApi() {
|
||||
ZyMerGetTokenVo vo = zyApiTool.getTokenApi();
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户信息同步
|
||||
*/
|
||||
@Test
|
||||
public void merSyncDealerInfo() {
|
||||
ZyMerSyncDealerInfoDto dto = ZyMerSyncDealerInfoDto
|
||||
.builder()
|
||||
.DealerKeyObj("123")
|
||||
.DealerName("食堂")
|
||||
.IsValid(1)
|
||||
.EPID("1")
|
||||
.FixId("20190920100101")
|
||||
.build();
|
||||
ZyMerSyncDealerInfoVo vo = zyMerService.syncDealerInfoApi(dto);
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 记账单位同步
|
||||
*/
|
||||
@Test
|
||||
public void merSyncEnterpriseInfo(){
|
||||
ZyMerSyncEnterpriseInfoDto dto = new ZyMerSyncEnterpriseInfoDto();
|
||||
ZyMerSyncEnterpriseInfoVo vo = zyMerService.syncEnterpriseInfoApi(dto);
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 账户信息同步
|
||||
*/
|
||||
@Test
|
||||
public void merSyncAccountInfoApi(){
|
||||
ZyMerSyncAccountInfoDto dto = new ZyMerSyncAccountInfoDto();
|
||||
ZyMerSyncAccountInfoVo vo = zyMerService.syncAccountInfoApi(dto);
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 身份信息同步
|
||||
*/
|
||||
@Test
|
||||
public void merSyncAccClassInfo(){
|
||||
ZyMerSyncAccClassInfoDto dto = new ZyMerSyncAccClassInfoDto();
|
||||
ZyMerSyncAccClassInfoVo vo = zyMerService.syncAccClassInfo(dto);
|
||||
System.out.println(vo);
|
||||
}
|
||||
|
||||
/************************** end mer end **************************/
|
||||
|
||||
|
||||
/************************** start mer start **************************/
|
||||
|
||||
|
||||
|
||||
/************************** end mer end **************************/
|
||||
|
||||
|
||||
@Test
|
||||
public void encryption() {
|
||||
try {
|
||||
|
||||
// 1. 构建业务数据
|
||||
Map<String, Object> dealer = new HashMap<>();
|
||||
dealer.put("EPID", "1");
|
||||
dealer.put("DealerKeyObj", "123");
|
||||
dealer.put("IsValid", 1);
|
||||
dealer.put("DealerName", "食堂");
|
||||
dealer.put("FixId", "20190920100101");
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("dealers", new Object[]{dealer});
|
||||
|
||||
// 2. 生成 data 参数(Base64 编码)
|
||||
String jsonData = JSONUtil.toJsonStr(data);
|
||||
String base64Data = Base64.getEncoder().encodeToString(jsonData.getBytes("UTF-8"));
|
||||
|
||||
// 3. 生成签名
|
||||
String signStr = String.format("data=%s&key=%s", jsonData, "03D9608D1735D424F984733BA71321C6");
|
||||
String sign = md5(signStr).toUpperCase();
|
||||
|
||||
// 4. 构建请求参数
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("data", base64Data);
|
||||
params.put("sign", sign);
|
||||
System.out.println(params);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// MD5 加密方法
|
||||
private static String md5(String input) {
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] messageDigest = md.digest(input.getBytes());
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
|
||||
for (byte b : messageDigest) {
|
||||
String hex = Integer.toHexString(0xFF & b);
|
||||
if (hex.length() == 1) {
|
||||
hexString.append('0');
|
||||
}
|
||||
hexString.append(hex);
|
||||
}
|
||||
|
||||
return hexString.toString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -5,10 +5,12 @@ import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeptAllListDto {
|
||||
public class DeptAllListDto {
|
||||
|
||||
private Long deptId;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Boolean isInclude;
|
||||
|
||||
}
|
||||
+8
-5
@@ -20,6 +20,7 @@
|
||||
package com.bsd.pjcloud.admin.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -34,7 +35,7 @@ import java.util.List;
|
||||
@Data
|
||||
@Schema(description = "系统用户传输对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserDTO extends SysUser {
|
||||
public class UserDTO extends SysUser implements BaseIsIncludeTreeInterface {
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
@@ -72,11 +73,13 @@ public class UserDTO extends SysUser {
|
||||
private List<Long> userIds;
|
||||
|
||||
/**
|
||||
* false 当前部门
|
||||
* true 当前部门及子部门
|
||||
* 部门ids
|
||||
*/
|
||||
private Boolean isDeepDept = false;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 是否包含部门ids
|
||||
*/
|
||||
private Boolean isInclude;
|
||||
|
||||
}
|
||||
+1
-4
@@ -7,10 +7,7 @@ import com.bsd.pjcloud.admin.api.entity.SysMenu;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.vo.SysUserFaceVo;
|
||||
import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseFacesInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.*;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.admin.api.vo.base;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BaseIsDeepDeptTreeInterface {
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
List<Long> getDeptIds();
|
||||
|
||||
void setDeptIds(List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
Long getDeptId();
|
||||
|
||||
void setDeptId(Long deptId);
|
||||
|
||||
/**
|
||||
* 是否深度搜索deptIds
|
||||
* @return
|
||||
*/
|
||||
Boolean getIsDeepDept();
|
||||
|
||||
void setIsDeepDept(Boolean isDeepDept);
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.admin.api.vo.base;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BaseIsIncludeTreeInterface {
|
||||
|
||||
/**
|
||||
* 是否包含部门ids
|
||||
*/
|
||||
Boolean getIsInclude();
|
||||
|
||||
void setIsInclude(Boolean isInclude);
|
||||
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
List<Long> getDeptIds();
|
||||
|
||||
void setDeptIds(List<Long> deptIds);
|
||||
}
|
||||
-22
@@ -220,17 +220,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
*/
|
||||
@Override
|
||||
public IPage getUsersWithRolePage(Page page, UserDTO userDTO) {
|
||||
// 部门
|
||||
if (ObjectUtil.isNotEmpty(userDTO.getIsDeepDept()) && userDTO.getIsDeepDept() && ObjectUtil.isNotEmpty(userDTO.getDeptId())) {
|
||||
List<SysDept> deptList = sysDeptService.listDescendant(userDTO.getDeptId());
|
||||
userDTO.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
userDTO.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userDTO.getDeptIds())) {
|
||||
userDTO.setDeptId(null);
|
||||
}
|
||||
IPage<UserVO> list = baseMapper.getUserVosPage(page, userDTO, DataScope.of());
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
List<Long> userIds = list.getRecords().stream().map(UserVO::getUserId).distinct().toList();
|
||||
@@ -367,17 +356,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
*/
|
||||
@Override
|
||||
public List<UserExcelVO> listUser(UserDTO userDTO, Long[] ids) {
|
||||
// 部门
|
||||
if (ObjectUtil.isNotEmpty(userDTO.getIsDeepDept()) && userDTO.getIsDeepDept() && ObjectUtil.isNotEmpty(userDTO.getDeptId())) {
|
||||
List<SysDept> deptList = sysDeptService.listDescendant(userDTO.getDeptId());
|
||||
userDTO.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
userDTO.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(userDTO.getDeptIds())) {
|
||||
userDTO.setDeptId(null);
|
||||
}
|
||||
// 根据数据权限查询全部的用户信息
|
||||
List<UserVO> voList = baseMapper.selectVoListByScope(userDTO, ids, DataScope.of());
|
||||
// 转换成execl 对象输出
|
||||
|
||||
@@ -51,7 +51,17 @@
|
||||
AND a.dept_id = #{dto.deptId}
|
||||
</if>
|
||||
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
|
||||
and a.dept_id IN
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and a.dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and a.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
|
||||
@@ -182,7 +182,17 @@
|
||||
AND u.dept_id = #{query.deptId}
|
||||
</if>
|
||||
<if test="query.deptIds != null and query.deptIds.size() != 0">
|
||||
and u.dept_id IN
|
||||
<choose>
|
||||
<when test="query.isInclude != null and query.isInclude == true">
|
||||
and u.dept_id IN
|
||||
</when>
|
||||
<when test="query.isInclude != null and query.isInclude == false">
|
||||
and u.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and u.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="query.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
@@ -248,7 +258,17 @@
|
||||
AND u.dept_id = #{query.deptId}
|
||||
</if>
|
||||
<if test="query.deptIds != null and query.deptIds.size() != 0">
|
||||
AND u.dept_id in
|
||||
<choose>
|
||||
<when test="query.isInclude != null and query.isInclude == true">
|
||||
and u.dept_id IN
|
||||
</when>
|
||||
<when test="query.isInclude != null and query.isInclude == false">
|
||||
and u.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and u.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="query.deptIds" index="index" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletManageBalanceDto implements BaseIsIncludeTreeInterface {
|
||||
|
||||
private String walletRecordMonth;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private Long walletTypeId;
|
||||
|
||||
private Boolean isInclude;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
}
|
||||
+7
-6
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -8,7 +9,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletManageDto extends WalletManageEntity {
|
||||
public class WalletManageDto extends WalletManageEntity implements BaseIsIncludeTreeInterface {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
@@ -16,14 +17,14 @@ public class WalletManageDto extends WalletManageEntity {
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
/**
|
||||
* 是否深度搜索deptId
|
||||
*/
|
||||
private Boolean isDeepDept;
|
||||
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
private List<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 是否深度搜索deptId
|
||||
*/
|
||||
private Boolean isInclude;
|
||||
|
||||
}
|
||||
+7
-6
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -8,7 +9,7 @@ import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletTransactionDto extends WalletTransactionEntity {
|
||||
public class WalletTransactionDto extends WalletTransactionEntity implements BaseIsIncludeTreeInterface {
|
||||
|
||||
/**
|
||||
* 类型 - 收入
|
||||
@@ -40,14 +41,14 @@ public class WalletTransactionDto extends WalletTransactionEntity {
|
||||
*/
|
||||
private Boolean isFindOrder = false;
|
||||
|
||||
/**
|
||||
* 是否深度搜索deptId
|
||||
*/
|
||||
private Boolean isDeepDept;
|
||||
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
private List<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 是否包含部门ids
|
||||
*/
|
||||
private Boolean isInclude;
|
||||
|
||||
}
|
||||
+12
-5
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.recharge;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -7,7 +8,7 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletRechargeImportDto extends WalletRechargeImportEntity {
|
||||
public class WalletRechargeImportDto extends WalletRechargeImportEntity implements BaseIsIncludeTreeInterface {
|
||||
|
||||
private String processStatus;
|
||||
|
||||
@@ -19,16 +20,22 @@ public class WalletRechargeImportDto extends WalletRechargeImportEntity {
|
||||
|
||||
private Long userDeptId;
|
||||
|
||||
/**
|
||||
* 是否深度搜索deptId
|
||||
*/
|
||||
private Boolean isDeepDept;
|
||||
|
||||
/**
|
||||
* 部门ids
|
||||
*/
|
||||
private List<Long> userDeptIds;
|
||||
|
||||
/**
|
||||
* 没有使用
|
||||
*/
|
||||
private List<Long> deptIds;
|
||||
|
||||
/**
|
||||
* 是否包含部门ids
|
||||
*/
|
||||
private Boolean isInclude;
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
private LocalDateTime[] processTimeList;
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class WalletManageBalanceVo {
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long walletId;
|
||||
|
||||
private Long walletTypeId;
|
||||
|
||||
private String walletTypeName;
|
||||
|
||||
private Integer balance;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
+8
@@ -6,6 +6,9 @@ import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletTypeInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class WalletManageVo extends WalletManageEntity implements BaseUserInterface, BaseDeptInterface, BaseWalletTypeInterface {
|
||||
@@ -39,4 +42,9 @@ public class WalletManageVo extends WalletManageEntity implements BaseUserInterf
|
||||
* 导出相关
|
||||
*/
|
||||
private Long lineNumber;
|
||||
|
||||
/**
|
||||
* 最后充值时间
|
||||
*/
|
||||
private LocalDateTime lastTopUpTime;
|
||||
}
|
||||
+14
-2
@@ -1,6 +1,5 @@
|
||||
package com.bsd.pjcloud.wallet.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -14,6 +13,7 @@ import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
@@ -22,7 +22,6 @@ import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletManageService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -150,6 +149,13 @@ public class WalletManageController {
|
||||
return R.ok(walletManageService.scopePageList(page, dto, DataScope.of()));
|
||||
}
|
||||
|
||||
@Operation(summary = "钱包记录分页", description = "钱包记录分页")
|
||||
@PostMapping("/page-join-qb")
|
||||
public R pageJoinQb(@ParameterObject Page page, @RequestBody WalletManageBalanceDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletManageService.scopeQbPage(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletManage_view')")
|
||||
@@ -186,4 +192,10 @@ public class WalletManageController {
|
||||
public void export(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletManageDto dto) {
|
||||
walletManageService.export(response, page, dto);
|
||||
}
|
||||
|
||||
@PostMapping("/export-qb")
|
||||
// @PreAuthorize("@pms.hasPermission('wallet_walletManage_export')")
|
||||
public void exportQb(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletManageBalanceDto dto) {
|
||||
walletManageService.exportQb(response, page, dto);
|
||||
}
|
||||
}
|
||||
-1
@@ -96,7 +96,6 @@ public class WalletTransactionController {
|
||||
@PostMapping("/page-cz")
|
||||
public R pageCz(@ParameterObject Page page, @RequestBody WalletTransactionDto dto) {
|
||||
dto.setBizTypes(WalletBizEnum.getTopUpCodes());
|
||||
// dto.setType(WalletTransactionDto.TYPE_INCOME);
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletTransactionService.scopePageList(page, dto, dataScope));
|
||||
}
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ public class WalletRechargeImportController {
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
BigDecimal priceStrSum = BigDecimal.ZERO;
|
||||
|
||||
+39
-33
@@ -7,17 +7,48 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageBalanceVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity> {
|
||||
|
||||
private LambdaQueryWrapper<WalletManageEntity> commonQuery(WalletManageDto dto) {
|
||||
LambdaQueryWrapper<WalletManageEntity> wrapper = new LambdaQueryWrapper<WalletManageEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), WalletManageEntity::getUserId, dto.getUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletManageEntity::getDeptId, dto.getDeptId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getWalletTypeId()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getIsFreeze()), WalletManageEntity::getIsFreeze, dto.getIsFreeze())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletIds()), WalletManageEntity::getId, dto.getWalletIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
WalletManageEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsInclude())) {
|
||||
if (dto.getIsInclude()) {
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletManageEntity::getDeptId, dto.getDeptIds());
|
||||
} else {
|
||||
wrapper.notIn(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletManageEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
} else {
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletManageEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当消费时候, 更新钱包
|
||||
*
|
||||
@@ -102,45 +133,20 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
|
||||
return selectJoinOne(WalletManageVo.class, wrapper);
|
||||
}
|
||||
|
||||
default Page<WalletManageVo> scopePageList(Page page, WalletManageDto dto, DataScope dataScope) {
|
||||
LambdaQueryWrapper<WalletManageEntity> wrapper = new LambdaQueryWrapper<WalletManageEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), WalletManageEntity::getUserId, dto.getUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletManageEntity::getDeptId, dto.getDeptId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getWalletTypeId()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getIsFreeze()), WalletManageEntity::getIsFreeze, dto.getIsFreeze())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletIds()), WalletManageEntity::getId, dto.getWalletIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletManageEntity::getDeptId, dto.getDeptIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
WalletManageEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
Page list = selectPageByScope(page, wrapper, dataScope);
|
||||
default Page<WalletManageVo> scopePage(Page page, WalletManageDto dto, DataScope dataScope) {
|
||||
Page list = selectPageByScope(page, commonQuery(dto), dataScope);
|
||||
list.setRecords(BeanUtils.toBean(list.getRecords(), WalletManageVo.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
default List<WalletManageVo> scopeList(WalletManageDto dto, DataScope dataScope) {
|
||||
LambdaQueryWrapper<WalletManageEntity> wrapper = new LambdaQueryWrapper<WalletManageEntity>()
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), WalletManageEntity::getUserId, dto.getUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletManageEntity::getDeptId, dto.getDeptId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getWalletTypeId()), WalletManageEntity::getWalletTypeId, dto.getWalletTypeId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getIsFreeze()), WalletManageEntity::getIsFreeze, dto.getIsFreeze())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getWalletIds()), WalletManageEntity::getId, dto.getWalletIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletManageEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletManageEntity::getDeptId, dto.getDeptIds())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
WalletManageEntity::getCreateTime,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[0] : null,
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(WalletManageEntity::getCreateTime);
|
||||
List<WalletManageEntity> list = selectListByScope(wrapper, dataScope);
|
||||
List<WalletManageEntity> list = selectListByScope(commonQuery(dto), dataScope);
|
||||
return BeanUtils.toBean(list, WalletManageVo.class);
|
||||
}
|
||||
|
||||
Page<Long> scopeUserPage(Page page, @Param("dto") WalletManageDto dto, @Param("dataScope") DataScope dataScope);
|
||||
|
||||
List<Long> scopeUserList(@Param("dto") WalletManageDto dto, @Param("dataScope") DataScope dataScope);
|
||||
|
||||
List<WalletManageBalanceVo> selectBalance(@Param("dto") WalletManageBalanceDto walletDto);
|
||||
}
|
||||
+18
-2
@@ -31,7 +31,6 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), WalletTransactionEntity::getUserId, dto.getUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletTransactionEntity::getDeptId, dto.getDeptId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletTransactionEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getBizTypes()), WalletTransactionEntity::getBizType, dto.getBizTypes())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
@@ -40,6 +39,15 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(WalletTransactionEntity::getCreateTime);
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsInclude())) {
|
||||
if(dto.getIsInclude()){
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}else{
|
||||
wrapper.notIn(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
} else {
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
if (ObjectUtil.equals(dto.getType(), WalletTransactionDto.TYPE_INCOME)) {
|
||||
wrapper.gt(WalletTransactionEntity::getPrice, 0);
|
||||
} else if (Objects.equals(dto.getType(), WalletTransactionDto.TYPE_EXPENSE)) {
|
||||
@@ -57,7 +65,6 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getUserId()), WalletTransactionEntity::getUserId, dto.getUserId())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getDeptId()), WalletTransactionEntity::getDeptId, dto.getDeptId())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletTransactionEntity::getUserId, dto.getUserIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getBizTypes()), WalletTransactionEntity::getBizType, dto.getBizTypes())
|
||||
.between(
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()),
|
||||
@@ -66,6 +73,15 @@ public interface WalletTransactionMapper extends PjcloudBaseMapper<WalletTransac
|
||||
ObjectUtil.isNotEmpty(dto.getCreateTimeList()) ? dto.getCreateTimeList()[1] : null
|
||||
)
|
||||
.orderByDesc(WalletTransactionEntity::getCreateTime);
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsInclude())) {
|
||||
if(dto.getIsInclude()){
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}else{
|
||||
wrapper.notIn(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
} else {
|
||||
wrapper.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletTransactionEntity::getDeptId, dto.getDeptIds());
|
||||
}
|
||||
if (ObjectUtil.equals(dto.getType(), WalletTransactionDto.TYPE_INCOME)) {
|
||||
wrapper.gt(WalletTransactionEntity::getPrice, 0);
|
||||
} else if (Objects.equals(dto.getType(), WalletTransactionDto.TYPE_EXPENSE)) {
|
||||
|
||||
+14
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
@@ -84,6 +85,10 @@ public interface WalletManageService extends IService<WalletManageEntity> {
|
||||
|
||||
List<WalletManageVo> scopeList(WalletManageDto dto, DataScope dataScope);
|
||||
|
||||
Page<WalletManageVo> scopeQbPage(Page page, WalletManageBalanceDto dto, DataScope dataScope);
|
||||
|
||||
List<WalletManageVo> scopeQbList(WalletManageBalanceDto dto, DataScope dataScope);
|
||||
|
||||
WalletManageVo join(Long user, Long walletId);
|
||||
|
||||
/**
|
||||
@@ -100,4 +105,13 @@ public interface WalletManageService extends IService<WalletManageEntity> {
|
||||
* @param dto
|
||||
*/
|
||||
void export(HttpServletResponse response, Page page, WalletManageDto dto);
|
||||
|
||||
/**
|
||||
* 钱包记录导出
|
||||
*
|
||||
* @param response
|
||||
* @param page
|
||||
* @param dto
|
||||
*/
|
||||
void exportQb(HttpServletResponse response, Page page, WalletManageBalanceDto dto);
|
||||
}
|
||||
+106
-25
@@ -32,11 +32,13 @@ import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeExtraDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletTypeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageBalanceVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletSettingVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletManageMapper;
|
||||
@@ -59,7 +61,6 @@ import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 钱包管理
|
||||
@@ -219,17 +220,6 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
|
||||
@Override
|
||||
public List<WalletManageVo> scopeList(WalletManageDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
List<WalletManageVo> list = baseMapper.scopeList(dto, dataScope);
|
||||
disposeList(list, dto);
|
||||
return list;
|
||||
@@ -237,18 +227,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
|
||||
@Override
|
||||
public Page<WalletManageVo> scopePageList(Page page, WalletManageDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
Page<WalletManageVo> list = baseMapper.scopePageList(page, dto, dataScope);
|
||||
Page<WalletManageVo> list = baseMapper.scopePage(page, dto, dataScope);
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
}
|
||||
@@ -266,6 +245,78 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
return detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletManageVo> scopeQbPage(Page page, WalletManageBalanceDto dto, DataScope dataScope) {
|
||||
WalletManageDto walletDto = BeanUtils.toBean(dto, WalletManageDto.class);
|
||||
Page<WalletManageVo> walletPage = baseMapper.scopePage(page, walletDto, dataScope);
|
||||
if (walletPage.getTotal() == 0) return walletPage;
|
||||
walletPage.getRecords().forEach(v -> {
|
||||
v.setBalance(0);
|
||||
v.setTotalRecharge(0);
|
||||
v.setTotalExpense(0);
|
||||
});
|
||||
List<Long> userIds = walletPage.getRecords().stream().map(WalletManageVo::getUserId).distinct().toList();
|
||||
// 查询钱包类表
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeService.list();
|
||||
if (ObjectUtil.isEmpty(walletTypeList)) return walletPage;
|
||||
// 查询所有钱包类型的流水记录
|
||||
for (WalletTypeEntity i : walletTypeList) {
|
||||
dto.setWalletTypeId(i.getId());
|
||||
if (ObjectUtil.isEmpty(dto.getUserId())) {
|
||||
dto.setUserIds(userIds);
|
||||
}
|
||||
List<WalletManageBalanceVo> itemList = baseMapper.selectBalance(dto);
|
||||
if (ObjectUtil.isEmpty(itemList)) continue;
|
||||
for (WalletManageBalanceVo j : itemList) {
|
||||
j.setWalletTypeName(i.getName());
|
||||
walletPage.getRecords().stream().filter(v -> ObjectUtil.equals(v.getUserId(), j.getUserId())).findFirst().ifPresent(v -> {
|
||||
if (ObjectUtil.isNotEmpty(j.getBalance())) {
|
||||
v.setBalance(j.getBalance());
|
||||
v.setLastTopUpTime(j.getCreateTime());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
disposeList(walletPage.getRecords(), walletDto);
|
||||
return walletPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WalletManageVo> scopeQbList(WalletManageBalanceDto dto, DataScope dataScope) {
|
||||
WalletManageDto walletDto = BeanUtils.toBean(dto, WalletManageDto.class);
|
||||
List<WalletManageVo> walletList = baseMapper.scopeList(walletDto, dataScope);
|
||||
if (ObjectUtil.isEmpty(walletList)) return walletList;
|
||||
walletList.forEach(v -> {
|
||||
v.setBalance(0);
|
||||
v.setTotalRecharge(0);
|
||||
v.setTotalExpense(0);
|
||||
});
|
||||
List<Long> userIds = walletList.stream().map(WalletManageVo::getUserId).distinct().toList();
|
||||
// 查询钱包类表
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeService.list();
|
||||
if (ObjectUtil.isEmpty(walletTypeList)) return walletList;
|
||||
// 查询所有钱包类型的流水记录
|
||||
for (WalletTypeEntity i : walletTypeList) {
|
||||
dto.setWalletTypeId(i.getId());
|
||||
if (ObjectUtil.isEmpty(dto.getUserId())) {
|
||||
dto.setUserIds(userIds);
|
||||
}
|
||||
List<WalletManageBalanceVo> itemList = baseMapper.selectBalance(dto);
|
||||
if (ObjectUtil.isEmpty(itemList)) continue;
|
||||
for (WalletManageBalanceVo j : itemList) {
|
||||
j.setWalletTypeName(i.getName());
|
||||
walletList.stream().filter(v -> ObjectUtil.equals(v.getUserId(), j.getUserId())).findFirst().ifPresent(v -> {
|
||||
if (ObjectUtil.isNotEmpty(j.getBalance())) {
|
||||
v.setBalance(j.getBalance());
|
||||
v.setLastTopUpTime(j.getCreateTime());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
disposeList(walletList, walletDto);
|
||||
return walletList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(HttpServletResponse response, Page page, WalletManageDto dto) {
|
||||
String fileName = "file/账户余额.xlsx";
|
||||
@@ -277,7 +328,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
BigDecimal balanceSum = BigDecimal.ZERO;
|
||||
@@ -312,6 +363,36 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportQb(HttpServletResponse response, Page page, WalletManageBalanceDto dto) {
|
||||
String fileName = "file/个人钱包记录明细.xlsx";
|
||||
List<WalletManageVo> list = scopeQbList(dto, DataScope.of());
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream(fileName)).build()) {
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("walletRecordMonth", dto.getWalletRecordMonth());
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
Long lineNumber = 1L;
|
||||
BigDecimal balanceSum = BigDecimal.ZERO;
|
||||
for (WalletManageVo v : list) {
|
||||
v.setLineNumber(lineNumber);
|
||||
lineNumber++;
|
||||
if (ObjectUtil.isNotEmpty(v.getBalance())) {
|
||||
balanceSum = balanceSum.add(BigDecimal.valueOf(v.getBalance()));
|
||||
v.setBalance(BigDecimal.valueOf(v.getBalance()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).intValue());
|
||||
}
|
||||
}
|
||||
map.put("balanceSum", balanceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString());
|
||||
}
|
||||
excelWriter.fill(map, writeSheet);
|
||||
excelWriter.fill(list, fillConfig, writeSheet);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|导入错误,dto:|{}|,fileName:|{}|,error:|{}|", TAG, JSON.toJSONString(dto), fileName, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void disposeList(List<WalletManageVo> list, WalletManageDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 用户
|
||||
|
||||
+1
-23
@@ -165,17 +165,6 @@ public class WalletTransactionServiceImpl extends ServiceImpl<WalletTransactionM
|
||||
|
||||
@Override
|
||||
public Page<WalletTransactionVo> scopePageList(Page page, WalletTransactionDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
Page<WalletTransactionVo> list = baseMapper.scopePageList(page, dto, dataScope);
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
@@ -183,17 +172,6 @@ public class WalletTransactionServiceImpl extends ServiceImpl<WalletTransactionM
|
||||
|
||||
@Override
|
||||
public List<WalletTransactionVo> scopeList(WalletTransactionDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
dto.setDeptId(null);
|
||||
}
|
||||
List<WalletTransactionVo> list = baseMapper.scopeList(dto, dataScope);
|
||||
disposeList(list, dto);
|
||||
return list;
|
||||
@@ -208,7 +186,7 @@ public class WalletTransactionServiceImpl extends ServiceImpl<WalletTransactionM
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
BigDecimal priceTotal = BigDecimal.ZERO;
|
||||
|
||||
-22
@@ -94,17 +94,6 @@ public class WalletRechargeImportServiceImpl extends ServiceImpl<WalletRechargeI
|
||||
|
||||
@Override
|
||||
public Page<WalletRechargeImportVo> scopePageList(Page page, WalletRechargeImportDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getUserDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getUserDeptId()).getData();
|
||||
dto.setUserDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getUserDeptIds())) {
|
||||
dto.setUserDeptId(null);
|
||||
}
|
||||
Page<WalletRechargeImportVo> list = baseMapper.scopePageList(page, dto, dataScope);
|
||||
disposeList(list.getRecords(), dto);
|
||||
return list;
|
||||
@@ -112,17 +101,6 @@ public class WalletRechargeImportServiceImpl extends ServiceImpl<WalletRechargeI
|
||||
|
||||
@Override
|
||||
public List<WalletRechargeImportVo> scopeList(WalletRechargeImportDto dto, DataScope dataScope) {
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getUserDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getUserDeptId()).getData();
|
||||
dto.setUserDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setUserDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getUserDeptIds())) {
|
||||
dto.setUserDeptId(null);
|
||||
}
|
||||
List<WalletRechargeImportVo> list = baseMapper.scopeList(dto, dataScope);
|
||||
disposeList(list, dto);
|
||||
return list;
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.bsd.pjcloud.wallet.utils.dept;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsDeepDeptTreeInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeptUtil {
|
||||
|
||||
private final RemoteDeptService deptService;
|
||||
|
||||
public <T extends BaseIsIncludeTreeInterface> void disposeIsIncludeTreeDto(T dto) {
|
||||
if (ObjectUtil.isEmpty(dto)) return;
|
||||
}
|
||||
|
||||
public <T extends BaseIsDeepDeptTreeInterface> void disposeIsDeepDeptTreeDto(T dto) {
|
||||
if (ObjectUtil.isEmpty(dto)) return;
|
||||
// 查询部门
|
||||
if (ObjectUtil.isNotEmpty(dto.getIsDeepDept()) && dto.getIsDeepDept() && ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
List<SysDept> deptList = deptService.getDescendantList(dto.getDeptId()).getData();
|
||||
dto.setDeptId(null);
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
dto.setDeptIds(deptList.stream().map(SysDept::getDeptId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -2,8 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.WalletManageMapper">
|
||||
|
||||
<resultMap id="walletManageMap" type="com.bsd.pjcloud.wallet.api.entity.WalletManageEntity">
|
||||
<resultMap id="walletManageMap" type="com.bsd.pjcloud.wallet.api.entity.WalletManageEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="walletTypeId" column="wallet_type_id"/>
|
||||
@@ -21,6 +20,92 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.user_id,
|
||||
a.wallet_type_id,
|
||||
a.dept_id,
|
||||
a.card_number,
|
||||
a.balance,
|
||||
a.total_expense,
|
||||
a.total_recharge,
|
||||
a.freeze_price,
|
||||
a.is_freeze,
|
||||
a.active_bind_time,
|
||||
a.active_bind_status,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id,
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectBalance" resultType="com.bsd.pjcloud.wallet.api.vo.WalletManageBalanceVo">
|
||||
SELECT a.user_id,
|
||||
a.balance,
|
||||
a.wallet_id,
|
||||
m.wallet_type_id,
|
||||
a.create_time
|
||||
FROM wallet_transaction a
|
||||
LEFT JOIN wallet_manage m on a.wallet_id = m.id
|
||||
<where>
|
||||
a.del_flag = 0
|
||||
<if test="dto.walletRecordMonth != null">
|
||||
AND a.create_time = (SELECT MAX(sub.create_time) FROM wallet_transaction sub WHERE sub.user_id = a.user_id AND
|
||||
DATE_FORMAT(sub.create_time, '%Y-%m') = #{dto.walletRecordMonth})
|
||||
</if>
|
||||
<if test="dto.userId != null">
|
||||
AND a.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.walletTypeId != null">
|
||||
AND m.wallet_type_id = #{dto.walletTypeId}
|
||||
</if>
|
||||
<if test="dto.userIds != null and dto.userIds.size() != 0">
|
||||
and a.user_id in
|
||||
<foreach collection="dto.userIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.user_id;
|
||||
</select>
|
||||
|
||||
<sql id="scopeUser">
|
||||
select a.user_id from wallet_manage a
|
||||
<where>
|
||||
a.del_flag = 0
|
||||
<if test="dto.deptIds != null and dto.deptIds.size() != 0">
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and a.dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and a.dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.deptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by a.user_id;
|
||||
</sql>
|
||||
|
||||
<select id="scopeUserPage" resultType="java.lang.Long">
|
||||
<include refid="scopeUser" />
|
||||
</select>
|
||||
|
||||
<delete id="scopeUserList">
|
||||
<include refid="scopeUser" />
|
||||
</delete>
|
||||
</mapper>
|
||||
+11
-1
@@ -50,7 +50,17 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.userDeptIds != null and dto.userDeptIds.size() != 0">
|
||||
and a.user_dept_id in
|
||||
<choose>
|
||||
<when test="dto.isInclude != null and dto.isInclude == true">
|
||||
and a.user_dept_id IN
|
||||
</when>
|
||||
<when test="dto.isInclude != null and dto.isInclude == false">
|
||||
and a.user_dept_id NOT IN
|
||||
</when>
|
||||
<otherwise>
|
||||
and a.user_dept_id IN
|
||||
</otherwise>
|
||||
</choose>
|
||||
<foreach collection="dto.userDeptIds" item="v" open="(" close=")" separator=",">
|
||||
#{v}
|
||||
</foreach>
|
||||
|
||||
Reference in new issue
Block a user