Browse Source

优化-运营商结算 结算方案优化

zhouxin 1 year ago
parent
commit
c3ea7f9075

+ 3 - 1
superdesk-uniorder-dao/src/main/resources/mappers/unified/settlement/UnifiedSettlementProgrammeMapperEx.xml

@@ -29,7 +29,9 @@
         <if test="programmeNo !=null and programmeNo !=''">
             and t.programme_no=#{programmeNo}
         </if>
-
+        <if test="customerId !=null and customerId !=''">
+            and t.customer_id =#{customerId}
+        </if>
 
 
         ORDER BY t.update_time

+ 1 - 0
superdesk-uniorder-dto/src/main/java/cn/superdesk/uniorder/dto/param/operationCenter/customer/OperationCenterCustomerParam.java

@@ -29,5 +29,6 @@ public class OperationCenterCustomerParam implements Serializable {
     //客户管理-结算方案
     private String programmeName;//方案名称
     private String programmeNo;//方案编号
+    private Long customerId;//客户id
 
 }

+ 5 - 0
superdesk-uniorder-dto/src/main/java/cn/superdesk/uniorder/dto/param/operationCenter/customer/settlement/UnifiedSettlementParam.java

@@ -53,4 +53,9 @@ public class UnifiedSettlementParam extends SettlementExportFieldVo implements S
     private String remark;
     //状态
     private Integer enabled;
+
+
+    //删除入参
+    private String deleteIds;
+
 }

+ 3 - 3
superdesk-uniorder-dubbo-facade/src/main/java/cn/superdesk/uniorder/dubbo/facade/unified/settlement/DubboUnifiedSettlementProgrammeService.java

@@ -20,9 +20,9 @@ public interface DubboUnifiedSettlementProgrammeService {
 
     R<UnifiedSettlementParam> get(Long id);
 
-    R<String> delete(Long id);
+    R<String> delete(String ids,Long userId);
 
-    R<String> enabled(Long id);
+    R<String> enabled(Long id,Long userId);
 
-    R<String> setDefault(Long id);
+    R<String> setDefault(Long id,Long userId);
 }

+ 12 - 5
superdesk-uniorder-dubbo-provider/src/main/java/cn/superdesk/uniorder/dubbo/provider/unified/settlement/DubboUnifiedSettlementProgrammeServiceImpl.java

@@ -14,6 +14,8 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -58,13 +60,16 @@ public class DubboUnifiedSettlementProgrammeServiceImpl implements DubboUnifiedS
     }
 
     @Override
-    public R<String> delete(Long id) {
-        unifiedSettlementProgrammeService.deleteObj(id);
+    public R<String> delete(String ids,Long userId) {
+        //unifiedSettlementProgrammeService.deleteObj(ids);
+
+        List<Long> idsList = Arrays.stream(ids.split(",")).map(x -> Long.parseLong(x)).collect(Collectors.toList());
+        unifiedSettlementProgrammeService.deleteByIds(idsList,userId);
         return new R<>("删除成功!");
     }
 
     @Override
-    public R<String> enabled(Long id) {
+    public R<String> enabled(Long id,Long userId) {
 
         UnifiedSettlementProgramme entity = unifiedSettlementProgrammeService.findById(id);
         if (null == entity) {
@@ -74,14 +79,16 @@ public class DubboUnifiedSettlementProgrammeServiceImpl implements DubboUnifiedS
         entity = new UnifiedSettlementProgramme();
         entity.setId(id);
         entity.setEnabled(enabled == 0 ? 1 : 0);
+        entity.setUpdateUserId(userId);
+        entity.setUpdateTime(new Date());
         unifiedSettlementProgrammeService.updateByPrimaryKeySelective(entity);
         String massage = entity.getEnabled() == 1 ? "启用成功!" : "停用成功!";
         return new R<>(massage);
     }
 
     @Override
-    public R<String> setDefault(Long id) {
-        return unifiedSettlementProgrammeService.setDefault(id);
+    public R<String> setDefault(Long id,Long userId) {
+        return unifiedSettlementProgrammeService.setDefault(id,userId);
     }
 
 }

+ 3 - 1
superdesk-uniorder-service/src/main/java/cn/superdesk/uniorder/service/unified/settlement/UnifiedSettlementProgrammeService.java

@@ -19,5 +19,7 @@ public interface UnifiedSettlementProgrammeService extends BaseService<UnifiedSe
 
     R<UnifiedSettlementParam> get(Long id);
 
-    R<String> setDefault(Long id);
+    R<String> setDefault(Long id,Long userId);
+
+    void deleteByIds(List<Long> idsList,Long userId);
 }

+ 13 - 1
superdesk-uniorder-service/src/main/java/cn/superdesk/uniorder/service/unified/settlement/impl/UnifiedSettlementProgrammeServiceImpl.java

@@ -335,7 +335,7 @@ public class UnifiedSettlementProgrammeServiceImpl implements UnifiedSettlementP
     }
 
     @Override
-    public R<String> setDefault(Long id) {
+    public R<String> setDefault(Long id,Long userId) {
         UnifiedSettlementProgrammeExample example = new UnifiedSettlementProgrammeExample();
         example.createCriteria().andDeletedEqualTo((byte) 0)
                 .andIdEqualTo(id);
@@ -348,9 +348,21 @@ public class UnifiedSettlementProgrammeServiceImpl implements UnifiedSettlementP
         UnifiedSettlementProgramme entity = new UnifiedSettlementProgramme();
         entity.setId(id);
         entity.setIsDefault(isDefault == 1 ? 0 : 1);
+        entity.setUpdateUserId(userId);
+        entity.setUpdateTime(new Date());
         unifiedSettlementProgrammeMapper.updateByPrimaryKeySelective(entity);
         String message = entity.getIsDefault() == 1 ? "设为默认成功!" : "取消默认成功!";
         return new R<>(message);
     }
 
+    @Override
+    public void deleteByIds(List<Long> idsList,Long userId) {
+        UnifiedSettlementProgrammeExample example = new UnifiedSettlementProgrammeExample();
+        example.createCriteria().andIdIn(idsList);
+        UnifiedSettlementProgramme record = new UnifiedSettlementProgramme();
+        record.setDeleted(1);
+        record.setUpdateUserId(userId);
+        record.setUpdateTime(new Date());
+        unifiedSettlementProgrammeMapper.updateByExampleSelective(record, example);
+    }
 }

+ 6 - 6
superdesk-uniorder-web/src/main/java/cn/superdesk/uniorder/controller/operationCenter/customer/UnifiedSettlementController.java

@@ -70,10 +70,10 @@ public class UnifiedSettlementController extends BaseController {
     /**
      * 删除
      */
-    @PostMapping("/delete/{id}")
-    public R<String> delete(@PathVariable("id") Long id) {
-        log.info("运营中心--客户管理-结算方案-根据id软删除客户信息--->入参:id:{}", id);
-        return unifiedSettlementDubboService.delete(id);
+    @PostMapping("/delete")
+    public R<String> delete(@RequestBody UnifiedSettlementParam param) {
+        log.info("运营中心--客户管理-结算方案-根据ids软删除客户信息--->入参:ids:{}", param.getDeleteIds());
+        return unifiedSettlementDubboService.delete(param.getDeleteIds(),getToken());
 
     }
     /**
@@ -82,7 +82,7 @@ public class UnifiedSettlementController extends BaseController {
     @PostMapping("/enabled/{id}")
     public R<String> enabled(@PathVariable("id") Long id) {
         log.info("运营中心--客户管理-结算方案-根据id启用/禁用--->入参:id:{}", id);
-        return unifiedSettlementDubboService.enabled(id);
+        return unifiedSettlementDubboService.enabled(id,getToken());
 
     }
 
@@ -92,7 +92,7 @@ public class UnifiedSettlementController extends BaseController {
     @PostMapping("/default/{id}")
     public R<String> setDefault(@PathVariable("id") Long id) {
         log.info("运营中心--客户管理-结算方案-根据id 设为默认/取消默认--->入参:id:{}", id);
-        return unifiedSettlementDubboService.setDefault(id);
+        return unifiedSettlementDubboService.setDefault(id,getToken());
 
     }
 

+ 9 - 6
superdesk-uniorder-web/src/main/java/cn/superdesk/uniorder/dubbo/consumer/operationCenter/customer/UnifiedSettlementDubboService.java

@@ -44,15 +44,18 @@ public class UnifiedSettlementDubboService {
         return dubboUnifiedSettlementProgrammeService.get(id);
     }
 
-    public R<String> delete(Long id) {
-        return dubboUnifiedSettlementProgrammeService.delete(id);
+    public R<String> delete(String ids,String token) {
+        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
+        return dubboUnifiedSettlementProgrammeService.delete(ids,loginSysUser.getSysUserId());
     }
 
-    public R<String> enabled(Long id) {
-        return dubboUnifiedSettlementProgrammeService.enabled(id);
+    public R<String> enabled(Long id,String token) {
+        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
+        return dubboUnifiedSettlementProgrammeService.enabled(id,loginSysUser.getSysUserId());
     }
 
-    public R<String> setDefault(Long id) {
-        return dubboUnifiedSettlementProgrammeService.setDefault(id);
+    public R<String> setDefault(Long id,String token) {
+        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
+        return dubboUnifiedSettlementProgrammeService.setDefault(id,loginSysUser.getSysUserId());
     }
 }