renqianlong 1 năm trước cách đây
mục cha
commit
2d8a39e46e
18 tập tin đã thay đổi với 294 bổ sung111 xóa
  1. 150 17
      zhongzheng-admin-business/src/main/java/com/zhongzheng/controller/covenant/BsCovenantController.java
  2. 31 6
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/covenant/BsCovenantController.java
  3. 7 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantAddBo.java
  4. 6 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantEditBo.java
  5. 10 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantQueryBo.java
  6. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoAddBo.java
  7. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoEditBo.java
  8. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoQueryBo.java
  9. 5 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/BsCovenant.java
  10. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/TenantCovenantInfo.java
  11. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/IBsCovenantService.java
  12. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantBusinessServiceImpl.java
  13. 1 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantGoodsServiceImpl.java
  14. 48 50
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantServiceImpl.java
  15. 0 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantGoodsVo.java
  16. 10 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantVo.java
  17. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/TenantCovenantInfoVo.java
  18. 18 16
      zhongzheng-system/src/main/resources/mapper/modules/covenant/BsCovenantMapper.xml

+ 150 - 17
zhongzheng-admin-business/src/main/java/com/zhongzheng/controller/covenant/BsCovenantController.java

@@ -4,13 +4,20 @@ import java.net.URLEncoder;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.framework.web.service.BsTokenService;
+import com.zhongzheng.framework.web.service.TokenService;
+import com.zhongzheng.modules.bs.company.entity.ClientBsLoginUser;
 import com.zhongzheng.modules.bs.covenant.bo.BsCovenantAddBo;
 import com.zhongzheng.modules.bs.covenant.bo.BsCovenantEditBo;
 import com.zhongzheng.modules.bs.covenant.bo.BsCovenantQueryBo;
 import com.zhongzheng.modules.bs.covenant.service.IBsCovenantService;
 import com.zhongzheng.modules.bs.covenant.vo.BsCovenantVo;
+import com.zhongzheng.modules.bs.covenant.vo.NoCheckInfo;
+import com.zhongzheng.modules.records.vo.CovenantCheckRecordVo;
 import lombok.RequiredArgsConstructor;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,7 +35,7 @@ import javax.validation.Valid;
 
 /**
  * 企业协议Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-05-28
  */
@@ -39,28 +46,61 @@ import javax.validation.Valid;
 public class BsCovenantController extends BaseController {
 
     private final IBsCovenantService iBsCovenantService;
-
+    private final BsTokenService tokenService;
     /**
      * 查询企业协议列表
      */
-    @ApiOperation("查询企业协议列表")
-    @GetMapping("/list")
-    public TableDataInfo<BsCovenantVo> list(BsCovenantQueryBo bo) {
+    @ApiOperation("查询企业协议管理列表")
+    @GetMapping("/getCovenantList")
+    public TableDataInfo<BsCovenantVo> getCovenantList(BsCovenantQueryBo bo) {
         startPage();
+        bo.setListType(1);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
-
     /**
-     * 导出企业协议列表
+     * 查询企业协议列表
      */
-    @ApiOperation("导出企业协议列表")
-    @Log(title = "企业协议", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult<BsCovenantVo> export(BsCovenantQueryBo bo) {
+    @ApiOperation("查询终止管理协议列表")
+    @GetMapping("/getStopCovenantList")
+    public TableDataInfo<BsCovenantVo> getStopCovenantList(BsCovenantQueryBo bo) {
+        startPage();
+        bo.setListType(2);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
-        ExcelUtil<BsCovenantVo> util = new ExcelUtil<BsCovenantVo>(BsCovenantVo.class);
-        return util.exportExcel(list, "企业协议");
+        return getDataTable(list);
+    }
+    /**
+     * 查询企业协议列表
+     */
+    @ApiOperation("查询协议审核列表")
+    @GetMapping("/getCovenantCheckList")
+    public TableDataInfo<BsCovenantVo> getCovenantCheckList(BsCovenantQueryBo bo) {
+        startPage();
+        bo.setListType(3);
+        List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
+        return getDataTable(list);
+    }
+    /**
+     * 查询企业协议列表
+     */
+    @ApiOperation("查询终止审核列表")
+    @GetMapping("/getStopCheckList")
+    public TableDataInfo<BsCovenantVo> getStopCheckList(BsCovenantQueryBo bo) {
+        startPage();
+        bo.setListType(4);
+        List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
+        return getDataTable(list);
+    }
+    /**
+     * 查询企业协议列表
+     */
+    @ApiOperation("查询协议上传列表")
+    @GetMapping("/getCovenantUploadList")
+    public TableDataInfo<BsCovenantVo> getCovenantUploadList(BsCovenantQueryBo bo) {
+        startPage();
+        bo.setListType(5);
+        List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
+        return getDataTable(list);
     }
 
     /**
@@ -75,10 +115,12 @@ public class BsCovenantController extends BaseController {
     /**
      * 新增企业协议
      */
-    @ApiOperation("新增企业协议")
+    @ApiOperation("新增协议")
     @Log(title = "企业协议", businessType = BusinessType.INSERT)
     @PostMapping("/insert")
     public AjaxResult<Void> add(@RequestBody BsCovenantAddBo bo) {
+        ClientBsLoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
         return toAjax(iBsCovenantService.insertByAddBo(bo) ? 1 : 0);
     }
 
@@ -97,8 +139,8 @@ public class BsCovenantController extends BaseController {
      */
     @ApiOperation("协议取消")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
-    @PostMapping("/{covenantId}")
-    public AjaxResult<Void> remove(@PathVariable long covenantId) {
+    @PostMapping("/cancelStatus")
+    public AjaxResult<Void> cancelStatus(@RequestParam("covenantId") Long covenantId) {
         return toAjax(iBsCovenantService.deleteWithValidByIds(covenantId) ? 1 : 0);
     }
     /**
@@ -124,5 +166,96 @@ public class BsCovenantController extends BaseController {
     public AjaxResult download(@RequestParam("covenantId") Long covenantId) {
         return AjaxResult.success(iBsCovenantService.exportPdf(covenantId));
     }
-
+    @ApiOperation(value = "云学堂判断当前选择甲方是否存在待审核或者申请终止审核")
+    @GetMapping("/judgeExistYW")
+    public AjaxResult judgeExistYW(@RequestParam("companyId") Long companyId) {
+        return AjaxResult.success(iBsCovenantService.judgeExistYW(companyId));
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("终止申请")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/updateStopStatus")
+    public AjaxResult<Void> updateStopStatus(@RequestParam("covenantId") Long covenantId) {
+        return toAjax(iBsCovenantService.updateStopStatus(covenantId) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("取消终止申请")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/cancelStopStatus")
+    public AjaxResult<Void> cancelStopStatus(@RequestParam("covenantId") Long covenantId) {
+        return toAjax(iBsCovenantService.cancelStopStatus(covenantId) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("协议审核")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/updateCheckStatus")
+    public AjaxResult updateCheckStatus(@RequestBody NoCheckInfo noCheckInfo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        return toAjax(iBsCovenantService.updateCheckStatus(noCheckInfo,loginUser) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("终止审核")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/updateStopCheck")
+    public AjaxResult updateStopCheck(@RequestBody NoCheckInfo noCheckInfo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        return toAjax(iBsCovenantService.updateStopCheck(noCheckInfo,loginUser) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("协议上传")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/uploadImg")
+    public AjaxResult uploadImg(@RequestParam("covenantId") Long covenantId,@RequestParam("path") List<String> paths) {
+        return toAjax(iBsCovenantService.uploadImg(covenantId,paths) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("协议上传确认生效")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/confirmAssert")
+    public AjaxResult confirmAssert(@RequestParam("covenantId") Long covenantId) {
+        return toAjax(iBsCovenantService.confirmAssert(covenantId) ? 1 : 0);
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("统计协议审核待审核数量")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/countNoCheckNum")
+    public AjaxResult countNoCheckNum() {
+        return AjaxResult.success(iBsCovenantService.countNoCheckNum());
+    }
+    /**
+     * 删除企业协议
+     */
+    @ApiOperation("统计终止审核待审核数量")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/countStopNoCheckNum")
+    public AjaxResult countStopNoCheckNum() {
+        return AjaxResult.success(iBsCovenantService.countStopNoCheckNum());
+    }
+    @ApiOperation("统计协议上传数量")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @PostMapping("/countUploadImgNum")
+    public AjaxResult countUploadImgNum() {
+        return AjaxResult.success(iBsCovenantService.countUploadImgNum());
+    }
+    @ApiOperation("获取审核意见列表")
+    @Log(title = "企业协议" , businessType = BusinessType.DELETE)
+    @GetMapping("/getCheckInfo")
+    public TableDataInfo<CovenantCheckRecordVo> getCheckInfo(@RequestParam("covenantId") Long covenantId) {
+        return getDataTable(iBsCovenantService.getNoCheckInfo(covenantId));
+    }
 }
+

+ 31 - 6
zhongzheng-admin/src/main/java/com/zhongzheng/controller/covenant/BsCovenantController.java

@@ -47,6 +47,8 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<BsCovenantVo> getCovenantList(BsCovenantQueryBo bo) {
         startPage();
         bo.setListType(1);
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(1L);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
@@ -58,6 +60,8 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<BsCovenantVo> getStopCovenantList(BsCovenantQueryBo bo) {
         startPage();
         bo.setListType(2);
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(1L);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
@@ -69,6 +73,8 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<BsCovenantVo> getCovenantCheckList(BsCovenantQueryBo bo) {
         startPage();
         bo.setListType(3);
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(1L);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
@@ -80,6 +86,8 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<BsCovenantVo> getStopCheckList(BsCovenantQueryBo bo) {
         startPage();
         bo.setListType(4);
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(1L);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
@@ -91,6 +99,8 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<BsCovenantVo> getCovenantUploadList(BsCovenantQueryBo bo) {
         startPage();
         bo.setListType(5);
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(1L);
         List<BsCovenantVo> list = iBsCovenantService.queryList(bo);
         return getDataTable(list);
     }
@@ -99,7 +109,7 @@ public class BsCovenantController extends BaseController {
      * 获取企业协议详细信息
      */
     @ApiOperation("获取企业协议详细信息")
-    @GetMapping("/{covenantId")
+    @GetMapping("/{covenantId}")
     public AjaxResult<BsCovenantVo> getInfo(@PathVariable("covenantId" ) Long covenantId) {
         return AjaxResult.success(iBsCovenantService.queryById(covenantId));
     }
@@ -107,10 +117,25 @@ public class BsCovenantController extends BaseController {
     /**
      * 新增企业协议
      */
-    @ApiOperation("新增协议")
+    @ApiOperation("云学堂新增协议")
     @Log(title = "企业协议", businessType = BusinessType.INSERT)
     @PostMapping("/insert")
     public AjaxResult<Void> add(@RequestBody BsCovenantAddBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        bo.setFormApp(1L);
+        return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
+    }
+    /**
+     * 新增企业协议
+     */
+    @ApiOperation("业务系统新增协议")
+    @Log(title = "企业协议", businessType = BusinessType.INSERT)
+    @PostMapping("/insertYW")
+    public AjaxResult<Void> addYW(@RequestBody BsCovenantAddBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        bo.setFormApp(3L);
         return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
     }
 
@@ -204,9 +229,9 @@ public class BsCovenantController extends BaseController {
      */
     @ApiOperation("协议上传")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
-    @PostMapping("/uploadImg}")
-    public AjaxResult uploadImg(@RequestParam("covenantId") Long covenantId,@RequestParam("status") String path) {
-        return toAjax(iBsCovenantService.uploadImg(covenantId,path) ? 1 : 0);
+    @PostMapping("/uploadImg")
+    public AjaxResult uploadImg(@RequestParam("covenantId") Long covenantId,@RequestParam("path") List<String> paths) {
+        return toAjax(iBsCovenantService.uploadImg(covenantId,paths) ? 1 : 0);
     }
     /**
      * 删除企业协议
@@ -243,7 +268,7 @@ public class BsCovenantController extends BaseController {
     }
     @ApiOperation("获取审核意见列表")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
-    @PostMapping("/getCheckInfo")
+    @GetMapping("/getCheckInfo")
     public TableDataInfo<CovenantCheckRecordVo> getCheckInfo(@RequestParam("covenantId") Long covenantId) {
         return getDataTable(iBsCovenantService.getNoCheckInfo(covenantId));
     }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantAddBo.java

@@ -39,10 +39,16 @@ public class BsCovenantAddBo {
     /** 结算周期(月) */
     @ApiModelProperty("结算周期(月)")
     private Long settlementCycle;
+    /** 创建者id*/
+    @ApiModelProperty("创建者id")
+    private Long userId;
+    /** 协议来源 1云学堂  2企业系统  3业务系统 4总平台  */
+    @ApiModelProperty("协议来源 1云学堂  2企业系统  3业务系统 4总平台 ")
+    private Long formApp;
     /** 结算周期显示状态 0:不勾选 1勾选 */
     @ApiModelProperty("结算周期显示状态 0:不勾选 1勾选")
     private Integer cycleStatus;
-    /*结算预警 0无状态 1 正常 2周期预警 3金额预警*/
+    /*1 正常 2周期预警 3金额预警 4结算预警*/
     private Integer cycleWarning;
     /** 结算上限金额 */
     @ApiModelProperty("结算上限金额")

+ 6 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantEditBo.java

@@ -53,8 +53,12 @@ public class BsCovenantEditBo {
     /** 结算周期显示状态 0:不勾选 1勾选 */
     @ApiModelProperty("结算周期显示状态 0:不勾选 1勾选")
     private Integer cycleStatus;
-    @ApiModelProperty("结算预警 0无状态 1 正常 2周期预警 3金额预警")
-    private Integer cycleWarning;
+    /** 创建者id*/
+    @ApiModelProperty("创建者id")
+    private Long userId;
+    /** 协议来源 1云学堂  2企业系统  3业务系统 4总平台  */
+    @ApiModelProperty("协议来源 1云学堂  2企业系统  3业务系统 4总平台 ")
+    private Long formApp;
     /** 结算上限金额 */
     @ApiModelProperty("结算上限金额")
     private BigDecimal limitAmount;

+ 10 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantQueryBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.bs.covenant.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.models.auth.In;
@@ -60,6 +61,14 @@ public class BsCovenantQueryBo extends BaseEntity {
 	private String covenantImg;
 	@ApiModelProperty("上传状态 0 待上传 1待生效 2 已生效 ")
 	private Integer uploadStatus;
+	/** 创建者id*/
+	@ApiModelProperty("创建者id")
+	private Long userId;
+	/** 协议来源 1云学堂  2企业系统  3业务系统 4总平台  */
+	@ApiModelProperty("协议来源 1云学堂  2企业系统  3业务系统 4总平台 ")
+	private Long formApp;
+	@ApiModelProperty("1 正常 2周期预警 3金额预警 4结算预警")
+	private Integer cycleWarning;
 	/** 结算周期(月) */
 	@ApiModelProperty("结算周期(月)")
 	private Long settlementCycle;
@@ -71,10 +80,7 @@ public class BsCovenantQueryBo extends BaseEntity {
 	private BigDecimal limitAmount;
 	/** 结算上限金额显示状态 0:不勾选 1勾选 */
 	@ApiModelProperty("结算上限金额显示状态 0:不勾选 1勾选")
-	private Integer amountStatus;
-	/*结算预警 0无状态 1 正常 2周期预警 3金额预警*/
-	@ApiModelProperty("结算预警 0无状态 1 正常 2周期预警 3金额预警")
-	private Integer cycleWarning;
+	private Integer amountStatus;;
 	/** 甲方企业id */
 	@ApiModelProperty("甲方企业id")
 	private Long companyId;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoAddBo.java

@@ -15,7 +15,7 @@ import java.util.Date;
  * @date 2024-05-30
  */
 @Data
-@ApiModel("乙方协议收件信息添加对象")
+@ApiModel("乙方信息添加对象")
 public class TenantCovenantInfoAddBo {
 
     /** 乙方公司名称 */

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoEditBo.java

@@ -14,7 +14,7 @@ import java.util.Date;
  * @date 2024-05-30
  */
 @Data
-@ApiModel("乙方协议收件信息编辑对象")
+@ApiModel("乙方信息编辑对象")
 public class TenantCovenantInfoEditBo {
 
     /** $column.columnComment */

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/TenantCovenantInfoQueryBo.java

@@ -19,7 +19,7 @@ import com.zhongzheng.common.core.domain.BaseEntity;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@ApiModel("乙方协议收件信息分页查询对象")
+@ApiModel("乙方信息分页查询对象")
 public class TenantCovenantInfoQueryBo extends BaseEntity {
 
 	/** 分页大小 */

+ 5 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/BsCovenant.java

@@ -40,9 +40,11 @@ private static final long serialVersionUID=1L;
     /** 结算周期(月) */
     private Long settlementCycle;
     /** 结算周期显示状态 0:不勾选 1勾选 */
-    private Integer cycleStatus;
-    /*结算预警 0无状态 1 正常 2周期预警 3金额预警*/
-    private Integer cycleWarning;
+    private Integer cycleStatus;;
+    /** 创建者id*/
+    private Long userId;
+    /** 协议来源 1云学堂  2企业系统  3业务系统 4总平台  */
+    private Long formApp;
     /** 结算上限金额 */
     private BigDecimal limitAmount;
     /** 结算上限金额显示状态 0:不勾选 1勾选 */

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/TenantCovenantInfo.java

@@ -11,7 +11,7 @@ import java.math.BigDecimal;
 import com.zhongzheng.common.annotation.Excel;
 
 /**
- * 乙方协议收件信息对象 tenant_covenant_info
+ * 乙方信息对象 tenant_covenant_info
  *
  * @author ruoyi
  * @date 2024-05-30

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/IBsCovenantService.java

@@ -92,7 +92,7 @@ public interface IBsCovenantService extends IService<BsCovenant> {
 	/**
 	 * 协议上传
 	 */
-	boolean uploadImg(Long covenantId,String path);
+	boolean uploadImg(Long covenantId,List<String> paths);
 	/**
 	 * 协议上传确认生效
 	 */

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantBusinessServiceImpl.java

@@ -41,6 +41,7 @@ public class BsCovenantBusinessServiceImpl extends ServiceImpl<BsCovenantBusines
     public List<BsCovenantBusinessVo> queryList(BsCovenantBusinessQueryBo bo) {
         LambdaQueryWrapper<BsCovenantBusiness> lqw = Wrappers.lambdaQuery();
         lqw.eq(bo.getCompanyId() != null, BsCovenantBusiness::getCompanyId, bo.getCompanyId());
+        lqw.eq(bo.getCovenantId() != null, BsCovenantBusiness::getCovenantId, bo.getCovenantId());
         lqw.eq(ObjectUtil.isNotNull(bo.getEducationTypeId()), BsCovenantBusiness::getEducationTypeId, bo.getEducationTypeId());
         lqw.eq(bo.getBusinessId() != null, BsCovenantBusiness::getBusinessId, bo.getBusinessId());
         lqw.eq(bo.getProjectId() != null, BsCovenantBusiness::getProjectId, bo.getProjectId());

+ 1 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantGoodsServiceImpl.java

@@ -1,7 +1,6 @@
 package com.zhongzheng.modules.bs.covenant.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,7 +16,6 @@ import com.zhongzheng.modules.bs.covenant.vo.BsCovenantGoodsVo;
 import com.zhongzheng.modules.bs.covenant.service.IBsCovenantGoodsService;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -40,6 +38,7 @@ public class BsCovenantGoodsServiceImpl extends ServiceImpl<BsCovenantGoodsMappe
     public List<BsCovenantGoodsVo> queryList(BsCovenantGoodsQueryBo bo) {
         LambdaQueryWrapper<BsCovenantGoods> lqw = Wrappers.lambdaQuery();
         lqw.eq(bo.getCovenantBusinessId() != null, BsCovenantGoods::getCovenantBusinessId, bo.getCovenantBusinessId());
+        lqw.eq(bo.getCovenantId() != null, BsCovenantGoods::getCovenantId, bo.getCovenantId());
         lqw.eq(bo.getCompanyId() != null, BsCovenantGoods::getCompanyId, bo.getCompanyId());
         lqw.eq(bo.getGoodsId() != null, BsCovenantGoods::getGoodsId, bo.getGoodsId());
         lqw.eq(bo.getCovenantPrice() != null, BsCovenantGoods::getCovenantPrice, bo.getCovenantPrice());

+ 48 - 50
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantServiceImpl.java

@@ -4,17 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.utils.StringUtils;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.github.pagehelper.util.StringUtil;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParser;
-import com.itextpdf.text.Document;
-import com.itextpdf.text.DocumentException;
-import com.itextpdf.text.pdf.PdfDocument;
-import com.itextpdf.text.pdf.PdfWriter;
 import com.zhongzheng.common.core.domain.entity.SysMenu;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.exception.CustomException;
@@ -119,6 +110,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         List<BsCovenantVo> covenantVoArrayList = new ArrayList<>();
         if (!bsCovenantVos.isEmpty()) {
             bsCovenantVos.forEach(bsCovenantVo -> {
+                bsCovenantVo.setCycleWarning(bo.getCycleWarning());
                 bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
                 Company yiCompany = iCompanyService.getById(bsCovenantVo.getYiCompanyId());
                 if (ObjectUtils.isNotNull(yiCompany)) {
@@ -128,31 +120,27 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                 bsCovenantBusinessQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
                 bsCovenantBusinessQueryBo.setStatus(1);
                 List<BsCovenantBusinessVo> bsCovenantBusinessVos = iBsCovenantBusinessService.queryList(bsCovenantBusinessQueryBo);
-                List<BsCovenantBusinessVo> businessVoArrayList = new ArrayList<>();
+                List<BsCovenantBusinessVo> newBusinessVos= new ArrayList<>();
                 bsCovenantBusinessVos.forEach(bsCovenantBusiness -> {
                     bsCovenantBusiness.setBusinessName(iCourseBusinessService.getById(bsCovenantBusiness.getBusinessId()).getBusinessName());
                     bsCovenantBusiness.setEducationTypeName(iCourseEducationTypeService.getById(bsCovenantBusiness.getEducationTypeId()).getEducationName());
                     bsCovenantBusiness.setProjectName(iCourseProjectTypeService.getById(bsCovenantBusiness.getProjectId()).getProjectName());
-                    businessVoArrayList.add(bsCovenantBusiness);
-                });
-                bsCovenantVo.setBsCovenantBusinessVos(businessVoArrayList);
-                if (!bsCovenantBusinessVos.isEmpty()) {
-                    bsCovenantBusinessVos.forEach(bsCovenantBusiness -> {
-                        BsCovenantGoodsQueryBo bsCovenantGoodsQueryBo = new BsCovenantGoodsQueryBo();
-                        bsCovenantGoodsQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
-                        bsCovenantGoodsQueryBo.setStatus(1);
-                        List<BsCovenantGoodsVo> bsCovenantGoodsVos = iBsCovenantGoodsService.queryList(bsCovenantGoodsQueryBo);
-                        List<BsCovenantGoodsVo> covenantGoodsVos = new ArrayList<>();
-                        bsCovenantGoodsVos.forEach(bsCovenantGoodsVo -> {
-                            Goods goods = iGoodsService.getById(bsCovenantGoodsVo.getGoodsId());
-                            bsCovenantGoodsVo.setGoodsName(goods.getGoodsName());
-                            bsCovenantGoodsVo.setMajorName(iMajorService.getById(goods.getMajorId()).getCategoryName());
-                            bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
-                            covenantGoodsVos.add(bsCovenantGoodsVo);
-                        });
-                        bsCovenantBusiness.setBsCovenantGoodsVos(covenantGoodsVos);
+                    BsCovenantGoodsQueryBo bsCovenantGoodsQueryBo = new BsCovenantGoodsQueryBo();
+                    bsCovenantGoodsQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
+                    bsCovenantGoodsQueryBo.setStatus(1);
+                    List<BsCovenantGoodsVo> bsCovenantGoodsVos = iBsCovenantGoodsService.queryList(bsCovenantGoodsQueryBo);
+                    List<BsCovenantGoodsVo> covenantGoodsVos = new ArrayList<>();
+                    bsCovenantGoodsVos.forEach(bsCovenantGoodsVo -> {
+                        Goods goods = iGoodsService.getById(bsCovenantGoodsVo.getGoodsId());
+                        bsCovenantGoodsVo.setGoodsName(goods.getGoodsName());
+                        bsCovenantGoodsVo.setMajorName(iMajorService.getById(goods.getMajorId()).getCategoryName());
+                        bsCovenantGoodsVo.setStandPrice(goods.getStandPrice());
+                        covenantGoodsVos.add(bsCovenantGoodsVo);
                     });
-                }
+                    bsCovenantBusiness.setBsCovenantGoodsVos(covenantGoodsVos);
+                    newBusinessVos.add(bsCovenantBusiness);
+                });
+                bsCovenantVo.setBsCovenantBusinessVos(newBusinessVos);
                 covenantVoArrayList.add(bsCovenantVo);
             });
         }
@@ -164,6 +152,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
     @Transactional
     public Boolean insertByAddBo(BsCovenantAddBo bo) {
         BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
+        add.setFormApp(2L);
         String companyId = ServletUtils.getRequest().getHeader("companyId");
         add.setCompanyId(Long.valueOf(companyId));
         add.setCreateTime(DateUtils.getNowTime());
@@ -384,6 +373,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                 BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, covenantBusiness.getBusinessId())
                         .eq(BsCovenantBusiness::getEducationTypeId, covenantBusiness.getEducationTypeId())
                         .eq(BsCovenantBusiness::getProjectId, covenantBusiness.getProjectId())
+                                .eq(BsCovenantBusiness::getCovenantId,newBsCovenant.getCovenantId())
                         .eq(BsCovenantBusiness::getStatus, 1));
                 //写入协议业务类型有关商品
                 bsCovenantBusinessVo.getBsCovenantGoods().forEach(bsCovenantGoodsVo -> {
@@ -567,20 +557,20 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         String uploadPdf = null;
         //生成协议pdf文件
         PdfUtils.downloadPdf(bean, toPath, sysTenantAccountVo);
-//        //上传oss
-//        OssRequest ossRequest = new OssRequest();
-//        ossRequest.setGradeId(0L);
-//        ossRequest.setUserId(0L);
-//        ossRequest.setImageStatus(12);
-//        File file = new File(toPath);
-//        ossRequest.setFile(FileUtils.getMultipartFile(file));
-//        try {
-//            uploadPdf = ossService.upload(ossRequest);
-//        } catch (Exception e) {
-//            throw new RuntimeException(e);
-//        }
-//        //删除本地文件
-//        FileUtils.deleteFilePackage(toPath);
+        //上传oss
+        OssRequest ossRequest = new OssRequest();
+        ossRequest.setGradeId(0L);
+        ossRequest.setUserId(0L);
+        ossRequest.setImageStatus(12);
+        File file = new File(toPath);
+        ossRequest.setFile(FileUtils.getMultipartFile(file));
+        try {
+            uploadPdf = ossService.upload(ossRequest);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        //删除本地文件
+        FileUtils.deleteFilePackage(toPath);
         return uploadPdf;
     }
 
@@ -652,7 +642,6 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                 covenantCheckRecord.setCreateTime(DateUtils.getNowTime());
                 covenantCheckRecord.setUpdateTime(DateUtils.getNowTime());
                 iCovenantCheckRecordService.insertByAddBo(covenantCheckRecord);
-
             }
             BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
             bean.setStatus(noCheckInfo.getStatus());
@@ -672,7 +661,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
             if (ObjectUtils.isNull(bsCovenantVo)) {
                 throw new CustomException("当前协议不存在");
             }
-            if (bsCovenantVo.getStatus() != 1) {
+            if (bsCovenantVo.getStopStatus() != 1) {
                 throw new CustomException("当前协议未处于终止待审核状态");
             }
             if (noCheckInfo.getStatus()==3){
@@ -694,14 +683,20 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
     }
 
     @Override
-    public boolean uploadImg(Long covenantId, String path) {
+    public boolean uploadImg(Long covenantId, List<String> paths) {
         BsCovenantVo bsCovenantVo = this.queryById(covenantId);
         if (ObjectUtils.isNull(bsCovenantVo)) {
             throw new CustomException("当前协议不存在");
         }
+        if (bsCovenantVo.getStatus()!=2){
+            throw new CustomException("当前协议未审核通过");
+        }
+        if(ObjectUtils.isNull(paths)){
+            throw new CustomException("为上传协议");
+        }
         BsCovenant bsCovenant = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
         bsCovenant.setUploadStatus(1);
-        bsCovenant.setCovenantImg(path);
+        bsCovenant.setCovenantImg(paths.toString());
         bsCovenant.setUpdateTime(DateUtils.getNowTime());
         return updateById(bsCovenant);
     }
@@ -712,9 +707,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         if (ObjectUtils.isNull(bsCovenantVo)) {
             throw new CustomException("当前协议不存在");
         }
+        if (bsCovenantVo.getUploadStatus()!=1){
+            throw new CustomException("当前协议未上传");
+        }
         BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
         bean.setUploadStatus(2);
-        bean.setStatus(4);
+        bean.setStatus(5);
+        bean.setUpdateTime(DateUtils.getNowTime());
         return this.updateById(bean);
     }
 
@@ -725,7 +724,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
 
     @Override
     public Integer countStopNoCheckNum() {
-        return this.baseMapper.selectCount(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getStopStatus, 1));
+        return this.baseMapper.selectCount(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getStopStatus, 1).eq(BsCovenant::getStatus,5));
     }
 
     @Override
@@ -744,6 +743,5 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         CovenantCheckRecordQueryBo covenantCheckRecordQueryBo = new CovenantCheckRecordQueryBo();
         covenantCheckRecordQueryBo.setCovenantId(covenantId);
         return iCovenantCheckRecordService.queryList(covenantCheckRecordQueryBo);
-
     }
 }

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantGoodsVo.java

@@ -76,5 +76,4 @@ public class BsCovenantGoodsVo {
 	@Excel(name = "状态 1有效 0无效")
 	@ApiModelProperty("状态 1有效 0无效")
 	private Integer status;
-	private List<BsCovenantGoodsVo> bsCovenantGoodsVos;
 }

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantVo.java

@@ -57,12 +57,20 @@ public class BsCovenantVo {
 	@Excel(name = "结算周期(月)")
 	@ApiModelProperty("结算周期(月)")
 	private Long settlementCycle;
+	/** 创建者id*/
+	@Excel(name = "创建者id")
+	@ApiModelProperty("创建者id")
+	private Long userId;
+	/** 协议来源 1云学堂  2企业系统  3业务系统 4总平台  */
+	@Excel(name = "协议来源 1云学堂  2企业系统  3业务系统 4总平台")
+	@ApiModelProperty("协议来源 1云学堂  2企业系统  3业务系统 4总平台 ")
+	private Long formApp;
 	/** 结算周期显示状态 0:不勾选 1勾选 */
 	@Excel(name = "结算周期显示状态 0:不勾选 1勾选")
 	@ApiModelProperty("结算周期显示状态 0:不勾选 1勾选")
 	private Integer cycleStatus;
-	@Excel(name = "结算预警 0无状态 1 正常 2周期预警 3金额预警")
-	@ApiModelProperty("结算预警 0无状态 1 正常 2周期预警 3金额预警")
+	@Excel(name = "1 正常 2周期预警 3金额预警 4结算预警")
+	@ApiModelProperty("1 正常 2周期预警 3金额预警 4结算预警")
 	private Integer cycleWarning;
 	/** 结算上限金额 */
 	@Excel(name = "结算上限金额")

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/TenantCovenantInfoVo.java

@@ -10,13 +10,13 @@ import java.util.Date;
 
 
 /**
- * 乙方协议收件信息视图对象 mall_package
+ * 乙方信息视图对象 mall_package
  *
  * @author ruoyi
  * @date 2024-05-30
  */
 @Data
-@ApiModel("乙方协议收件信息视图对象")
+@ApiModel("乙方信息视图对象")
 public class TenantCovenantInfoVo {
 	private static final long serialVersionUID = 1L;
 

+ 18 - 16
zhongzheng-system/src/main/resources/mapper/modules/covenant/BsCovenantMapper.xml

@@ -13,7 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="stopStatus" column="stop_status"/>
         <result property="settlementCycle" column="Settlement_cycle"/>
         <result property="cycleStatus" column="cycle_status"/>
-        <result property="cycleWarning" column="cycle_warning"/>
+        <result property="userId" column="user_id"/>
+        <result property="formApp" column="form_app"/>
         <result property="limitAmount" column="limit_amount"/>
         <result property="amountStatus" column="amount_status"/>
         <result property="covenantImg" column="covenant_img"/>
@@ -48,9 +49,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="stopStatus" column="stop_status"/>
         <result property="settlementCycle" column="Settlement_cycle"/>
         <result property="cycleStatus" column="cycle_status"/>
-        <result property="cycleWarning" column="cycle_warning"/>
         <result property="limitAmount" column="limit_amount"/>
         <result property="amountStatus" column="amount_status"/>
+        <result property="userId" column="user_id"/>
+        <result property="formApp" column="form_app"/>
         <result property="companyId" column="company_id"/>
         <result property="jiaCompanyName" column="jia_company_name"/>
         <result property="jiaCompanyContract" column="jia_company_contract"/>
@@ -73,42 +75,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <select id="selectByCovenantId" parameterType="com.zhongzheng.modules.bs.covenant.bo.BsCovenantQueryBo" resultMap="BsCovenantVoResult">
     select * from
         bs_covenant bc left join  bs_covenant_business bcb on bc.covenant_id=bcb.covenant_id
-    left join bs_covenant_goods bcg on bcb.covenant_business_id=bcg.covenant_business_id
+    left join bs_covenant_goods bcg on bcb.covenant_business_id=bcg.covenant_business_id where 1=1
     <if test="covenantId != null and covenantId !=''">
         and bc.covenant_id=#{covenantId}
     </if>
     <if test="searchKey !=null and searchKey !=''">
         and bc.jia_company_name=#{searchKey} or bc.covenant_num=#{searchKey}
     </if>
-    <if test="listType = 2">
-        and bc.stop_status!=0
+    <if test="listType == 2">
+        and bc.stop_status!=0 and bc.stop_status!=2
     </if>
-    <if test="listType = 3">
+    <if test="listType ==3">
         and bc.status!=3 and bc.status!=5 and bc.status!=6 and bc.status!=7
     </if>
-    <if test="listType = 4">
+    <if test="listType == 4">
         and bc.stop_status!=0  and bc.stop_status!=4 and bc.stop_status!=5
     </if>
-    <if test="listType = 5">
+    <if test="listType ==5">
         and bc.upload_status!=6
     </if>
     <if test="covenantNum != null and covenantNum != ''">
         and bc.covenant_num=#{covenantNum}
     </if>
-    <if test="stopStatus != null and stopStatus != ''">
+    <if test="stopStatus != null">
         and bc.stop_status=#{stopStatus}
     </if>
-    <if test="cycleWarning != null and cycleWarning != ''">
-        and bc.cycle_warning=#{cycleWarning}
-    </if>
     <if test="status != null and status != ''">
         and bc.status=#{status}
     </if>
-    <if test="stopStatus != null and stopStatus != '' and listStyle=2">
-        and bc.stop_status=#{stopStatus}
+    <if test="uploadStatus != null">
+        and bc.upload_status =#{uploadStatus} and bc.status=2
+    </if>
+    <if test="userId !=null">
+        bc.user_id=#{userId}
     </if>
-    <if test="uploadStatus != null and uploadStatus != ''">
-        and bc.upload_status =#{upload} and bc.status=2
+    <if test="formApp !=null">
+        bc.form_app=#{formApp}
     </if>
     order by bc.create_time desc
 </select>