he2802 1 jaar geleden
bovenliggende
commit
2b1bf6a71b

+ 2 - 14
zhongzheng-admin-business/src/main/java/com/zhongzheng/controller/covenant/BsCovenantBusinessController.java

@@ -30,7 +30,7 @@ import io.swagger.annotations.ApiOperation;
 
 /**
  * 协议业务层次关联Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-05-28
  */
@@ -54,18 +54,6 @@ public class BsCovenantBusinessController extends BaseController {
         return getDataTable(list);
     }
 
-    /**
-     * 导出协议业务层次关联列表
-     */
-    @ApiOperation("导出协议业务层次关联列表")
-    @PreAuthorize("@ss.hasPermi('covenantBusiness:covenantBusiness:export')")
-    @Log(title = "协议业务层次关联", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult<BsCovenantBusinessVo> export(BsCovenantBusinessQueryBo bo) {
-        List<BsCovenantBusinessVo> list = iBsCovenantBusinessService.queryList(bo);
-        ExcelUtil<BsCovenantBusinessVo> util = new ExcelUtil<BsCovenantBusinessVo>(BsCovenantBusinessVo.class);
-        return util.exportExcel(list, "协议业务层次关联");
-    }
 
     /**
      * 获取协议业务层次关联详细信息
@@ -85,7 +73,7 @@ public class BsCovenantBusinessController extends BaseController {
     @Log(title = "协议业务层次关联", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody BsCovenantBusinessAddBo bo) {
-        return toAjax(iBsCovenantBusinessService.insertByAddBo(bo) ? 1 : 0);
+        return toAjax(iBsCovenantBusinessService.insertByAddBo(bo)>0 ? 1 : 0);
     }
 
     /**

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

@@ -147,8 +147,8 @@ public class BsCovenantController extends BaseController {
     @ApiOperation("协议取消")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
     @PostMapping("/cancelStatus")
-    public AjaxResult<Void> cancelStatus(@RequestParam("covenantId") Long covenantId) {
-        return toAjax(iBsCovenantService.deleteWithValidByIds(covenantId) ? 1 : 0);
+    public AjaxResult<Void> cancelStatus(@RequestBody BsCovenantEditBo bo) {
+        return toAjax(iBsCovenantService.deleteWithValidByIds(bo.getCovenantId()) ? 1 : 0);
     }
     /**
      * 删除企业协议
@@ -185,8 +185,8 @@ public class BsCovenantController extends BaseController {
     @ApiOperation("终止申请")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
     @PostMapping("/updateStopStatus")
-    public AjaxResult<Void> updateStopStatus(@RequestParam("covenantId") Long covenantId) {
-        return toAjax(iBsCovenantService.updateStopStatus(covenantId) ? 1 : 0);
+    public AjaxResult<Void> updateStopStatus(@RequestBody BsCovenantEditBo bo) {
+        return toAjax(iBsCovenantService.updateStopStatus(bo.getCovenantId()) ? 1 : 0);
     }
     /**
      * 删除企业协议
@@ -194,8 +194,8 @@ public class BsCovenantController extends BaseController {
     @ApiOperation("取消终止申请")
     @Log(title = "企业协议" , businessType = BusinessType.DELETE)
     @PostMapping("/cancelStopStatus")
-    public AjaxResult<Void> cancelStopStatus(@RequestParam("covenantId") Long covenantId) {
-        return toAjax(iBsCovenantService.cancelStopStatus(covenantId) ? 1 : 0);
+    public AjaxResult<Void> cancelStopStatus(@RequestBody BsCovenantEditBo bo) {
+        return toAjax(iBsCovenantService.cancelStopStatus(bo.getCovenantId()) ? 1 : 0);
     }
     /**
      * 删除企业协议
@@ -268,5 +268,27 @@ public class BsCovenantController extends BaseController {
     public TableDataInfo<CovenantCheckRecordVo> getCheckInfo(@RequestParam("covenantId") Long covenantId) {
         return getDataTable(iBsCovenantService.getNoCheckInfo(covenantId));
     }
+
+    /**
+     * 查询企业协议列表
+     */
+    @ApiOperation("查询甲乙方上一次收件信息")
+    @GetMapping("/getLastJiaInfo")
+    public AjaxResult getLastJiaInfo(BsCovenantQueryBo bo) {
+        startPage();
+        bo.setUserId(tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId());
+        bo.setFormApp(2L);
+        return AjaxResult.success(iBsCovenantService.getLastJiaInfo(bo));
+    }
+
+    /**
+     * 修改企业协议
+     */
+    @ApiOperation("修改重提")
+    @Log(title = "企业协议", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateCommit")
+    public AjaxResult<Void> copyAndInsert(@RequestBody BsCovenantEditBo bo) {
+        return toAjax(iBsCovenantService.updateByEditBo(bo) ? 1 : 0);
+    }
 }
 

+ 42 - 0
zhongzheng-admin-business/src/main/java/com/zhongzheng/controller/system/BsSysTenantController.java

@@ -0,0 +1,42 @@
+package com.zhongzheng.controller.system;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.modules.system.bo.SysTopTenantAccountBo;
+import com.zhongzheng.modules.system.service.ISysTenantService;
+import com.zhongzheng.modules.system.vo.SysTenantVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 系统商户Controller
+ *
+ * @author hjl
+ * @date 2021-08-03
+ */
+@Api(value = "系统商户控制器", tags = {"系统商户管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/bs/system/tenant")
+public class BsSysTenantController extends BaseController {
+
+    private final ISysTenantService iSysTenantService;
+
+
+    /**
+     * 新增,修改收款信息
+     */
+    @ApiOperation("查询收款信息")
+    @Log(title = "系统商户", businessType = BusinessType.INSERT)
+    @PostMapping("/getAccount")
+    public AjaxResult getAccount() {
+        return AjaxResult.success(iSysTenantService.getAccount());
+    }
+}

+ 2 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/covenant/BsCovenantBusinessController.java

@@ -23,7 +23,7 @@ import java.util.List;
 
 /**
  * 协议业务层次关联Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-05-28
  */
@@ -78,7 +78,7 @@ public class BsCovenantBusinessController extends BaseController {
     @Log(title = "协议业务层次关联", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody BsCovenantBusinessAddBo bo) {
-        return toAjax(iBsCovenantBusinessService.insertByAddBo(bo) ? 1 : 0);
+        return toAjax(iBsCovenantBusinessService.insertByAddBo(bo)>0 ? 1 : 0);
     }
 
     /**

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

@@ -347,7 +347,7 @@ public class BsCovenantController extends BaseController {
     @GetMapping("/getCovenantListYw")
     public TableDataInfo<BsCovenantVo> getCovenantListYw(BsCovenantQueryBo bo) {
         if(Validator.isEmpty(bo.getUserId())){
-            throw new CustomException("用户ID确实");
+            throw new CustomException(" 创建ID缺失");
         }
         startPage();
         bo.setListType(1);

+ 4 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysTenantServiceImpl.java

@@ -21,6 +21,7 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.system.bo.*;
@@ -169,7 +170,8 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
 
     @Override
     public SysTenantAccountVo getAccount() {
-        SysTenant sysTenant = this.getOne(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getStatus, 1).eq(SysTenant::getAppList, 1));
+        String tenantId = ToolsUtils.getTenantId();
+        SysTenant sysTenant = this.getOne(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getStatus, 1).eq(SysTenant::getAppList, 1).eq(Validator.isNotEmpty(tenantId),SysTenant::getTenantId,tenantId));
         if (ObjectUtils.isNotNull(sysTenant)){
             String accountInformation = sysTenant.getAccountInformation();
             if (StringUtil.isNotEmpty(accountInformation)){
@@ -338,7 +340,7 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenant
     }
 
     @Override
-    
+
     public List<SysTenant> getListSysTenant() {
         return list(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getStatus, 1));
     }

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

@@ -106,7 +106,7 @@ public class BsCovenantAddBo {
     /** 更新时间 */
     @ApiModelProperty("更新时间")
     private Long updateTime;
-    private List<BsCovenantBusinessAddBo> bsCovenantBusinessList;
+    private List<BsCovenantBusinessAddBo> bsCovenantBusinessVos;
     /*存在已知业务类型的协议编号*/
     @ApiModelProperty("存在已知业务类型的协议编号")
     private String copyCovenantNum;

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

@@ -18,7 +18,6 @@ import com.zhongzheng.common.core.domain.BaseEntity;
  * @date 2024-05-28
  */
 @Data
-@EqualsAndHashCode(callSuper = true)
 @ApiModel("协议业务层次关联分页查询对象")
 public class BsCovenantBusinessQueryBo extends BaseEntity {
 

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

@@ -22,7 +22,6 @@ import com.zhongzheng.common.core.domain.BaseEntity;
  * @date 2024-05-28
  */
 @Data
-@EqualsAndHashCode(callSuper = true)
 @ApiModel("企业协议分页查询对象")
 public class BsCovenantQueryBo extends BaseEntity {
 

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

@@ -34,7 +34,7 @@ public interface IBsCovenantBusinessService extends IService<BsCovenantBusiness>
 	 * @param bo 协议业务层次关联新增业务对象
 	 * @return
 	 */
-	Boolean insertByAddBo(BsCovenantBusinessAddBo bo);
+	Long insertByAddBo(BsCovenantBusinessAddBo bo);
 
 	/**
 	 * 根据编辑业务对象修改协议业务层次关联

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

@@ -70,12 +70,13 @@ public class BsCovenantBusinessServiceImpl extends ServiceImpl<BsCovenantBusines
     }
 
     @Override
-    public Boolean insertByAddBo(BsCovenantBusinessAddBo bo) {
+    public Long insertByAddBo(BsCovenantBusinessAddBo bo) {
         BsCovenantBusiness add = BeanUtil.toBean(bo, BsCovenantBusiness.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
-        return this.save(add);
+        this.save(add);
+        return add.getCovenantBusinessId();
     }
 
     @Override

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

@@ -127,7 +127,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                     bsCovenantVo.setCheckRecord(covenantCheckRecord.getCheckRecord());
                 }
                 bsCovenantVo.setCycleWarning(bo.getCycleWarning());
-                bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
+                if(bsCovenantVo.getFormApp()!=3){
+                    bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
+                }else{
+                    bsCovenantVo.setJiaCompanyName(iCompanyService.getOne(new LambdaQueryWrapper<Company>().eq(Company::getSaleCompanyId, bsCovenantVo.getCompanyId())).getCompanyName());
+                }
                 BsCovenantBusinessQueryBo bsCovenantBusinessQueryBo = new BsCovenantBusinessQueryBo();
                 bsCovenantBusinessQueryBo.setCovenantId(bsCovenantVo.getCovenantId());
                 bsCovenantBusinessQueryBo.setStatus(1);
@@ -251,6 +255,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         SysTenant yiSysTenant = iSysTenantService.getOne(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getTenantId, ServletUtils.getRequest().getHeader("TenantId")));
         add.setYiCompanyContract(yiSysTenant.getLinkMan());
         add.setYiCompanyPhone(yiSysTenant.getCompanyPh());
+        add.setStatus(1);
         int insert = this.baseMapper.insert(add);
         BsCovenant newBsCovenant = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCovenantNum()).eq(BsCovenant::getStatus, 1));
         //写入协议审核流程
@@ -295,15 +300,16 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                         throw new CustomException("当前协议不存在");
                     }
                 } else if (bo.getCopyStatus() == 0) {
-                    if (!bo.getBsCovenantBusinessList().isEmpty()) {
+                    if (!bo.getBsCovenantBusinessVos().isEmpty()) {
                         //写入协议业务类型
-                        bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
+                        bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
                             CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
                             bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
                             bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
                             bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
                             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
                             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
+                            bsCovenantBusinessAddBo.setStatus(1);
                             iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
                             if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
                                 BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
@@ -316,6 +322,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                                     bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
                                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
                                     bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
+                                    bsCovenantGoodsAddBo.setStatus(1);
                                     iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
                                 });
                             }
@@ -326,25 +333,23 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                 throw new CustomException("请选择是否复制协议数据");
             }
         }
-        bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
+        bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
             CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
             bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
             bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
             bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
-            iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
+            bsCovenantBusinessAddBo.setStatus(1);
+            Long covenantBusinessId = iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
             if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
-                BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
-                        .eq(BsCovenantBusiness::getEducationTypeId, bsCovenantBusinessAddBo.getEducationTypeId())
-                        .eq(BsCovenantBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId())
-                        .eq(BsCovenantBusiness::getStatus, 1));
                 //写入协议业务类型有关商品
                 bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
                     bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
-                    bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
+                    bsCovenantGoodsAddBo.setCovenantBusinessId(covenantBusinessId);
                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
                     bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
+                    bsCovenantGoodsAddBo.setStatus(1);
                     iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
                 });
             }
@@ -379,7 +384,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
             throw new CustomException("协议编号重复");
         }
         BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
-        if (ObjectUtils.isNotNull(bo.getCompanyId())) {
+        if (ObjectUtils.isNotNull(bo.getCompanyId())&&bo.getFormApp()!=3L) {
             Company byId = iCompanyService.getById(bo.getCompanyId());
             add.setJiaCompanyAddress(byId.getCompanyAddress());
             add.setJiaCompanyContract(byId.getCompanyContacts());
@@ -392,12 +397,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
         this.baseMapper.insert(add);
-        BsCovenant newBsCovenant = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCovenantNum()).eq(BsCovenant::getStatus, 1));
         //写入协议审核流程
         SysTenant sysTenant = iSysTenantService.getById(ServletUtils.getRequest().getHeader("TenantId"));
         if (ObjectUtils.isNotNull(sysTenant)) {
             BsCovenantCheckAddBo bsCovenantCheckAddBo = new BsCovenantCheckAddBo();
-            bsCovenantCheckAddBo.setCovenantId(newBsCovenant.getCovenantId());
+            bsCovenantCheckAddBo.setCovenantId(add.getCovenantId());
             bsCovenantCheckAddBo.setCompanyId(bo.getCompanyId());
             if (!sysTenant.getAppList().isEmpty()) {
                 List<String> list1 = Arrays.asList(sysTenant.getAppList().split(","));
@@ -435,13 +439,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                         throw new CustomException("当前协议不存在");
                     }
                 } else if (bo.getCopyStatus() == 0) {
-                    if (!bo.getBsCovenantBusinessList().isEmpty()) {
+                    if (!bo.getBsCovenantBusinessVos().isEmpty()) {
                         //写入协议业务类型
-                        bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
+                        bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
                             CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
                             bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
                             bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
-                            bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
+                            bsCovenantBusinessAddBo.setCovenantId(add.getCovenantId());
                             bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
                             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
                             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
@@ -453,7 +457,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                                         .eq(BsCovenantBusiness::getStatus, 1));
                                 //写入协议业务类型有关商品
                                 bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
-                                    bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
+                                    bsCovenantGoodsAddBo.setCovenantId(add.getCovenantId());
                                     bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
                                     bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
                                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
@@ -468,26 +472,21 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                 throw new CustomException("请选择是否复制协议数据");
             }
         }
-        bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessAddBo -> {
+        bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessAddBo -> {
             CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessAddBo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
             bsCovenantBusinessAddBo.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
             bsCovenantBusinessAddBo.setBusinessId(courseBusiness.getId());
-            bsCovenantBusinessAddBo.setCovenantId(newBsCovenant.getCovenantId());
+            bsCovenantBusinessAddBo.setCovenantId(add.getCovenantId());
             bsCovenantBusinessAddBo.setCompanyId(bo.getCompanyId());
             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
-            iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
+            Long covenantBusinessId = iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
             if (!bsCovenantBusinessAddBo.getBsCovenantGoodsVos().isEmpty()) {
-                BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessAddBo.getBusinessId())
-                        .eq(BsCovenantBusiness::getEducationTypeId, bsCovenantBusinessAddBo.getEducationTypeId())
-                        .eq(BsCovenantBusiness::getProjectId, bsCovenantBusinessAddBo.getProjectId())
-                        .eq(BsCovenantBusiness::getCovenantId, newBsCovenant.getCovenantId())
-                        .eq(BsCovenantBusiness::getStatus, 1));
                 //写入协议业务类型有关商品
                 bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
-                    bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
+                    bsCovenantGoodsAddBo.setCovenantId(add.getCovenantId());
                     bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
-                    bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
+                    bsCovenantGoodsAddBo.setCovenantBusinessId(covenantBusinessId);
                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
                     bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
                     iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
@@ -641,8 +640,8 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
             BsCovenant bean = BeanUtil.toBean(bsCovenantVo, BsCovenant.class);
             bean.setUpdateTime(DateUtils.getNowTime());
             this.updateById(bean);
-            iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, covenantId));
-            iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().set(BsCovenantGoods::getStatus, 0).eq(BsCovenantGoods::getCovenantId, covenantId));
+/*            iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, covenantId));
+            iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().set(BsCovenantGoods::getStatus, 0).eq(BsCovenantGoods::getCovenantId, covenantId));*/
         }
         return true;
     }