he2802 2 年之前
父節點
當前提交
734f1bd8d9
共有 16 個文件被更改,包括 107 次插入1 次删除
  1. 8 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstCategoryController.java
  2. 8 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java
  3. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderAddBo.java
  4. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputAddBo.java
  5. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputEditBo.java
  6. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputQueryBo.java
  7. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderQueryBo.java
  8. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java
  9. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopOldOrderQueryBo.java
  10. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  11. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstCategoryEditBo.java
  12. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstitutionQueryBo.java
  13. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstCategoryService.java
  14. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstitutionService.java
  15. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstCategoryServiceImpl.java
  16. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstitutionServiceImpl.java

+ 8 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstCategoryController.java

@@ -3,6 +3,7 @@ package com.zhongzheng.controller.top;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryQueryBo;
@@ -89,4 +90,11 @@ public class TopInstCategoryController extends BaseController {
         return toAjax(iTopInstCategoryService.updateByEditBo(bo) ? 1 : 0);
     }
 
+    @ApiOperation("供应商成本分类批量删除")
+    @PreAuthorize("@ss.hasPermi('system:tp:edit')")
+    @Log(title = "供应商成本分类批量删除", businessType = BusinessType.UPDATE)
+    @PostMapping("/deleteBatch")
+    public AjaxResult<Void> deleteBatch(@RequestBody TopInstCategoryEditBo bo) {
+        return toAjax(iTopInstCategoryService.deleteBatch(bo) ? 1 : 0);
+    }
 }

+ 8 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java

@@ -3,6 +3,7 @@ package com.zhongzheng.controller.top;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo;
@@ -88,5 +89,12 @@ public class TopInstitutionController extends BaseController {
         return toAjax(iTopInstitutionService.updateByEditBo(bo) ? 1 : 0);
     }
 
+    @ApiOperation("职能机构批量删除")
+    @PreAuthorize("@ss.hasPermi('system:tp:edit')")
+    @Log(title = "职能机构批量删除", businessType = BusinessType.UPDATE)
+    @PostMapping("/deleteBatch")
+    public AjaxResult<Void> deleteBatch(@RequestBody TopInstitutionQueryBo bo) {
+        return toAjax(iTopInstitutionService.deleteBatch(bo) ? 1 : 0);
+    }
 
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderAddBo.java

@@ -98,4 +98,11 @@ public class OrderAddBo {
     private String sellerName;
     @ApiModelProperty("底单:1新系统,2旧系统")
     private Integer orderBase;
+    /** 旧企业ID */
+    @ApiModelProperty("旧企业ID")
+    private String oldCompanyId;
+
+    /** 旧机构ID */
+    @ApiModelProperty("旧机构ID")
+    private String oldInstitutionId;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputAddBo.java

@@ -51,4 +51,5 @@ public class OrderInputAddBo {
     /** 录单来源 1普通录单 2新B端下单  3旧B端下单 */
     @ApiModelProperty("录单来源 1普通录单 2新B端下单  3旧B端下单")
     private Integer inputFrom;
+
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputEditBo.java

@@ -58,4 +58,5 @@ public class OrderInputEditBo {
     /** 录单来源 1普通录单 2新B端下单  3旧B端下单 */
     @ApiModelProperty("录单来源 1普通录单 2新B端下单  3旧B端下单")
     private Integer inputFrom;
+
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderInputQueryBo.java

@@ -76,4 +76,5 @@ public class OrderInputQueryBo extends BaseEntity {
 	/** 录单来源 1普通录单 2新B端下单  3旧B端下单 */
 	@ApiModelProperty("录单来源 1普通录单 2新B端下单  3旧B端下单")
 	private Integer inputFrom;
+
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderQueryBo.java

@@ -131,4 +131,11 @@ public class OrderQueryBo extends BaseEntity {
 
 	@ApiModelProperty("商品订单状态 -1关闭 0待支付 1已支付 2已退款")
 	private Integer orderGoodsStatus;
+	/** 旧企业ID */
+	@ApiModelProperty("旧企业ID")
+	private String oldCompanyId;
+
+	/** 旧机构ID */
+	@ApiModelProperty("旧机构ID")
+	private String oldInstitutionId;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java

@@ -175,5 +175,9 @@ private static final long serialVersionUID=1L;
     private BigDecimal divideSellerMoney;
     /** 分成审核状态 1正常 2待审核 3审核中  4审核不通过 5审核通过待支付 6已支付*/
     private Integer divideStatus;
+    /** 旧企业ID */
+    private String oldCompanyId;
+    /** 旧机构ID */
+    private String oldInstitutionId;
 
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopOldOrderQueryBo.java

@@ -141,6 +141,7 @@ public class TopOldOrderQueryBo extends BaseEntity {
 	private String createNo;
 	@ApiModelProperty("账单类型 (1月份 2季度 3半年 4年度)")
 	private Integer billType;
-
+	@ApiModelProperty("超收预期 (1:7天 2:30天 3:半年 4:1年 )")
+	private Integer billOverType;
 
 }

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -3553,6 +3553,20 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     badBillList.add(timeBo);
                 }
             }
+            for(TopBadBillTimeBo timeBo : badBillList){
+                if(Validator.isNotEmpty(bo.getBillOverType())&&bo.getBillOverType()==1){
+                    timeBo.setEndTime(timeBo.getEndTime()-7*24*3600);
+                }
+                else if(Validator.isNotEmpty(bo.getBillOverType())&&bo.getBillOverType()==2){
+                    timeBo.setEndTime(timeBo.getEndTime()-30*24*3600);
+                }
+                else if(Validator.isNotEmpty(bo.getBillOverType())&&bo.getBillOverType()==3){
+                    timeBo.setEndTime(timeBo.getEndTime()-182*24*3600);
+                }
+                else if(Validator.isNotEmpty(bo.getBillOverType())&&bo.getBillOverType()==4){
+                    timeBo.setEndTime(timeBo.getEndTime()-365*24*3600);
+                }
+            }
             bo.setBadBillList(badBillList);
         }
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstCategoryEditBo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -33,4 +34,6 @@ public class TopInstCategoryEditBo {
     @ApiModelProperty("修改时间")
     private Long updateTime;
 
+    private List<Long> costCatIds;
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/bo/TopInstitutionQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -51,4 +52,8 @@ public class TopInstitutionQueryBo extends BaseEntity {
 	/** 1正常 0关闭 */
 	@ApiModelProperty("1正常 0关闭")
 	private Integer status;
+	@ApiModelProperty("$column.columnComment")
+	private Long instId;
+	@ApiModelProperty("$column.columnComment")
+	private List<Long> instIds;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstCategoryService.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.top.system.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryQueryBo;
@@ -50,4 +51,6 @@ public interface ITopInstCategoryService extends IService<TopInstCategory> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	Boolean deleteBatch(TopInstCategoryEditBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/ITopInstitutionService.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.top.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo;
@@ -49,4 +50,6 @@ public interface ITopInstitutionService extends IService<TopInstitution> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	Boolean deleteBatch(TopInstitutionQueryBo queryBo);
 }

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstCategoryServiceImpl.java

@@ -5,6 +5,10 @@ import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.grade.domain.ClassGradeUser;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTp;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTpItem;
+import com.zhongzheng.modules.top.financial.service.ITopCostInstTpItemService;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryQueryBo;
@@ -13,6 +17,7 @@ import com.zhongzheng.modules.top.system.domain.TopInstitution;
 import com.zhongzheng.modules.top.system.mapper.TopInstCategoryMapper;
 import com.zhongzheng.modules.top.system.service.ITopInstCategoryService;
 import com.zhongzheng.modules.top.system.vo.TopInstCategoryVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -33,6 +38,9 @@ import java.util.stream.Collectors;
 @Service
 public class TopInstCategoryServiceImpl extends ServiceImpl<TopInstCategoryMapper, TopInstCategory> implements ITopInstCategoryService {
 
+    @Autowired
+    private ITopCostInstTpItemService iTopCostInstTpItemService;
+
     @Override
     public TopInstCategoryVo queryById(Long costCatId){
         TopInstCategory db = this.baseMapper.selectById(costCatId);
@@ -91,6 +99,11 @@ public class TopInstCategoryServiceImpl extends ServiceImpl<TopInstCategoryMappe
      */
     private void validEntityBeforeSave(TopInstCategory entity){
         //TODO 做一些数据校验,如唯一约束
+        if(iTopCostInstTpItemService.count(new LambdaQueryWrapper<TopCostInstTpItem>()
+                .eq(TopCostInstTpItem::getCostCatId, entity.getCostCatId())
+                .ne(TopCostInstTpItem::getStatus, -1))>0){
+            throw new CustomException("该分类已被使用,无法编辑和删除");
+        }
         if(checkNameUnique(entity)){
             throw new CustomException("名称重复");
         }
@@ -104,7 +117,21 @@ public class TopInstCategoryServiceImpl extends ServiceImpl<TopInstCategoryMappe
         return this.removeByIds(ids);
     }
 
+    @Override
+    public Boolean deleteBatch(TopInstCategoryEditBo bo) {
+        for(Long id : bo.getCostCatIds()){
+            TopInstCategory update = new TopInstCategory();
+            update.setCostCatId(id);
+            update.setStatus(-1);
+            this.updateById(update);
+        }
+        return true;
+    }
+
     private boolean checkNameUnique(TopInstCategory entity) {
+        if(Validator.isEmpty(entity.getCategoryName())){
+            return true;
+        }
         TopInstCategory info = getOne(new LambdaQueryWrapper<TopInstCategory>()
                 .eq(TopInstCategory::getCategoryName,entity.getCategoryName()).ne(TopInstCategory::getStatus,-1)
                 .last("limit 1"));

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstitutionServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.base.domain.Certificate;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTp;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo;
@@ -44,6 +45,7 @@ public class TopInstitutionServiceImpl extends ServiceImpl<TopInstitutionMapper,
         lqw.like(StrUtil.isNotBlank(bo.getInstName()), TopInstitution::getInstName, bo.getInstName());
         lqw.like(StrUtil.isNotBlank(bo.getBankName()), TopInstitution::getBankName, bo.getBankName());
         lqw.eq(StrUtil.isNotBlank(bo.getBank()), TopInstitution::getBank, bo.getBank());
+        lqw.eq(Validator.isNotEmpty(bo.getInstId()), TopInstitution::getInstId, bo.getInstId());
         lqw.eq(StrUtil.isNotBlank(bo.getBankAccount()), TopInstitution::getBankAccount, bo.getBankAccount());
         lqw.eq(bo.getStatus() != null, TopInstitution::getStatus, bo.getStatus());
         return entity2Vo(this.list(lqw));
@@ -106,6 +108,17 @@ public class TopInstitutionServiceImpl extends ServiceImpl<TopInstitutionMapper,
         return this.removeByIds(ids);
     }
 
+    @Override
+    public Boolean deleteBatch(TopInstitutionQueryBo queryBo) {
+        for(Long id : queryBo.getInstIds()){
+            TopInstitution update = new TopInstitution();
+            update.setInstId(id);
+            update.setStatus(-1);
+            this.updateById(update);
+        }
+        return true;
+    }
+
     private boolean checkNameUnique(TopInstitution entity) {
         TopInstitution info = getOne(new LambdaQueryWrapper<TopInstitution>()
                 .eq(TopInstitution::getInstName,entity.getInstName()).ne(TopInstitution::getStatus,-1)