Compare commits
15 Commits
656db661ab
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b3fb08036 | |||
| 484ffb07e5 | |||
| e9ef1b0fac | |||
| 04be17d63e | |||
| 21da0a344c | |||
| f8db70ca43 | |||
| bfff341d17 | |||
| f85ac0815b | |||
| 80fb367673 | |||
| 574c73d0b5 | |||
| cb18aa5670 | |||
| da3447cd0b | |||
| 9e946443ec | |||
| 71ffdede19 | |||
| 353404dde4 |
@@ -2,6 +2,8 @@ package com.czg.controller.admin;
|
|||||||
|
|
||||||
import com.czg.annotation.SaAdminCheckPermission;
|
import com.czg.annotation.SaAdminCheckPermission;
|
||||||
import com.czg.annotation.SaAdminCheckRole;
|
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.dto.ShopMerchantDTO;
|
||||||
import com.czg.order.entity.ShopDirectMerchant;
|
import com.czg.order.entity.ShopDirectMerchant;
|
||||||
import com.czg.order.service.ShopMerchantService;
|
import com.czg.order.service.ShopMerchantService;
|
||||||
@@ -44,6 +46,9 @@ public class ShopMerchantController {
|
|||||||
@SaAdminCheckPermission(parentName = "支付参数信息", value = "shopMerchant:edit", name = "商户支付信息修改")
|
@SaAdminCheckPermission(parentName = "支付参数信息", value = "shopMerchant:edit", name = "商户支付信息修改")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CzgResult<Boolean> edit(@RequestBody ShopMerchantDTO shopMerchant) {
|
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));
|
return CzgResult.success(shopMerchantService.editEntry(shopMerchant, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.czg.market.service;
|
package com.czg.market.service;
|
||||||
|
|
||||||
import com.czg.enums.ShopUserFlowBizEnum;
|
import com.czg.enums.ShopUserFlowBizEnum;
|
||||||
|
import com.czg.exception.CzgException;
|
||||||
import com.czg.market.dto.MkShopRechargeDTO;
|
import com.czg.market.dto.MkShopRechargeDTO;
|
||||||
import com.czg.market.vo.MkShopRechargeShopListVO;
|
import com.czg.market.vo.MkShopRechargeShopListVO;
|
||||||
import com.czg.market.vo.MkShopRechargeVO;
|
import com.czg.market.vo.MkShopRechargeVO;
|
||||||
@@ -21,7 +22,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface MkShopRechargeService extends IService<MkShopRecharge> {
|
public interface MkShopRechargeService extends IService<MkShopRecharge> {
|
||||||
|
|
||||||
MkShopRechargeVO detail(Long shopId);
|
MkShopRechargeVO detail(Long shopId) throws CzgException;
|
||||||
|
|
||||||
MkShopRechargeVO detailApp(Long shopId);
|
MkShopRechargeVO detailApp(Long shopId);
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class OrderPayment implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String tradeNumber;
|
private String tradeNumber;
|
||||||
|
|
||||||
@Column(onUpdateValue = "now()")
|
// @Column(onUpdateValue = "now()")
|
||||||
private LocalDateTime payTime;
|
private LocalDateTime payTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import java.time.LocalDateTime;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Table("tb_shop_merchant2")
|
@Table("tb_shop_merchant")
|
||||||
public class ShopMerchant implements Serializable {
|
public class ShopMerchant implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
|||||||
@@ -253,6 +253,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||||||
@Override
|
@Override
|
||||||
@CacheEvict(key = "#shopInfoEditDTO.id")
|
@CacheEvict(key = "#shopInfoEditDTO.id")
|
||||||
public Boolean edit(ShopInfoEditDTO shopInfoEditDTO) {
|
public Boolean edit(ShopInfoEditDTO shopInfoEditDTO) {
|
||||||
|
shopInfoEditDTO.setIsMemberPrice(null);
|
||||||
ShopInfo shopInfo;
|
ShopInfo shopInfo;
|
||||||
if (!StpKit.USER.isAdmin()) {
|
if (!StpKit.USER.isAdmin()) {
|
||||||
shopInfo = queryChain().eq(ShopInfo::getId, StpKit.USER.getShopId()).one();
|
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");
|
rabbitPublisher.sendOrderDetailStatusMsg(shopInfo.getId().toString(), "shopInfoUpdate");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ import com.czg.market.vo.InviteUserVO;
|
|||||||
import com.czg.market.vo.MkDistributionConfigVO;
|
import com.czg.market.vo.MkDistributionConfigVO;
|
||||||
import com.czg.order.dto.MkDistributionPayDTO;
|
import com.czg.order.dto.MkDistributionPayDTO;
|
||||||
import com.czg.order.entity.OrderInfo;
|
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.sa.StpKit;
|
||||||
import com.czg.service.market.enums.OrderStatusEnums;
|
import com.czg.service.market.enums.OrderStatusEnums;
|
||||||
import com.czg.service.market.mapper.MkDistributionUserMapper;
|
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()));
|
.ne(MkDistributionFlow::getStatus, TableValueConstant.DistributionFlow.Status.REFUND.getCode()));
|
||||||
|
|
||||||
list.forEach(item -> {
|
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())) {
|
if (TableValueConstant.DistributionFlow.Status.PENDING.getCode().equals(item.getStatus())) {
|
||||||
item.setStatus(TableValueConstant.DistributionFlow.Status.SUCCESS.getCode());
|
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
||||||
// updateIncome(item.getRewardAmount().negate(), BigDecimal.ZERO, BigDecimal.ZERO, item.getDistributionUserId(), item.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
|
|
||||||
distributionFlowService.updateById(item);
|
distributionFlowService.updateById(item);
|
||||||
|
mapper.updateIncome(item.getRewardAmount().negate(), null, null, item.getDistributionUserId(), item.getShopId());
|
||||||
} else {
|
} else {
|
||||||
// 执行扣款
|
// 执行扣款
|
||||||
updateIncome(BigDecimal.ZERO, item.getRewardAmount().negate(), BigDecimal.ZERO, item.getDistributionUserId(), item.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
|
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, "分销回退");
|
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);
|
distributionDeliverService.save(deliver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销金额修改
|
||||||
|
*
|
||||||
|
* @param pendingIncome 待入账金额
|
||||||
|
* @param receivedIncome 已入账
|
||||||
|
* @param withdrawIncome 已提现
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateIncome(BigDecimal pendingIncome, BigDecimal receivedIncome, BigDecimal withdrawIncome, Long id, Long userId, Long shopUserId, Long shopId, Integer isOne) {
|
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
|
@Override
|
||||||
public MkShopRechargeVO detail(Long shopId) {
|
public MkShopRechargeVO detail(Long shopId) throws CzgException{
|
||||||
shopId = shopInfoService.getMainIdByShopId(shopId);
|
shopId = shopInfoService.getMainIdByShopId(shopId);
|
||||||
ShopInfo shopInfo = shopInfoService.getById(shopId);
|
ShopInfo shopInfo = shopInfoService.getById(shopId);
|
||||||
if (shopInfo.getMainId() != null) {
|
if (shopInfo.getMainId() != null) {
|
||||||
|
|||||||
@@ -45,36 +45,33 @@
|
|||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="totalAmount" resultType="java.math.BigDecimal">
|
<select id="totalAmount" resultType="java.math.BigDecimal">
|
||||||
select sum(a.amount) from mk_distribution_flow as a
|
select sum(a.reward_amount)
|
||||||
left join mk_distribution_user as d on d.id=a.distribution_user_id
|
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 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}
|
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">
|
<if test="startTime != null">
|
||||||
and a.create_time>=#{startTime}
|
and a.create_time>=#{startTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="endTime != null">
|
<if test="endTime != null">
|
||||||
and a.create_time<=#{endTime}
|
and a.create_time<=#{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
|
||||||
and a.status=#{status}
|
|
||||||
</if>
|
|
||||||
<if test="key != null and key != ''">
|
<if test="key != null and key != ''">
|
||||||
and (
|
and (
|
||||||
b.nick_name like concat('%',#{key},'%')
|
b.nick_name like concat('%',#{key},'%')
|
||||||
or b.id like concat('%',#{key},'%')
|
or b.id like concat('%',#{key},'%')
|
||||||
or c.id like concat('%',#{key},'%')
|
|
||||||
or c.nick_name like concat('%',#{key},'%')
|
|
||||||
)
|
)
|
||||||
</if>
|
</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>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -5,16 +5,24 @@
|
|||||||
<mapper namespace="com.czg.service.market.mapper.MkDistributionUserMapper">
|
<mapper namespace="com.czg.service.market.mapper.MkDistributionUserMapper">
|
||||||
<update id="updateIncome">
|
<update id="updateIncome">
|
||||||
update mk_distribution_user
|
update mk_distribution_user
|
||||||
set
|
<set>
|
||||||
<if test="pendingIncome != null">
|
<if test="pendingIncome != null">
|
||||||
total_income = total_income + #{pendingIncome},
|
total_income = total_income + #{pendingIncome},
|
||||||
</if>
|
</if>
|
||||||
<if test="receivedIncome != null">
|
<if test="receivedIncome != null">
|
||||||
total_income = total_income + #{receivedIncome},
|
total_income = total_income + #{receivedIncome},
|
||||||
</if>
|
</if>
|
||||||
pending_income = pending_income + #{pendingIncome},
|
|
||||||
received_income = received_income + #{receivedIncome},
|
<if test="pendingIncome != null">
|
||||||
withdrawn_income = withdrawn_income + #{withdrawIncome}
|
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}
|
where id = #{id} and shop_id = #{shopId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public interface PrinterImpl {
|
|||||||
// data.append("<OUT:15>");
|
// data.append("<OUT:15>");
|
||||||
// data.append("<BR>");
|
// data.append("<BR>");
|
||||||
// 18个空格 12
|
// 18个空格 12
|
||||||
data.append(getFormatLabel("品名 数量 小计 ", signLabelInfo.s))
|
data.append(getFormatLabel("品名 数量 单价 ", signLabelInfo.s))
|
||||||
.append(signLabelInfo.br);
|
.append(signLabelInfo.br);
|
||||||
// data.append("<S>品名 数量 小计</S><BR>");
|
// data.append("<S>品名 数量 小计</S><BR>");
|
||||||
data.append(getFormatLabel("--------------------------------", signLabelInfo.s))
|
data.append(getFormatLabel("--------------------------------", signLabelInfo.s))
|
||||||
|
|||||||
Reference in New Issue
Block a user