Compare commits
25 Commits
b83c53fe04
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b3fb08036 | |||
| 484ffb07e5 | |||
| e9ef1b0fac | |||
| 04be17d63e | |||
| 21da0a344c | |||
| 656db661ab | |||
| 4498108fb5 | |||
| 235c442c6d | |||
| 592cc99db4 | |||
| f8db70ca43 | |||
| 1f6593c957 | |||
| b22b9bd4d6 | |||
| d6ef8cfba9 | |||
|
|
0fbe490178 | ||
| d693bb0dd3 | |||
| b6e3d109fc | |||
| bfff341d17 | |||
| f85ac0815b | |||
| 80fb367673 | |||
| 574c73d0b5 | |||
| cb18aa5670 | |||
| da3447cd0b | |||
| 9e946443ec | |||
| 71ffdede19 | |||
| 353404dde4 |
@@ -3,7 +3,6 @@ package com.czg.controller.admin;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.EntryManager;
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.dto.req.AggregateMerchantDto;
|
||||
import com.czg.dto.resp.WechatBankBranchRespDto;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
@@ -33,9 +32,6 @@ public class EntryManagerController {
|
||||
@Resource
|
||||
private EntryManagerTask entryManagerTask;
|
||||
|
||||
@Resource
|
||||
private RabbitPublisher rabbitPublisher;
|
||||
|
||||
/**
|
||||
* ocr识别填充
|
||||
* 阿里 ocr识别图片
|
||||
@@ -68,12 +64,6 @@ public class EntryManagerController {
|
||||
return CzgResult.success(EntryManager.queryBankBranchList(bankAliceCode, cityCode));
|
||||
}
|
||||
|
||||
@GetMapping("test")
|
||||
public CzgResult<Void> test(String shopId, String licenceNo) {
|
||||
rabbitPublisher.sendEntryManagerMsg(shopId + ":" + licenceNo);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进件列表
|
||||
*/
|
||||
@@ -87,8 +77,8 @@ public class EntryManagerController {
|
||||
* 获取进件信息
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<AggregateMerchantVO> getEntry(Long shopId, String licenceNo) {
|
||||
return CzgResult.success(shopDirectMerchantService.getEntry(shopId, licenceNo));
|
||||
public CzgResult<AggregateMerchantVO> getEntry(Long shopId) {
|
||||
return CzgResult.success(shopDirectMerchantService.getEntry(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,8 +88,8 @@ public class EntryManagerController {
|
||||
*/
|
||||
@GetMapping("queryEntry")
|
||||
@Debounce(value = "#shopId", interval = 1000 * 60 * 3)
|
||||
public CzgResult<Boolean> queryEntry(Long shopId, String licenceNo) {
|
||||
entryManagerTask.entryManager(shopId, licenceNo);
|
||||
public CzgResult<Boolean> queryEntry(Long shopId) {
|
||||
entryManagerTask.entryManager(shopId);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaAdminCheckRole;
|
||||
import com.czg.constant.PayChannelCst;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.order.dto.ShopMerchantDTO;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
import com.czg.order.service.ShopMerchantService;
|
||||
@@ -44,6 +46,9 @@ public class ShopMerchantController {
|
||||
@SaAdminCheckPermission(parentName = "支付参数信息", value = "shopMerchant:edit", name = "商户支付信息修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody ShopMerchantDTO shopMerchant) {
|
||||
if (shopMerchant != null && shopMerchant.getChannel() != null && shopMerchant.getChannel().equals(PayChannelCst.NATIVE)) {
|
||||
throw new CzgException("原生支付渠道暂未开通");
|
||||
}
|
||||
return CzgResult.success(shopMerchantService.editEntry(shopMerchant, true));
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EntryManagerMqListener {
|
||||
ThreadContext.put("traceId", String.valueOf(shopId));
|
||||
log.info("进件2MQ对接开始shopId:{}", msg);
|
||||
// 安全转换shopId
|
||||
AggregateMerchantVO entry = shopDirectMerchantService.getEntry(shopId, split[1]);
|
||||
AggregateMerchantVO entry = shopDirectMerchantService.getEntry(shopId);
|
||||
log.info("进件3MQ对接开始shopId:{}", msg);
|
||||
if (entry != null) {
|
||||
EntryManager.uploadParamImage(entry);
|
||||
|
||||
@@ -5,9 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.EntryManager;
|
||||
import com.czg.PayCst;
|
||||
import com.czg.constant.PayChannelCst;
|
||||
import com.czg.dto.resp.QueryStatusResp;
|
||||
import com.czg.order.dto.ShopMerchantDTO;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
import com.czg.order.service.ShopMerchantService;
|
||||
import com.czg.pay.AlipayAuthInfoDto;
|
||||
@@ -39,17 +37,16 @@ public class EntryManagerTask {
|
||||
public void run() {
|
||||
log.info("进件查询,定时任务执行");
|
||||
long start = System.currentTimeMillis();
|
||||
entryManager(null, null);
|
||||
entryManager(null);
|
||||
log.info("进件查询,定时任务执行完毕,耗时:{}ms", start - System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询状态为待处理、待签约、待审核的进件
|
||||
*/
|
||||
public void entryManager(Long shopId, String licenceNo) {
|
||||
public void entryManager(Long shopId) {
|
||||
List<ShopDirectMerchant> list = shopDirectMerchantService.list(QueryWrapper.create()
|
||||
.eq(ShopDirectMerchant::getShopId, shopId)
|
||||
.eq(ShopDirectMerchant::getLicenceNo, licenceNo)
|
||||
.in(ShopDirectMerchant::getWechatStatus, PayCst.EntryStatus.NEED_QUERY_LIST)
|
||||
.or(ShopDirectMerchant::getAlipayStatus).in(PayCst.EntryStatus.NEED_QUERY_LIST));
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
@@ -80,10 +77,10 @@ public class EntryManagerTask {
|
||||
}
|
||||
shopDirectMerchantService.updateById(shopDirectMerchant);
|
||||
if (StrUtil.isNotBlank(wechatMerchantId) || StrUtil.isNotBlank(alipayMerchantId)) {
|
||||
ShopMerchantDTO shopMerchantDTO = new ShopMerchantDTO();
|
||||
shopMerchantDTO.setShopId(shopId);
|
||||
shopMerchantDTO.setChannel(PayChannelCst.NATIVE);
|
||||
shopMerchantDTO.setRelatedLicenceNo(licenceNo);
|
||||
// ShopMerchantDTO shopMerchantDTO = new ShopMerchantDTO();
|
||||
// shopMerchantDTO.setShopId(shopId);
|
||||
// shopMerchantDTO.setChannel(PayChannelCst.NATIVE);
|
||||
// shopMerchantDTO.setRelatedId(shopDirectMerchant.getShopId());
|
||||
NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO();
|
||||
nativeMerchantDTO.setWechatMerchantId(wechatMerchantId);
|
||||
nativeMerchantDTO.setAlipayMerchantId(alipayMerchantId);
|
||||
@@ -91,9 +88,9 @@ public class EntryManagerTask {
|
||||
AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class);
|
||||
nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto);
|
||||
}
|
||||
shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO);
|
||||
shopMerchantService.editEntry(shopMerchantDTO, false);
|
||||
shopMerchantService.upMerchant(licenceNo, nativeMerchantDTO);
|
||||
// shopMerchantDTO.setNativeMerchantDTO(nativeMerchantDTO);
|
||||
// shopMerchantService.editEntry(shopMerchantDTO, false);
|
||||
shopMerchantService.upMerchant(shopDirectMerchant.getShopId(), nativeMerchantDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>cash-common-service</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>global-service</name>
|
||||
<name>common-service</name>
|
||||
<url>https://maven.apache.org</url>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.czg.market.service;
|
||||
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.dto.MkShopRechargeDTO;
|
||||
import com.czg.market.vo.MkShopRechargeShopListVO;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
@@ -21,7 +22,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface MkShopRechargeService extends IService<MkShopRecharge> {
|
||||
|
||||
MkShopRechargeVO detail(Long shopId);
|
||||
MkShopRechargeVO detail(Long shopId) throws CzgException;
|
||||
|
||||
MkShopRechargeVO detailApp(Long shopId);
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ public class ShopMerchantDTO {
|
||||
private String channel;
|
||||
/**
|
||||
* 聚合支付商户
|
||||
* native 必填 对应 tb_shop_direct_merchant 的 licence_no 营业执照
|
||||
* native 必填 对应 tb_shop_direct_merchant 的 shopId
|
||||
*/
|
||||
private String relatedLicenceNo;
|
||||
private Long relatedId;
|
||||
/**
|
||||
* 原生支付参数
|
||||
*/
|
||||
|
||||
@@ -93,7 +93,7 @@ public class OrderPayment implements Serializable {
|
||||
*/
|
||||
private String tradeNumber;
|
||||
|
||||
@Column(onUpdateValue = "now()")
|
||||
// @Column(onUpdateValue = "now()")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.czg.order.entity;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -21,7 +20,7 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_merchant2")
|
||||
@Table("tb_shop_merchant")
|
||||
public class ShopMerchant implements Serializable {
|
||||
|
||||
@Serial
|
||||
@@ -42,9 +41,9 @@ public class ShopMerchant implements Serializable {
|
||||
|
||||
/**
|
||||
* 聚合支付商户
|
||||
* native 必填 对应 tb_shop_direct_merchant 的 licence_no 营业执照
|
||||
* native 必填 对应 tb_shop_direct_merchant 的 shopId
|
||||
*/
|
||||
private String relatedLicenceNo;
|
||||
private Long relatedId;
|
||||
|
||||
/**
|
||||
* 微信appid
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface ShopMerchantService extends IService<ShopMerchant> {
|
||||
* 已绑定的支付
|
||||
* 更新商户支付参数
|
||||
*/
|
||||
void upMerchant(@NotBlank String relatedLicenceNo, @NotNull NativeMerchantDTO nativeMerchantDTO);
|
||||
void upMerchant(@NotBlank Long relatedId, @NotNull NativeMerchantDTO nativeMerchantDTO);
|
||||
|
||||
ShopMerchant getByShopId(Long shopId);
|
||||
|
||||
|
||||
@@ -37,6 +37,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 短信 -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dysmsapi20170525</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
@@ -45,10 +50,6 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dysmsapi20170525</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
|
||||
@@ -15,9 +15,7 @@ import com.czg.third.wechat.dto.req.entry.*;
|
||||
import com.czg.third.wechat.dto.req.entry.business.WechatEntryBusinessReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.WechatEntryIdentityReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.WechatEntryLicenseReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.sales.WechatEntryMiniProgramReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.sales.WechatEntrySalesInfoReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.sales.WechatEntryStoreInfoReqDto;
|
||||
import com.czg.third.wechat.dto.req.entry.business.sales.*;
|
||||
import com.czg.third.wechat.dto.req.entry.id.WechatEntryIdCardReqDto;
|
||||
import com.czg.third.wechat.dto.resp.WechatAuditDetail;
|
||||
import com.czg.third.wechat.dto.resp.WechatQueryStateResp;
|
||||
@@ -319,6 +317,9 @@ public class WechatEntryManager {
|
||||
WechatEntryMiniProgramReqDto miniProgramInfo = new WechatEntryMiniProgramReqDto();
|
||||
miniProgramInfo.setMiniProgramAppid("wxd88fffa983758a30");
|
||||
salesInfo.setMiniProgramInfo(miniProgramInfo);
|
||||
WechatEntryWebInfoReqDto webInfo = new WechatEntryWebInfoReqDto();
|
||||
webInfo.setDomain("https://invoice.sxczgkj.cn/pay/");
|
||||
salesInfo.setWebInfo(webInfo);
|
||||
businessReqInfo.setSalesInfo(salesInfo);
|
||||
entryParams.setBusinessInfo(businessReqInfo);
|
||||
|
||||
|
||||
@@ -253,6 +253,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
@Override
|
||||
@CacheEvict(key = "#shopInfoEditDTO.id")
|
||||
public Boolean edit(ShopInfoEditDTO shopInfoEditDTO) {
|
||||
shopInfoEditDTO.setIsMemberPrice(null);
|
||||
ShopInfo shopInfo;
|
||||
if (!StpKit.USER.isAdmin()) {
|
||||
shopInfo = queryChain().eq(ShopInfo::getId, StpKit.USER.getShopId()).one();
|
||||
@@ -319,8 +320,6 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
rabbitPublisher.sendOrderDetailStatusMsg(shopInfo.getId().toString(), "shopInfoUpdate");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ import com.czg.market.vo.InviteUserVO;
|
||||
import com.czg.market.vo.MkDistributionConfigVO;
|
||||
import com.czg.order.dto.MkDistributionPayDTO;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.market.service.OrderInfoService;
|
||||
import com.czg.order.service.OrderPaymentService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.enums.OrderStatusEnums;
|
||||
import com.czg.service.market.mapper.MkDistributionUserMapper;
|
||||
@@ -685,22 +683,15 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
.ne(MkDistributionFlow::getStatus, TableValueConstant.DistributionFlow.Status.REFUND.getCode()));
|
||||
|
||||
list.forEach(item -> {
|
||||
MkDistributionFlow refundFlow = BeanUtil.copyProperties(item, MkDistributionFlow.class);
|
||||
refundFlow.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
||||
refundFlow.setSourceId(item.getId());
|
||||
refundFlow.setId(null);
|
||||
refundFlow.setCreateTime(DateUtil.date().toLocalDateTime());
|
||||
refundFlow.setUpdateTime(DateUtil.date().toLocalDateTime());
|
||||
if (TableValueConstant.DistributionFlow.Status.PENDING.getCode().equals(item.getStatus())) {
|
||||
item.setStatus(TableValueConstant.DistributionFlow.Status.SUCCESS.getCode());
|
||||
// updateIncome(item.getRewardAmount().negate(), BigDecimal.ZERO, BigDecimal.ZERO, item.getDistributionUserId(), item.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
|
||||
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
||||
distributionFlowService.updateById(item);
|
||||
mapper.updateIncome(item.getRewardAmount().negate(), null, null, item.getDistributionUserId(), item.getShopId());
|
||||
} else {
|
||||
// 执行扣款
|
||||
updateIncome(BigDecimal.ZERO, item.getRewardAmount().negate(), BigDecimal.ZERO, item.getDistributionUserId(), item.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
|
||||
updateShopInfoAmount(item.getShopId(), item.getRewardAmount(), orderId, TableValueConstant.DistributionAmountFlow.Type.REFUND, "分销回退");
|
||||
}
|
||||
distributionFlowService.save(refundFlow);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -738,6 +729,13 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
distributionDeliverService.save(deliver);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销金额修改
|
||||
*
|
||||
* @param pendingIncome 待入账金额
|
||||
* @param receivedIncome 已入账
|
||||
* @param withdrawIncome 已提现
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateIncome(BigDecimal pendingIncome, BigDecimal receivedIncome, BigDecimal withdrawIncome, Long id, Long userId, Long shopUserId, Long shopId, Integer isOne) {
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public MkShopRechargeVO detail(Long shopId) {
|
||||
public MkShopRechargeVO detail(Long shopId) throws CzgException{
|
||||
shopId = shopInfoService.getMainIdByShopId(shopId);
|
||||
ShopInfo shopInfo = shopInfoService.getById(shopId);
|
||||
if (shopInfo.getMainId() != null) {
|
||||
|
||||
@@ -45,36 +45,33 @@
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="totalAmount" resultType="java.math.BigDecimal">
|
||||
select sum(a.amount) from mk_distribution_flow as a
|
||||
left join mk_distribution_user as d on d.id=a.distribution_user_id
|
||||
select sum(a.reward_amount)
|
||||
from mk_distribution_flow as a
|
||||
left join tb_shop_user as b on a.shop_user_id = b.id
|
||||
left join tb_shop_user as c on c.id=a.shop_user_id
|
||||
where a.shop_id=#{shopId}
|
||||
<if test="id != null">
|
||||
and a.shop_user_id=#{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and a.user_id=#{userId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status=#{status}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and a.type=#{type}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and a.create_time>=#{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and a.create_time<=#{endTime}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and a.status=#{status}
|
||||
</if>
|
||||
<if test="key != null and key != ''">
|
||||
and (
|
||||
b.nick_name like concat('%',#{key},'%')
|
||||
or b.id like concat('%',#{key},'%')
|
||||
or c.id like concat('%',#{key},'%')
|
||||
or c.nick_name like concat('%',#{key},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and d.id=#{id}
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and a.type=#{type}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and d.user_id=#{userId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -5,16 +5,24 @@
|
||||
<mapper namespace="com.czg.service.market.mapper.MkDistributionUserMapper">
|
||||
<update id="updateIncome">
|
||||
update mk_distribution_user
|
||||
set
|
||||
<set>
|
||||
<if test="pendingIncome != null">
|
||||
total_income = total_income + #{pendingIncome},
|
||||
</if>
|
||||
<if test="receivedIncome != null">
|
||||
total_income = total_income + #{receivedIncome},
|
||||
</if>
|
||||
|
||||
<if test="pendingIncome != null">
|
||||
pending_income = pending_income + #{pendingIncome},
|
||||
</if>
|
||||
<if test="receivedIncome != null">
|
||||
received_income = received_income + #{receivedIncome},
|
||||
</if>
|
||||
<if test="withdrawIncome != null">
|
||||
withdrawn_income = withdrawn_income + #{withdrawIncome}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id} and shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ public interface PrinterImpl {
|
||||
// data.append("<OUT:15>");
|
||||
// data.append("<BR>");
|
||||
// 18个空格 12
|
||||
data.append(getFormatLabel("品名 数量 小计 ", signLabelInfo.s))
|
||||
data.append(getFormatLabel("品名 数量 单价 ", signLabelInfo.s))
|
||||
.append(signLabelInfo.br);
|
||||
// data.append("<S>品名 数量 小计</S><BR>");
|
||||
data.append(getFormatLabel("--------------------------------", signLabelInfo.s))
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface ShopDirectMerchantService extends IService<ShopDirectMerchant>
|
||||
/**
|
||||
* 获取进件信息
|
||||
*/
|
||||
AggregateMerchantVO getEntry(Long shopId, String licenceNo);
|
||||
AggregateMerchantVO getEntry(Long shopId);
|
||||
|
||||
/**
|
||||
* 申请进件
|
||||
|
||||
@@ -229,9 +229,11 @@ public class PayServiceImpl implements PayService {
|
||||
if (firstTwoDigits >= 10 && firstTwoDigits <= 15) {
|
||||
//微信支付
|
||||
bizData.setSubAppid(shopMerchant.getWechatAppId());
|
||||
bizData.setPayType(SystemConstants.PayType.WECHAT);
|
||||
} else if (firstTwoDigits >= 25 && firstTwoDigits <= 30) {
|
||||
//支付宝支付
|
||||
bizData.setSubAppid(shopMerchant.getAlipayAppId());
|
||||
bizData.setPayType(SystemConstants.PayType.ALIPAY);
|
||||
} else {
|
||||
throw new CzgException("扫描码非法或暂不支持");
|
||||
}
|
||||
|
||||
@@ -64,9 +64,8 @@ public class ShopDirectMerchantServiceImpl extends ServiceImpl<ShopDirectMerchan
|
||||
}
|
||||
|
||||
@Override
|
||||
public AggregateMerchantVO getEntry(Long shopId, String licenceNo) {
|
||||
public AggregateMerchantVO getEntry(Long shopId) {
|
||||
ShopDirectMerchant merchant = getOne(query()
|
||||
.eq(ShopDirectMerchant::getLicenceNo, licenceNo)
|
||||
.eq(ShopDirectMerchant::getShopId, shopId));
|
||||
if (merchant == null) {
|
||||
return null;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.czg.order.dto.ShopMerchantDTO;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
import com.czg.order.entity.ShopMerchant;
|
||||
import com.czg.order.service.ShopMerchantService;
|
||||
import com.czg.pay.AlipayAuthInfoDto;
|
||||
import com.czg.pay.NativeMerchantDTO;
|
||||
import com.czg.pay.PolyMerchantDTO;
|
||||
import com.czg.service.order.mapper.ShopMerchantMapper;
|
||||
@@ -48,15 +49,15 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
|
||||
}
|
||||
shopMerchantVO.setShopId(shopId);
|
||||
shopMerchantVO.setChannel(one.getChannel());
|
||||
shopMerchantVO.setRelatedLicenceNo(one.getRelatedLicenceNo());
|
||||
shopMerchantVO.setRelatedId(one.getRelatedId());
|
||||
if (StrUtil.isNotBlank(one.getNativePayJson())) {
|
||||
shopMerchantVO.setNativeMerchantDTO(JSONObject.parseObject(one.getNativePayJson(), NativeMerchantDTO.class));
|
||||
}
|
||||
if (StrUtil.isNotBlank(one.getPolyPayJson())) {
|
||||
shopMerchantVO.setPolyMerchantDTO(JSONObject.parseObject(one.getPolyPayJson(), PolyMerchantDTO.class));
|
||||
}
|
||||
if (StrUtil.isNotBlank(one.getRelatedLicenceNo())) {
|
||||
shopMerchantVO.setShopDirectMerchant(shopDirectMerchantService.getOne(query().eq(ShopDirectMerchant::getLicenceNo, one.getRelatedLicenceNo())));
|
||||
if (one.getRelatedId() != null) {
|
||||
shopMerchantVO.setShopDirectMerchant(shopDirectMerchantService.getOne(query().eq(ShopDirectMerchant::getShopId, one.getRelatedId())));
|
||||
}
|
||||
return shopMerchantVO;
|
||||
}
|
||||
@@ -76,37 +77,56 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
|
||||
shopMerchant = new ShopMerchant();
|
||||
shopMerchant.setAlipayAppId(SystemConstants.PayType.ALIPAY_APP_ID);
|
||||
shopMerchant.setWechatAppId(SystemConstants.PayType.WECHAT_APP_ID);
|
||||
shopMerchant.setRelatedId(shopMerchantParam.getShopId());
|
||||
}
|
||||
shopMerchant.setShopId(shopMerchantParam.getShopId());
|
||||
if (isUp) {
|
||||
shopMerchant.setChannel(CzgStrUtils.getStrOrNull(shopMerchantParam.getChannel()));
|
||||
shopMerchant.setRelatedLicenceNo(CzgStrUtils.getStrOrNull(shopMerchantParam.getRelatedLicenceNo()));
|
||||
if (shopMerchantParam.getNativeMerchantDTO() != null) {
|
||||
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
|
||||
shopMerchant.setRelatedId(shopMerchantParam.getRelatedId());
|
||||
if (shopMerchantParam.getRelatedId() == null || !shopMerchantParam.getRelatedId().equals(shopMerchant.getRelatedId())) {
|
||||
ShopDirectMerchant shopDirectMerchant = shopDirectMerchantService.getById(shopMerchantParam.getRelatedId());
|
||||
if (shopDirectMerchant != null) {
|
||||
NativeMerchantDTO nativeMerchantDTO = new NativeMerchantDTO();
|
||||
nativeMerchantDTO.setWechatMerchantId(shopDirectMerchant.getWechatMerchantId());
|
||||
nativeMerchantDTO.setAlipayMerchantId(shopDirectMerchant.getAlipayMerchantId());
|
||||
if (StrUtil.isNotBlank(shopDirectMerchant.getAlipayAuthInfo())) {
|
||||
AlipayAuthInfoDto alipayAuthInfoDto = JSONObject.parseObject(shopDirectMerchant.getAlipayAuthInfo(), AlipayAuthInfoDto.class);
|
||||
nativeMerchantDTO.setAlipayAuthInfo(alipayAuthInfoDto);
|
||||
}
|
||||
shopMerchant.setNativePayJson(JSONObject.toJSONString(nativeMerchantDTO));
|
||||
} else {
|
||||
shopMerchant.setNativePayJson(null);
|
||||
shopMerchant.setWechatAppId(null);
|
||||
shopMerchant.setAlipayAppId(null);
|
||||
}
|
||||
}
|
||||
if (shopMerchantParam.getPolyMerchantDTO() != null) {
|
||||
shopMerchant.setPolyPayJson(JSONObject.toJSONString(shopMerchantParam.getPolyMerchantDTO()));
|
||||
}
|
||||
} else {
|
||||
//不是新增且不是修改 只有进件完成会进入这里
|
||||
if (StrUtil.isBlank(shopMerchant.getRelatedLicenceNo())) {
|
||||
shopMerchant.setRelatedLicenceNo(shopMerchantParam.getRelatedLicenceNo());
|
||||
//只有进件会进入这里
|
||||
if (shopMerchant.getRelatedId() == null) {
|
||||
shopMerchant.setRelatedId(shopMerchantParam.getShopId());
|
||||
}
|
||||
if (StrUtil.isBlank(shopMerchant.getNativePayJson()) && shopMerchantParam.getNativeMerchantDTO() != null) {
|
||||
shopMerchant.setNativePayJson(JSONObject.toJSONString(shopMerchantParam.getNativeMerchantDTO()));
|
||||
}
|
||||
}
|
||||
return saveOrUpdate(shopMerchant);
|
||||
if (shopMerchant.getId() == null) {
|
||||
return save(shopMerchant);
|
||||
} else {
|
||||
return updateById(shopMerchant, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
public void upMerchant(@NotBlank String relatedLicenceNo, @NotNull NativeMerchantDTO nativeMerchantDTO) {
|
||||
public void upMerchant(@NotBlank Long relatedId, @NotNull NativeMerchantDTO nativeMerchantDTO) {
|
||||
ShopMerchant upShopMerchant = new ShopMerchant();
|
||||
upShopMerchant.setAlipayAppId(nativeMerchantDTO.getAlipayMerchantId());
|
||||
upShopMerchant.setWechatAppId(nativeMerchantDTO.getWechatMerchantId());
|
||||
upShopMerchant.setNativePayJson(JSONObject.toJSONString(nativeMerchantDTO));
|
||||
update(upShopMerchant, query().eq(ShopMerchant::getRelatedLicenceNo, relatedLicenceNo));
|
||||
update(upShopMerchant, query().eq(ShopMerchant::getRelatedId, relatedId));
|
||||
}
|
||||
|
||||
@Cacheable(key = "#shopId")
|
||||
|
||||
@@ -8,7 +8,6 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.product.entity.Product;
|
||||
import com.czg.product.entity.ProductStockFlow;
|
||||
import com.czg.product.service.ProductStockFlowService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.product.mapper.ConsInfoMapper;
|
||||
import com.czg.service.product.mapper.ProductMapper;
|
||||
import com.czg.service.product.mapper.ProductStockFlowMapper;
|
||||
@@ -44,15 +43,7 @@ public class ProductStockFlowServiceImpl extends ServiceImpl<ProductStockFlowMap
|
||||
Long shopId = entity.getShopId();
|
||||
BigDecimal afterNumber = entity.getAfterNumber();
|
||||
Product product = productMapper.selectOneById(entity.getProductId());
|
||||
String shopName = "";
|
||||
try {
|
||||
shopName = StpKit.USER.getShopName();
|
||||
} catch (Exception e) {
|
||||
log.error("获取店铺名称失败");
|
||||
}
|
||||
if (StrUtil.isEmpty(shopName)) {
|
||||
shopName = productMapper.getShopName(shopId);
|
||||
}
|
||||
String shopName = productMapper.getShopName(shopId);
|
||||
BigDecimal warnLine = Convert.toBigDecimal(product.getWarnLine());
|
||||
// 库存小于警告值,发送消息提醒
|
||||
if (NumberUtil.isLess(afterNumber, warnLine)) {
|
||||
|
||||
Reference in New Issue
Block a user