Explorar o código

修改遗漏id

杜魏 %!s(int64=4) %!d(string=hai) anos
pai
achega
5b97080d71

+ 1 - 1
common/fire-dto/src/main/java/com/fire/dto/BankCard.java

@@ -36,7 +36,7 @@ public class BankCard {
     private String account;
 
     @ApiModelProperty("客户或者供应商的关联id")
-    private Integer relationId;
+    private Long relationId;
 
     @ApiModelProperty("创建者")
     private String creator;

+ 1 - 1
common/fire-dto/src/main/java/com/fire/dto/ChannelInfo.java

@@ -32,7 +32,7 @@ public class ChannelInfo {
     private Long channelId;
 
     @ApiModelProperty("供应商id")
-    private Integer supplierId;
+    private Long supplierId;
 
     @ApiModelProperty("通道名称")
     private String channelName;

+ 1 - 1
common/fire-dto/src/main/java/com/fire/dto/DistributeGroup.java

@@ -23,7 +23,7 @@ import java.util.List;
 @TableName("distribute_group")
 public class DistributeGroup {
 
-    @TableId(type = IdType.INPUT)
+    @TableId(value = "distribute_group_id", type = IdType.INPUT)
     @ApiModelProperty("主键")
     private Long distributeGroupId;
 

+ 1 - 1
modules/admin/src/main/java/com/fire/admin/rest/BankCardRest.java

@@ -59,7 +59,7 @@ public class BankCardRest {
 
     @DeleteMapping("/delete/{bankId}")
     @ApiOperation(value = "删除银行卡", notes = "delete_bank_card.py")
-    public BaseResponse delete(@PathVariable("bankId") Integer bankId) {
+    public BaseResponse delete(@PathVariable("bankId") Long bankId) {
         bankCardService.deleteBankCards(bankId);
         return new BaseResponse();
     }

+ 1 - 1
modules/admin/src/main/java/com/fire/admin/rest/ChannelSupplierRest.java

@@ -58,7 +58,7 @@ public class ChannelSupplierRest {
 
     @DeleteMapping("/delete/{supplierId}")
     @ApiOperation(value = "删除供应商", notes = "supplier_delete.py")
-    public BaseResponse deleteSupplierBySupplierId(@PathVariable("supplierId") Integer supplierId) {
+    public BaseResponse deleteSupplierBySupplierId(@PathVariable("supplierId") Long supplierId) {
         try {
             supplierService.deleteSupplierById(supplierId);
         } catch (Exception e) {

+ 1 - 1
modules/admin/src/main/java/com/fire/admin/service/BankCardService.java

@@ -24,6 +24,6 @@ public interface BankCardService extends IService<BankCard> {
 
     void saveBankCards(List<BankCard> bankCards);
 
-    void deleteBankCards(Integer id);
+    void deleteBankCards(Long id);
 
 }

+ 2 - 2
modules/admin/src/main/java/com/fire/admin/service/SupplierService.java

@@ -23,8 +23,8 @@ public interface SupplierService extends IService<ChannelSupplier> {
 
     void saveSupplier(ChannelSupplier channelSupplier);
 
-    void deleteSupplierById(Integer id);
+    void deleteSupplierById(Long id);
 
-    void deleteBankCardById(Integer bankId);
+    void deleteBankCardById(Long bankId);
 
 }

+ 5 - 3
modules/admin/src/main/java/com/fire/admin/service/impl/BankCardServiceImpl.java

@@ -66,10 +66,12 @@ public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> i
     }
 
     @Override
-    public void deleteBankCards(Integer bankId) {
+    public void deleteBankCards(Long bankId) {
         if (bankId != null) {
-            baseMapper.deleteById(bankId);
-            log.info("编号为:【{}】的银行卡删除成功!", bankId);
+            int result = baseMapper.deleteById(bankId);
+            if (result > 0) {
+                log.info("编号为:【{}】的银行卡删除成功!", bankId);
+            }
         }
     }
 }

+ 3 - 3
modules/admin/src/main/java/com/fire/admin/service/impl/ChannelGroupServiceImpl.java

@@ -69,8 +69,8 @@ public class ChannelGroupServiceImpl extends ServiceImpl<ChannelGroupMapper, Cha
             int result = baseMapper.insert(channelGroup);
             if (result > 0) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+                log.info("添加的通道组是:【{}】", channelGroup);
             }
-            log.info("添加的通道组是:【{}】", channelGroup);
         } else {
             throw new BaseException(Status.PARAM_ERROR.status(), Status.PARAM_ERROR.message());
         }
@@ -84,8 +84,8 @@ public class ChannelGroupServiceImpl extends ServiceImpl<ChannelGroupMapper, Cha
             int result = baseMapper.updateById(channelGroup);
             if (result > 0) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+                log.info("通道组已修改为:【{}】", channelGroup);
             }
-            log.info("通道组已修改为:【{}】", channelGroup);
 
             if (ObjectUtil.isNotEmpty(channelGroup.getDistributeGroups())) {
                 distributeGroupService.saveDistributeGroups(channelGroup.getDistributeGroups());
@@ -102,8 +102,8 @@ public class ChannelGroupServiceImpl extends ServiceImpl<ChannelGroupMapper, Cha
             int result = baseMapper.deleteById(channelGroupId);
             if (result > 0) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+                log.info("编号为【{}】的通道组删除成功!", channelGroupId);
             }
-            log.info("编号为【{}】的通道组删除成功!", channelGroupId);
         } else {
             throw new BaseException(Status.PARAM_ERROR.status(), Status.PARAM_ERROR.message());
         }

+ 6 - 4
modules/admin/src/main/java/com/fire/admin/service/impl/ChannelInfoServiceImpl.java

@@ -89,8 +89,8 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
         int result = baseMapper.updateById(channelInfo);
         if (result > 0) {
             rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+            log.info("通道已修改为:【{}】", channelInfo);
         }
-        log.info("通道已修改为:【{}】", channelInfo);
         if (ObjectUtil.isNotEmpty(channelInfo.getChannelProductInfos())) {
             channelProductService.saveChannelProducts(channelInfo.getChannelProductInfos());
             log.info("添加的通道产品是:【{}】", channelInfo.getChannelProductInfos().toString());
@@ -100,14 +100,16 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
 
     @Override
     public void insertChannelInfo(ChannelInfo channelInfo) {
-        channelInfo.setChannelId(jedisCluster.incr(GLOBAL_ID_INCR.key()));
+        if (channelInfo.getChannelId() == null) {
+            channelInfo.setChannelId(jedisCluster.incr(GLOBAL_ID_INCR.key()));
+        }
         channelInfo.setCreator("admin");
         channelInfo.setCreateTime(new Date());
         int result = baseMapper.insert(channelInfo);
         if (result > 0) {
             rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+            log.info("添加的通道是:【{}】", channelInfo);
         }
-        log.info("添加的通道是:【{}】", channelInfo);
     }
 
     @Override
@@ -116,8 +118,8 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
             int result = baseMapper.deleteById(id);
             if (result > 0) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+                log.info("编号为:【{}】的通道删除成功!", id);
             }
-            log.info("编号为:【{}】的通道删除成功!", id);
         } else {
             throw new BaseException(Status.PARAM_ERROR.status(), Status.PARAM_ERROR.message());
         }

+ 3 - 2
modules/admin/src/main/java/com/fire/admin/service/impl/ChannelProductServiceImpl.java

@@ -55,8 +55,9 @@ public class ChannelProductServiceImpl extends ServiceImpl<ChannelProductMapper,
                     info.setChannelProductId(jedisCluster.incr(GLOBAL_ID_INCR.key()));
                 }
 
-                info.setDiscount(new BigDecimal(info.getPrice()).divide(new BigDecimal(info.getFacePrice()), 2, BigDecimal.ROUND_DOWN));
+                info.setDiscount(new BigDecimal(info.getPrice()).setScale(4, BigDecimal.ROUND_DOWN).divide(new BigDecimal(info.getFacePrice())));
             }
+
             boolean result = this.saveOrUpdateBatch(channelProductInfos);
             if (result) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
@@ -76,7 +77,7 @@ public class ChannelProductServiceImpl extends ServiceImpl<ChannelProductMapper,
         int result = baseMapper.deleteById(channelProductId);
         if (result > 0) {
             rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+            log.info("编号为:【{}】的通道产品删除成功!", channelProductId);
         }
-        log.info("编号为:【{}】的通道产品删除成功!", channelProductId);
     }
 }

+ 1 - 1
modules/admin/src/main/java/com/fire/admin/service/impl/CustomerServiceImpl.java

@@ -171,7 +171,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, CustomerInf
         List<BankCard> bankCards = customerDto.getBankCards();
         if (!bankCards.isEmpty()) {
             bankCards.forEach(cars -> {
-                cars.setRelationId(Integer.parseInt(String.valueOf(customerDto.getCustomerId())));
+                cars.setRelationId(Long.parseLong(String.valueOf(customerDto.getCustomerId())));
             });
 
             bankCardService.saveBankCards(customerDto.getBankCards());

+ 6 - 7
modules/admin/src/main/java/com/fire/admin/service/impl/SupplierServiceImpl.java

@@ -81,14 +81,14 @@ public class SupplierServiceImpl extends ServiceImpl<ChannelSupplierMapper, Chan
         int result = baseMapper.update(channelSupplier, lambdaUpdateWrapper);
         if (result > 0) {
             rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+            log.info("供应商已修改为:【{}】", channelSupplier);
         }
-        log.info("供应商已修改为:【{}】", channelSupplier);
         if (ObjectUtil.isNotEmpty(channelSupplier.getBankCards())) {
             /**
              把供应商编号写入添加的银行里面
              */
             channelSupplier.getBankCards().forEach(bankCard -> {
-                bankCard.setRelationId(channelSupplier.getSupplierId().intValue());
+                bankCard.setRelationId(channelSupplier.getSupplierId());
             });
 
             bankCardService.saveBankCards(channelSupplier.getBankCards());
@@ -104,25 +104,25 @@ public class SupplierServiceImpl extends ServiceImpl<ChannelSupplierMapper, Chan
         int result = baseMapper.insert(channelSupplier);
         if (result > 0) {
             rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+            log.info("添加的供应商是:【{}】", channelSupplier);
         }
-        log.info("添加的供应商是:【{}】", channelSupplier);
     }
 
     @Override
-    public void deleteSupplierById(Integer id) {
+    public void deleteSupplierById(Long id) {
         if (id != null) {
             int result = baseMapper.deleteById(id);
             if (result > 0) {
                 rocketMQTemplate.send(UPDATE_TOPIC + ":" + SUPPLIER_TAG, MessageBuilder.withPayload(SUPPLIER_TAG).build());
+                log.info("编号为:【{}】的供应商删除成功!", id);
             }
-            log.info("编号为:【{}】的供应商删除成功!", id);
         } else {
             throw new BaseException(Status.PARAM_ERROR.status(), Status.PARAM_ERROR.message());
         }
     }
 
     @Override
-    public void deleteBankCardById(Integer bankId) {
+    public void deleteBankCardById(Long bankId) {
         if (bankId != null) {
             Map<String, Object> map = new HashMap<>();
             map.put("id", bankId);
@@ -133,5 +133,4 @@ public class SupplierServiceImpl extends ServiceImpl<ChannelSupplierMapper, Chan
             throw new BaseException(Status.PARAM_ERROR.status(), Status.PARAM_ERROR.message());
         }
     }
-
 }

+ 6 - 0
modules/admin/src/main/java/com/fire/admin/util/PreUtil.java

@@ -8,6 +8,7 @@ import com.fire.dto.system.SysDept;
 import com.fire.dto.system.SysMenu;
 import lombok.experimental.UtilityClass;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -70,7 +71,12 @@ public class PreUtil {
                 list.add(menuVo);
             }
         });
+        list.forEach(li->{
+            System.out.println("li" + li.toString());
+        });
         return list;
+
+
     }