Browse Source

no message

FengChaoYu 9 months ago
parent
commit
aac2088d6c

+ 0 - 6
mall-server-api/src/main/java/com/gree/mall/manager/bean/material/base/WebsitGoodsPVO.java

@@ -69,12 +69,6 @@ public class WebsitGoodsPVO {
     @ApiModelProperty(value = "自有库存商户分账金额(商户分账比例)")
     private BigDecimal selfWebsitAmount;
 
-    @ApiModelProperty(value = "外购库存师傅分账金额")
-    private BigDecimal outWorkerAmount;
-
-    @ApiModelProperty(value = "外购库存商户分账金额")
-    private BigDecimal outWebsitAmount;
-
     @ApiModelProperty(value = "创建人")
     private String createBy;
 

+ 0 - 6
mall-server-api/src/main/java/com/gree/mall/manager/bean/material/base/WebsitNormChargeVO.java

@@ -62,12 +62,6 @@ public class WebsitNormChargeVO {
     @ApiModelProperty(value = "自有库存商户分账金额")
     private BigDecimal selfWebsitAmount;
 
-    @ApiModelProperty(value = "自有库存师傅分账金额")
-    private BigDecimal outWorkerAmount;
-
-    @ApiModelProperty(value = "自有库存商户分账金额")
-    private BigDecimal outWebsitAmount;
-
     @ApiModelProperty(value = "师傅手工费用")
     private BigDecimal manualAmount;
 

+ 10 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/material/manage/WebsitSalesController.java

@@ -284,4 +284,14 @@ public class WebsitSalesController {
         ImportResultBean bean = websitSalesLogic.queryImportResult(importBatchId);
         return ResponseHelper.success(bean);
     }
+
+    @PostMapping("/test/refund")
+    @ApiOperation(value = "网点销售订单-测试退款")
+    public ResponseHelper<PayDetail> testRefund(
+            @ApiParam(value = "salesId单号", required = true) @RequestParam String salesId,
+            HttpServletRequest request
+    ) throws Exception {
+        websitSalesLogic.testRefund(salesId, request);
+        return ResponseHelper.success();
+    }
 }

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/common/AllInPayLogic.java

@@ -115,7 +115,7 @@ public class AllInPayLogic {
         reqMap.put("trxamt", (int) ArithUtils.mul(refundValue.doubleValue(), 100) + ""); // 退款金额 单位:分
         reqMap.put("reqsn", StringUtils.isNotBlank(refundOrderId) ? refundOrderId : LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"))); // 商户的退款订单号
         reqMap.put("oldreqsn", order.getOutTradeNo()); // 原交易的商户订单号
-        reqMap.put("oldtrxid", order.getOrderNo()); // 原交易的收银宝平台流水
+        reqMap.put("trxid", order.getOrderNo()); // 原交易的收银宝平台流水
 
         HashMap<String, String> heads = new HashMap();
         String token = commonLogic.getInfToken();

+ 7 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/manage/WebsitSalesLogic.java

@@ -1246,4 +1246,11 @@ public class WebsitSalesLogic {
         return bean;
     }
 
+    public void testRefund(String salesId, HttpServletRequest request) {
+        final WebsitSalesPayOrder payOrder = websitSalesPayOrderService.lambdaQuery()
+                .eq(WebsitSalesPayOrder::getPayFlag, IsYesNoEnum.YES.getKey())
+                .eq(WebsitSalesPayOrder::getOrderId, salesId)
+                .one();
+        allInPayLogic.serviceRefundOrder(payOrder, null, payOrder.getPayValue());
+    }
 }

+ 33 - 28
mall-server-api/src/main/java/com/gree/mall/manager/logic/order/PunishOrderLogic.java

@@ -34,6 +34,7 @@ import java.util.stream.Collectors;
 
 /**
  * 处罚单
+ *
  * @author :lijh
  * @description:TODO
  * @date :2024/2/29 12:52
@@ -51,11 +52,12 @@ public class PunishOrderLogic {
 
     /**
      * 处罚工单列表
+     *
      * @param zfireParamBean
      * @return
      */
-    public IPage<PunishOrderVO> list(ExamineZfireParamBean zfireParamBean){
-        FieldUtils.supplyParam(zfireParamBean,PunishOrderVO.class,commonLogic.getAdminUser());
+    public IPage<PunishOrderVO> list(ExamineZfireParamBean zfireParamBean) {
+        FieldUtils.supplyParam(zfireParamBean, PunishOrderVO.class, commonLogic.getAdminUser());
         IPage<PunishOrderVO> page = commonMapper.punishOrderList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
         return page;
     }
@@ -65,23 +67,23 @@ public class PunishOrderLogic {
      * 保存处罚工单
      */
     @Transactional
-    public void save(PunishOrderBean punishOrderBean){
+    public void save(PunishOrderBean punishOrderBean) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
-        if(CollectionUtils.isEmpty(punishOrderBean.getPunishOrderProducts())){
+        if (CollectionUtils.isEmpty(punishOrderBean.getPunishOrderProducts())) {
             throw new RemoteServiceException("产品信息不能为空");
         }
-        if(CollectionUtils.isEmpty(punishOrderBean.getPunishOrderWorkers())){
+        if (CollectionUtils.isEmpty(punishOrderBean.getPunishOrderWorkers())) {
             throw new RemoteServiceException("处罚工程师信息不能为空");
         }
-        if(StringUtils.isNotBlank(punishOrderBean.getId())){
+        if (StringUtils.isNotBlank(punishOrderBean.getId())) {
             PunishOrder old = punishOrderService.getById(punishOrderBean.getId());
-            if(!StringUtils.equals(old.getStatus(),ExamineStatusEnum.SAVE.getKey())){
+            if (!StringUtils.equals(old.getStatus(), ExamineStatusEnum.SAVE.getKey())) {
                 throw new RemoteServiceException("非保存状态不可编辑");
             }
-        }else{
+        } else {
             List<String> insideCodes = punishOrderBean.getPunishOrderProducts().stream().map(PunishOrderProduct::getInsideCode).collect(Collectors.toList());
             List<String> outCodes = punishOrderBean.getPunishOrderProducts().stream().map(PunishOrderProduct::getOutCode).collect(Collectors.toList());
-            if(!CollectionUtils.isEmpty(insideCodes)) {
+            if (!CollectionUtils.isEmpty(insideCodes)) {
                 //检查条码是否已存在
                 Integer count = punishOrderProductService.lambdaQuery()
                         .in(PunishOrderProduct::getInsideCode, insideCodes)
@@ -90,7 +92,7 @@ public class PunishOrderLogic {
                     throw new RemoteServiceException("内机条码已存在");
                 }
             }
-            if(!CollectionUtils.isEmpty(outCodes)) {
+            if (!CollectionUtils.isEmpty(outCodes)) {
                 //检查条码是否已存在
                 Integer count = punishOrderProductService.lambdaQuery()
                         .in(PunishOrderProduct::getOutCode, outCodes)
@@ -101,7 +103,7 @@ public class PunishOrderLogic {
             }
         }
         long count = punishOrderBean.getPunishOrderWorkers().stream().filter(v -> v.getAmount() == null || v.getAmount().doubleValue() < 0).count();
-        if(count > 0){
+        if (count > 0) {
             throw new RemoteServiceException("处罚金额不能为空或小于0");
         }
         //总处罚金额
@@ -112,7 +114,7 @@ public class PunishOrderLogic {
         punishOrderBean.setCompanyWechatName(adminUser.getCompanyName());
         punishOrderService.saveOrUpdate(punishOrderBean);
         //产品信息
-        punishOrderProductService.lambdaUpdate().eq(PunishOrderProduct::getPunishOrderId,punishOrderBean.getId()).remove();
+        punishOrderProductService.lambdaUpdate().eq(PunishOrderProduct::getPunishOrderId, punishOrderBean.getId()).remove();
         punishOrderBean.getPunishOrderProducts().forEach(v -> v
                 .setPunishOrderId(punishOrderBean.getId())
                 .setCompanyWechatId(adminUser.getCompanyWechatId())
@@ -120,7 +122,7 @@ public class PunishOrderLogic {
         );
         punishOrderProductService.saveBatch(punishOrderBean.getPunishOrderProducts());
         //处罚的工程师信息
-        punishOrderWorkerService.lambdaUpdate().eq(PunishOrderWorker::getPunishOrderId,punishOrderBean.getId()).remove();
+        punishOrderWorkerService.lambdaUpdate().eq(PunishOrderWorker::getPunishOrderId, punishOrderBean.getId()).remove();
         punishOrderBean.getPunishOrderWorkers().forEach(v -> v
                 .setPunishOrderId(punishOrderBean.getId())
                 .setCompanyWechatId(adminUser.getCompanyWechatId())
@@ -132,43 +134,46 @@ public class PunishOrderLogic {
 
     /**
      * 详情
+     *
      * @param id
      * @return
      */
-    public PunishOrderBean detail(String id){
+    public PunishOrderBean detail(String id) {
         PunishOrder punishOrder = punishOrderService.getById(id);
         PunishOrderBean punishOrderBean = BeanUtil.copyProperties(punishOrder, PunishOrderBean.class);
         //产品信息
-        punishOrderBean.setPunishOrderProducts(punishOrderProductService.lambdaQuery().eq(PunishOrderProduct::getPunishOrderId,id).list());
+        punishOrderBean.setPunishOrderProducts(punishOrderProductService.lambdaQuery().eq(PunishOrderProduct::getPunishOrderId, id).list());
         //处罚的工程师信息
-        punishOrderBean.setPunishOrderWorkers(punishOrderWorkerService.lambdaQuery().eq(PunishOrderWorker::getPunishOrderId,id).list());
+        punishOrderBean.setPunishOrderWorkers(punishOrderWorkerService.lambdaQuery().eq(PunishOrderWorker::getPunishOrderId, id).list());
         return punishOrderBean;
     }
 
 
     /**
      * 删除
+     *
      * @param id
      */
     @Transactional
-    public void delete(String id){
-        punishOrderService.lambdaUpdate().eq(PunishOrder::getId,id).remove();
-        punishOrderProductService.lambdaUpdate().eq(PunishOrderProduct::getPunishOrderId,id).remove();
-        punishOrderWorkerService.lambdaUpdate().eq(PunishOrderWorker::getPunishOrderId,id).remove();
+    public void delete(String id) {
+        punishOrderService.lambdaUpdate().eq(PunishOrder::getId, id).remove();
+        punishOrderProductService.lambdaUpdate().eq(PunishOrderProduct::getPunishOrderId, id).remove();
+        punishOrderWorkerService.lambdaUpdate().eq(PunishOrderWorker::getPunishOrderId, id).remove();
     }
 
     /**
      * 审批
+     *
      * @param id
      * @param examineStatus
      * @param examineRemark
      */
     @Transactional
-    public void examine(String id, ExamineStatusEnum examineStatus,String examineRemark){
+    public void examine(String id, ExamineStatusEnum examineStatus, String examineRemark) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
         PunishOrder punishOrder = punishOrderService.getById(id);
         List<PunishOrderWorker> punishOrderWorkers = punishOrderWorkerService.lambdaQuery().eq(PunishOrderWorker::getPunishOrderId, id).list();
-        if(!punishOrder.getStatus().equals(ExamineStatusEnum.SAVE.getKey())){
+        if (!punishOrder.getStatus().equals(ExamineStatusEnum.SAVE.getKey())) {
             throw new RemoteServiceException("非已保存状态不可审批");
         }
         punishOrder.setStatus(examineStatus.getKey());
@@ -177,15 +182,15 @@ public class PunishOrderLogic {
         punishOrder.setExamineTime(new Date());
         punishOrder.updateById();
 
-        if(!StringUtils.equals(examineStatus.getKey(),ExamineStatusEnum.OK.getKey())){
+        if (!StringUtils.equals(examineStatus.getKey(), ExamineStatusEnum.OK.getKey())) {
             return;
         }
         PgOrderBase orderBase = pgOrderBaseService.getById(punishOrder.getOrderBaseId());
 
         //处罚记录(处罚)
-        for(PunishOrderWorker punishOrderWorker : punishOrderWorkers) {
+        for (PunishOrderWorker punishOrderWorker : punishOrderWorkers) {
             // 插入结算单
-            PgSettleOrder order = converPgSettleOrder(punishOrder,orderBase);
+            PgSettleOrder order = converPgSettleOrder(punishOrder, orderBase);
             order.setWorkerName(punishOrderWorker.getWorkerName());
             order.setWorkerMobile(punishOrderWorker.getWorkerMobile());
             order.setWorkerIdcard("");
@@ -197,7 +202,7 @@ public class PunishOrderLogic {
         }
 
         //处置记录(奖励)
-        if(StringUtils.isNotBlank(punishOrder.getDisposeWorkerName())) {
+        if (StringUtils.isNotBlank(punishOrder.getDisposeWorkerName())) {
             PgSettleOrder order2 = converPgSettleOrder(punishOrder, orderBase);
             order2.setWorkerName(punishOrder.getDisposeWorkerName());
             order2.setWorkerMobile(punishOrder.getDisposeWorkerMobile());
@@ -210,7 +215,7 @@ public class PunishOrderLogic {
     }
 
 
-    public PgSettleOrder converPgSettleOrder(PunishOrder punishOrder,PgOrderBase orderBase){
+    public PgSettleOrder converPgSettleOrder(PunishOrder punishOrder, PgOrderBase orderBase) {
         PgSettleOrder order = new PgSettleOrder();
         order.setCompanyWechatId(punishOrder.getCompanyWechatId());
         order.setCompanyWechatName(punishOrder.getCompanyWechatName());
@@ -227,7 +232,7 @@ public class PunishOrderLogic {
         order.setOrderSmallTypeText(punishOrder.getOrderSmallTypeText());
         order.setRemark(punishOrder.getRemark());
         order.setPunishOrderId(punishOrder.getId());
-        if(orderBase != null){
+        if (orderBase != null) {
             order.setOrderCreateTime(orderBase.getCreateTime());
             order.setWorkerEndTime(orderBase.getOverTime());
             order.setOrderSource(orderBase.getSource());

+ 6 - 0
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -785,6 +785,12 @@
         <if test="ex.examineStatus != null">
             and a.status = #{ex.examineStatus.key}
         </if>
+        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
+            AND a.websit_id IN
+            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="ex.orderBy == null or ex.orderBy ==''">
             ORDER BY a.create_time DESC
         </if>