Преглед изворни кода

Merge branch 'master' of http://120.78.198.155:10080/zhangjunqiang/fire

 Conflicts:
	modules/admin/src/main/java/com/fire/admin/service/impl/BankCardServiceImpl.java
	modules/admin/src/main/java/com/fire/admin/service/impl/SupplierServiceImpl.java
杨六六 пре 4 година
родитељ
комит
3ba0c4f971

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

@@ -24,7 +24,7 @@ import java.util.Date;
 public class BankCard {
 
     @ApiModelProperty("主键")
-    @TableId(value = "id",type = IdType.AUTO)
+    @TableId(type = IdType.AUTO)
     private Integer id;
 
     @ApiModelProperty("银行卡号")
@@ -36,8 +36,8 @@ public class BankCard {
     @ApiModelProperty("账户全称")
     private String account;
 
-    @ApiModelProperty("供应商id")
-    private Integer supplierId;
+    @ApiModelProperty("客户或者供应商的关联id")
+    private Integer relationId;
 
     @ApiModelProperty("创建者")
     private String creator;

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

@@ -31,8 +31,8 @@ public class ChannelInfo {
     @ApiModelProperty("通道id")
     private Long channelId;
 
-    @ApiModelProperty("供应商id")
-    private Integer supplierId;
+    @ApiModelProperty("客户或者供应商的关联id")
+    private Integer relationId;
 
     @ApiModelProperty("通道名称")
     private String channelName;

+ 2 - 2
common/fire-dto/src/main/java/com/fire/dto/ChannelSupplier.java

@@ -21,9 +21,9 @@ import java.util.List;
 @TableName("channel_supplier")
 public class ChannelSupplier {
 
-    @TableId(value = "supplier_id", type = IdType.AUTO)
+    @TableId(value = "relation_id", type = IdType.AUTO)
     @ApiModelProperty("供应商id")
-    private Integer supplierId;
+    private Integer relationId;
 
     @ApiModelProperty("供应商名称")
     private String supplierName;

+ 2 - 2
modules/admin/src/main/java/com/fire/admin/request/ChannelPageParam.java

@@ -20,8 +20,8 @@ public class ChannelPageParam extends Page {
     @ApiModelProperty("通道id")
     private Long channelId;
 
-    @ApiModelProperty("供应商id")
-    private Integer supplierId;
+    @ApiModelProperty("客户或者供应商的关联id")
+    private Integer relationId;
 
     @ApiModelProperty("通道名称")
     private String channelName;

+ 15 - 7
modules/admin/src/main/java/com/fire/admin/rest/ChannelGroupRest.java

@@ -7,12 +7,9 @@ import com.fire.dto.ChannelGroup;
 import com.fire.dto.response.BaseResponse;
 import com.fire.dto.response.BaseRestResponse;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author: admin
@@ -22,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
  */
 @Api(tags = "通道组相关接口")
 @RestController
-@RequestMapping("channelgroup")
+@RequestMapping("channelGroup")
 public class ChannelGroupRest {
 
     private ChannelGroupService channelGroupService;
@@ -44,12 +41,23 @@ public class ChannelGroupRest {
     }
 
     @PostMapping("/add")
-    @ApiModelProperty(value = "添加通道组", notes = "add_channel_group.py")
+    @ApiOperation(value = "添加通道组", notes = "add_channel_group.py")
     public BaseResponse saveChannelGroup(ChannelGroup channelGroup) {
         channelGroupService.addChannelGroup(channelGroup);
         return new BaseResponse();
     }
 
+    @PutMapping("/update")
+    @ApiOperation(value = "修改通道组", notes = "update_channel_group.py")
+    public BaseResponse updateChannelGroup(ChannelGroup channelGroup) {
+        channelGroupService.updateChannelGroupById(channelGroup);
+        return new BaseResponse();
+    }
 
-
+    @DeleteMapping("/delete/{channelGroupId}")
+    @ApiOperation(value = "删除通道组", notes = "delete_channel_group.py")
+    public BaseResponse removeChannelGroup(@PathVariable("channelGroupId") Long channelGroupId) {
+        channelGroupService.deleteChannelGroupById(channelGroupId);
+        return new BaseResponse();
+    }
 }

+ 12 - 0
modules/admin/src/main/java/com/fire/admin/rest/ChannelInfoRest.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.fire.admin.request.ChannelPageParam;
 import com.fire.admin.service.ChannelInfoService;
 import com.fire.dto.ChannelInfo;
+import com.fire.dto.ChannelSupplier;
 import com.fire.dto.FireProductInfo;
 import com.fire.dto.response.BaseResponse;
 import com.fire.dto.response.BaseRestResponse;
@@ -57,6 +58,17 @@ public class ChannelInfoRest {
         }
     }
 
+    @GetMapping("/supplierInfo")
+    @ApiModelProperty(value = "获取供应商信息", notes = "get_supplier_info.py")
+    public BaseRestResponse getSupplierInfo() {
+        List<ChannelSupplier> supplierList = channelInfoService.getSupplierInfo();
+        if (supplierList != null) {
+            return new BaseRestResponse(supplierList);
+        } else {
+            return new BaseRestResponse(null);
+        }
+    }
+
     @PostMapping("/add")
     @ApiOperation(value = "添加通道", notes = "add_channelInfo.py")
     public BaseResponse addChannelInfo(@RequestBody ChannelInfo channelInfo) {

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

@@ -52,7 +52,7 @@ public class ChannelSupplierRest {
     @PostMapping("/update")
     @ApiOperation(value = "修改供应商", notes = "supplier_update.py")
     public BaseResponse updateSupplierBySupplierId(@RequestBody ChannelSupplier channelSupplier) {
-        supplierService.updateSupplierBySupplierId(channelSupplier);
+        supplierService.updateSupplierByRelationId(channelSupplier);
         return new BaseResponse();
     }
 

+ 3 - 0
modules/admin/src/main/java/com/fire/admin/service/ChannelGroupService.java

@@ -17,4 +17,7 @@ public interface ChannelGroupService extends IService<ChannelGroup> {
 
     void addChannelGroup(ChannelGroup channelGroup);
 
+    void updateChannelGroupById(ChannelGroup channelGroup);
+
+    void deleteChannelGroupById(Long channelGroupId);
 }

+ 3 - 0
modules/admin/src/main/java/com/fire/admin/service/ChannelInfoService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fire.admin.request.ChannelPageParam;
 import com.fire.dto.ChannelInfo;
+import com.fire.dto.ChannelSupplier;
 import com.fire.dto.FireProductInfo;
 
 import java.util.List;
@@ -18,6 +19,8 @@ public interface ChannelInfoService extends IService<ChannelInfo> {
 
     IPage<ChannelInfo> getChannelList(ChannelPageParam channelPageParam);
 
+    List<ChannelSupplier> getSupplierInfo();
+
     List<FireProductInfo> getChannelProduct(Integer operator);
 
     void updateChannelInfoById(ChannelInfo channelInfo);

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

@@ -19,7 +19,7 @@ public interface SupplierService extends IService<ChannelSupplier> {
 
     List<ChannelSupplier> getSupplierInfo();
 
-    void updateSupplierBySupplierId(ChannelSupplier channelSupplier);
+    void updateSupplierByRelationId(ChannelSupplier channelSupplier);
 
     void saveSupplier(ChannelSupplier channelSupplier);
 

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

@@ -36,4 +36,20 @@ public class ChannelGroupServiceImpl extends ServiceImpl<ChannelGroupMapper, Cha
             baseMapper.insert(channelGroup);
         }
     }
+
+    @Override
+    public void updateChannelGroupById(ChannelGroup channelGroup) {
+        int result = baseMapper.updateById(channelGroup);
+        if (result > 0) {
+            // TODO: 2021/6/3 向MQ推送消息
+        }
+    }
+
+    @Override
+    public void deleteChannelGroupById(Long channelGroupId) {
+        int result = baseMapper.deleteById(channelGroupId);
+        if (result > 0) {
+            // TODO: 2021/6/3 向MQ推送消息
+        }
+    }
 }

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

@@ -13,6 +13,7 @@ import com.fire.admin.service.ChannelProductService;
 import com.fire.admin.service.SupplierService;
 import com.fire.common.exception.BaseException;
 import com.fire.dto.ChannelInfo;
+import com.fire.dto.ChannelSupplier;
 import com.fire.dto.FireProductInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -42,7 +43,7 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
     public IPage<ChannelInfo> getChannelList(ChannelPageParam channelPageParam) {
         LambdaQueryWrapper<ChannelInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(channelPageParam.getChannelId() != null, ChannelInfo::getChannelId, channelPageParam.getChannelId())
-                .eq(channelPageParam.getSupplierId() != null, ChannelInfo::getSupplierId, channelPageParam.getSupplierId())
+                .eq(channelPageParam.getRelationId() != null, ChannelInfo::getRelationId, channelPageParam.getRelationId())
                 .like(channelPageParam.getChannelName() != null, ChannelInfo::getChannelName, channelPageParam.getChannelName())
                 .eq(ChannelInfo::getIsDelete, 0);
         IPage<ChannelInfo> channelInfoList = baseMapper.selectPage(channelPageParam, lambdaQueryWrapper);
@@ -56,6 +57,11 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
         }
     }
 
+    @Override
+    public List<ChannelSupplier> getSupplierInfo() {
+        return supplierService.getSupplierInfo();
+    }
+
     @Override
     public List<FireProductInfo> getChannelProduct(Integer operator) {
         List<FireProductInfo> fireProductInfos = new LambdaQueryChainWrapper<>(fireProductMapper).eq(operator != null, FireProductInfo::getOperator, operator).list();
@@ -89,6 +95,7 @@ public class ChannelInfoServiceImpl extends ServiceImpl<ChannelInfoMapper, Chann
         if (result > 0) {
             // TODO: 2021/5/24 向MQ推送消息
         }
+
     }
 
     @Override