renqianlong 1 рік тому
батько
коміт
590d44ea34
25 змінених файлів з 310 додано та 152 видалено
  1. 2 5
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/covenant/BsCovenantController.java
  2. 5 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/covenant/CovenantCheckRecordController.java
  3. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyAddBo.java
  4. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyEditBo.java
  5. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyQueryBo.java
  6. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/domain/Company.java
  7. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/service/impl/CompanyServiceImpl.java
  8. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/vo/CompanyVo.java
  9. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/vo/CovenantCompanyVo.java
  10. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantAddBo.java
  11. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantBusinessAddBo.java
  12. 10 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantEditBo.java
  13. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/bo/BsCovenantQueryBo.java
  14. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/BsCovenant.java
  15. 181 139
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/service/impl/BsCovenantServiceImpl.java
  16. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantVo.java
  17. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  18. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordAddBo.java
  19. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordEditBo.java
  20. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordQueryBo.java
  21. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/records/domain/CovenantCheckRecord.java
  22. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/records/vo/CovenantCheckRecordVo.java
  23. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/company/CompanyMapper.xml
  24. 8 1
      zhongzheng-system/src/main/resources/mapper/modules/covenant/BsCovenantMapper.xml
  25. 1 2
      zhongzheng-system/src/main/resources/mapper/modules/covenant/CovenantCheckRecordMapper.xml

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

@@ -165,10 +165,8 @@ public class BsCovenantController extends BaseController {
      */
     @ApiOperation("业务系统新增协议")
     @Log(title = "企业协议", businessType = BusinessType.INSERT)
-    @PostMapping("/insertYW")
+    @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);
     }
@@ -182,7 +180,7 @@ public class BsCovenantController extends BaseController {
     public AjaxResult<Void> copyAndInsert(@RequestBody BsCovenantAddBo bo) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         bo.setUserId(loginUser.getUser().getUserId());
-        bo.setFormApp(3L);
+        bo.setFormApp(1L);
         return toAjax(iBsCovenantService.insertYXTByAddBo(bo) ? 1 : 0);
     }
 
@@ -330,7 +328,6 @@ public class BsCovenantController extends BaseController {
         Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
         return AjaxResult.success(iBsCovenantService.countUploadImgNum(userId, 1L));
     }
-
     @ApiOperation("获取审核意见列表")
     @Log(title = "企业协议", businessType = BusinessType.DELETE)
     @GetMapping("/getCheckInfo")

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

@@ -5,7 +5,9 @@ import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.framework.web.service.TokenService;
 import com.zhongzheng.modules.records.bo.CovenantCheckRecordAddBo;
 import com.zhongzheng.modules.records.bo.CovenantCheckRecordEditBo;
 import com.zhongzheng.modules.records.bo.CovenantCheckRecordQueryBo;
@@ -34,7 +36,7 @@ import java.util.List;
 public class CovenantCheckRecordController extends BaseController {
 
     private final ICovenantCheckRecordService iCovenantCheckRecordService;
-
+    private final TokenService tokenService;
     /**
      * 查询云学堂协议审核记录列表
      */
@@ -78,6 +80,8 @@ public class CovenantCheckRecordController extends BaseController {
     @Log(title = "云学堂协议审核记录", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody CovenantCheckRecordAddBo bo) {
+        Long userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId();
+        bo.setUserId(userId);
         return toAjax(iCovenantCheckRecordService.insertByAddBo(bo) ? 1 : 0);
     }
 

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyAddBo.java

@@ -71,6 +71,12 @@ public class CompanyAddBo {
     /** 企业父级id */
     @ApiModelProperty("企业父级id")
     private Long fatherId;
+    /** 业务员id */
+    @ApiModelProperty("业务员id")
+    private Long saleId;
+    /** 业务员企业id */
+    @ApiModelProperty("业务员企业id")
+    private Long saleCompanyId;
     /** 1有效 0无效 */
     @ApiModelProperty("1有效 0无效")
     private Integer status;

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyEditBo.java

@@ -93,7 +93,12 @@ public class CompanyEditBo {
     /** 企业父级id */
     @ApiModelProperty("企业父级id")
     private Long fatherId;
-
+    /** 业务员id */
+    @ApiModelProperty("业务员id")
+    private Long saleId;
+    /** 业务员企业id */
+    @ApiModelProperty("业务员企业id")
+    private Long saleCompanyId;
     /** 1有效 0无效 */
     @ApiModelProperty("1有效 0无效")
     private Integer status;

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/bo/CompanyQueryBo.java

@@ -58,6 +58,12 @@ public class CompanyQueryBo extends BaseEntity {
 	/** 成立日期 */
 	@ApiModelProperty("成立日期")
 	private Long establishDate;
+	/** 业务员id */
+	@ApiModelProperty("业务员id")
+	private Long saleId;
+	/** 业务员企业id */
+	@ApiModelProperty("业务员企业id")
+	private Long saleCompanyId;
 	/** 营业日期 */
 	@ApiModelProperty("营业日期")
 	private Long operateDate;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/domain/Company.java

@@ -67,6 +67,10 @@ private static final long serialVersionUID=1L;
     private Long companyLevel;
     /** 企业父级id */
     private Long fatherId;
+    /** 业务员id */
+    private Long saleId;
+    /** 业务员企业id */
+    private Long saleCompanyId;
     /** 1有效 0无效 */
     private Integer status;
     /** 创建时间 */

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

@@ -117,6 +117,7 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                 companyCovenantVo.setContactPhone(companyVo.getContactPhone());
                 companyCovenantVo.setCompanyContacts(companyVo.getCompanyContacts());
                 companyCovenantVo.setCompanyId(companyVo.getCompanyId());
+                companyCovenantVo.setSaleId(companyCovenantVo.getSaleId());
                 covenantCompanyVos.add(companyCovenantVo);
             });
         }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/vo/CompanyVo.java

@@ -116,6 +116,12 @@ public class CompanyVo {
 	/** 是否旧系统 */
 	@ApiModelProperty("是否旧系统")
 	private Long formId;
+	/** 业务员企业id */
+	@ApiModelProperty("业务员企业id")
+	private Long saleCompanyId;
+	/** 业务员id */
+	@ApiModelProperty("业务员id")
+	private Long saleId;
 	/** 公司父子部门列表 */
 	@Excel(name = "公司父子部门列表")
 	@ApiModelProperty("公司父子部门列表")

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/company/vo/CovenantCompanyVo.java

@@ -44,5 +44,10 @@ public class CovenantCompanyVo {
 	@Excel(name = "企业联系电话")
 	@ApiModelProperty("企业联系电话")
 	private String contactPhone;
+	/** 业务员id */
+	@Excel(name = "业务员id")
+	@ApiModelProperty("业务员id")
+	private Long saleId;
+
 
 }

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

@@ -122,4 +122,13 @@ public class BsCovenantAddBo {
     private String openingName;
     @ApiModelProperty("开户账号")
     private String proceedsAccount;
+    /** 业务员id */
+    @ApiModelProperty("业务员id")
+    private Long saleId;
+    /** 业务员编号 */
+    @ApiModelProperty("业务员编号")
+    private String saleNum;
+    /** 业务员姓名 */
+    @ApiModelProperty("业务员姓名")
+    private String saleName;
 }

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

@@ -47,5 +47,5 @@ public class BsCovenantBusinessAddBo {
     private Long updateTime;
     /** 更新时间 */
     @ApiModelProperty("商品信心")
-    private List<BsCovenantGoodsAddBo> bsCovenantGoods;
+    private List<BsCovenantGoodsAddBo> bsCovenantGoodsVos;
 }

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

@@ -130,7 +130,7 @@ public class BsCovenantEditBo {
     @ApiModelProperty("更新时间")
     private Long updateTime;
     @ApiModelProperty("协议关联业务层次集合")
-    private List<BsCovenantBusinessAddBo> bsCovenantBusinessList;
+    private List<BsCovenantBusinessAddBo> bsCovenantBusinessVos;
     /*存在已知业务类型的协议编号*/
     @ApiModelProperty("存在已知业务类型的协议编号")
     private String copyCovenantNum;
@@ -142,4 +142,13 @@ public class BsCovenantEditBo {
     private String openingName;
     @ApiModelProperty("开户账号")
     private String proceedsAccount;
+    /** 业务员id */
+    @ApiModelProperty("业务员id")
+    private Long saleId;
+    /** 业务员编号 */
+    @ApiModelProperty("业务员编号")
+    private String saleNum;
+    /** 业务员姓名 */
+    @ApiModelProperty("业务员姓名")
+    private String saleName;
 }

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

@@ -133,4 +133,13 @@ public class BsCovenantQueryBo extends BaseEntity {
 	private String openingName;
 	@ApiModelProperty("开户账号")
 	private String proceedsAccount;
+	/** 业务员id */
+	@ApiModelProperty("业务员id")
+	private Long saleId;
+	/** 业务员编号 */
+	@ApiModelProperty("业务员编号")
+	private String saleNum;
+	/** 业务员姓名 */
+	@ApiModelProperty("业务员姓名")
+	private String saleName;
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/domain/BsCovenant.java

@@ -160,4 +160,10 @@ public class BsCovenant implements Serializable {
     private String openingBank;
     private String openingName;
     private String proceedsAccount;
+    /** 业务员id */
+    private Long saleId;
+    /** 业务员编号 */
+    private String saleNum;
+    /** 业务员姓名 */
+    private String saleName;
 }

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

@@ -38,6 +38,7 @@ import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.records.bo.CovenantCheckRecordAddBo;
 import com.zhongzheng.modules.records.bo.CovenantCheckRecordQueryBo;
+import com.zhongzheng.modules.records.domain.CovenantCheckRecord;
 import com.zhongzheng.modules.records.service.ICovenantCheckRecordService;
 import com.zhongzheng.modules.records.vo.CovenantCheckRecordVo;
 import com.zhongzheng.modules.system.domain.SysTenant;
@@ -101,6 +102,28 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         List<BsCovenantVo> covenantVoArrayList = new ArrayList<>();
         if (!bsCovenantVos.isEmpty()) {
             bsCovenantVos.forEach(bsCovenantVo -> {
+                SysTenant tenantId = iSysTenantService.getById(ServletUtils.getRequest().getHeader("TenantId"));
+                String deliveryAddress = tenantId.getDeliveryAddress();
+                if (Validator.isNotEmpty(deliveryAddress)) {
+                    List<TenantCovenantInfoAddBo> tenantCovenantInfoAddBos = JSONArray.parseArray(deliveryAddress, TenantCovenantInfoAddBo.class);
+                    if (!tenantCovenantInfoAddBos.isEmpty()) {
+                        TenantCovenantInfoAddBo tenantCovenantInfoAddBo = tenantCovenantInfoAddBos.get(0);
+                        bsCovenantVo.setYiCompanyName(tenantId.getTenantName());
+                        bsCovenantVo.setYiCompanyAddress(tenantCovenantInfoAddBo.getYiCompanyAddress());
+                    }
+                }
+                CovenantCheckRecord covenantCheckRecord = new CovenantCheckRecord();
+                if (bsCovenantVo.getStatus()==4){
+                    covenantCheckRecord = iCovenantCheckRecordService.getOne(new LambdaQueryWrapper<CovenantCheckRecord>().eq(CovenantCheckRecord::getCovenantId, bsCovenantVo.getCovenantId())
+                            .eq(CovenantCheckRecord::getUserId, bo.getUserId()).eq(CovenantCheckRecord::getStatus, 1).eq(CovenantCheckRecord::getCheckStatus,1));
+                }
+                if (bsCovenantVo.getStopStatus()==3){
+                    covenantCheckRecord = iCovenantCheckRecordService.getOne(new LambdaQueryWrapper<CovenantCheckRecord>().eq(CovenantCheckRecord::getCovenantId, bsCovenantVo.getCovenantId())
+                            .eq(CovenantCheckRecord::getUserId, bo.getUserId()).eq(CovenantCheckRecord::getStatus, 1).eq(CovenantCheckRecord::getCheckStatus,2));
+                }
+                if (ObjectUtils.isNotNull(covenantCheckRecord)){
+                    bsCovenantVo.setCheckRecord(covenantCheckRecord.getCheckRecord());
+                }
                 bsCovenantVo.setCycleWarning(bo.getCycleWarning());
                 bsCovenantVo.setJiaCompanyName(iCompanyService.getById(bsCovenantVo.getCompanyId()).getCompanyName());
                 BsCovenantBusinessQueryBo bsCovenantBusinessQueryBo = new BsCovenantBusinessQueryBo();
@@ -122,7 +145,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                         Goods goods = iGoodsService.getById(bsCovenantGoodsVo.getGoodsId());
                         bsCovenantGoodsVo.setGoodsName(goods.getGoodsName());
                         Long majorId = goods.getMajorId();
-                        if (ObjectUtils.isNotNull(majorId)){
+                        if (ObjectUtils.isNotNull(majorId)) {
                             Major byId = iMajorService.getById(majorId);
                             bsCovenantGoodsVo.setMajorName(byId.getCategoryName());
                         }
@@ -209,10 +232,19 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
     @Override
     @Transactional
     public Boolean insertByAddBo(BsCovenantAddBo bo) {
+        List<BsCovenant> bsCovenants = this.list();
+        List<String> collect = bsCovenants.stream().map(BsCovenant::getCovenantNum).collect(Collectors.toList());
+        if (ObjectUtils.isNull(bo.getCovenantNum())) {
+            throw new CustomException("协议编号不能为空");
+        }
+        if (collect.contains(bo.getCovenantNum())) {
+            throw new CustomException("协议编号重复");
+        }
         BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
-        add.setFormApp(2L);
         String companyId = ServletUtils.getRequest().getHeader("companyId");
-        add.setCompanyId(Long.valueOf(companyId));
+        if (Validator.isNotEmpty(companyId)){
+            add.setCompanyId(Long.valueOf(companyId));
+        }
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
         SysTenant yiSysTenant = iSysTenantService.getOne(new LambdaQueryWrapper<SysTenant>().eq(SysTenant::getTenantId, ServletUtils.getRequest().getHeader("TenantId")));
@@ -223,12 +255,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         //写入协议审核流程
         SysTenant sysTenant = iSysTenantService.getById(ServletUtils.getRequest().getHeader("TenantId"));
         if (ObjectUtils.isNotNull(sysTenant)) {
-            List<String> list = Arrays.asList(sysTenant.getAppList());
-            list.forEach(item -> {
-                BsCovenantCheckAddBo bsCovenantCheckAddBo = new BsCovenantCheckAddBo();
-                bsCovenantCheckAddBo.setCovenantId(newBsCovenant.getCovenantId());
-                bsCovenantCheckAddBo.setCompanyId(Long.valueOf(companyId));
-                List<String> list1 = Arrays.asList(item.split(","));
+            BsCovenantCheckAddBo bsCovenantCheckAddBo = new BsCovenantCheckAddBo();
+            bsCovenantCheckAddBo.setCovenantId(newBsCovenant.getCovenantId());
+            bsCovenantCheckAddBo.setCompanyId(Long.valueOf(companyId));
+            if (!sysTenant.getAppList().isEmpty()) {
+                List<String> list1 = Arrays.asList(sysTenant.getAppList().split(","));
                 List<Long> longList = list1.stream().map(Long::parseLong).collect(Collectors.toList());
                 longList.forEach(num -> {
                     bsCovenantCheckAddBo.setAppId(num);
@@ -247,7 +278,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                     bsCovenantCheckAddBo.setUpdateTime(DateUtils.getNowTime());
                     iBsCovenantCheckService.insertByAddBo(bsCovenantCheckAddBo);
                 });
-            });
+            }
         }
         if (Validator.isNotEmpty(bo.getCopyCovenantNum())) {
             BsCovenant bs = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCopyCovenantNum()).eq(BsCovenant::getStatus, 1));
@@ -273,13 +304,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
                             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
                             iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
-                            if (!bsCovenantBusinessAddBo.getBsCovenantGoods().isEmpty()) {
+                            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.getBsCovenantGoods().forEach(bsCovenantGoodsAddBo -> {
+                                bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
                                     bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
                                     bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
                                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
@@ -290,7 +321,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                         });
                     }
                 }
-            }else {
+            } else {
                 throw new CustomException("请选择是否复制协议数据");
             }
         }
@@ -302,13 +333,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
             bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
             bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
             iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
-            if (!bsCovenantBusinessAddBo.getBsCovenantGoods().isEmpty()) {
+            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.getBsCovenantGoods().forEach(bsCovenantGoodsAddBo -> {
+                bsCovenantBusinessAddBo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsAddBo -> {
                     bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
                     bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
                     bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
@@ -327,130 +358,141 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
     @Override
     @Transactional
     public Boolean insertYXTByAddBo(BsCovenantAddBo bo) {
-        if (bo.getCovenantId() != null) {
+        if (bo.getFormApp()!=null&&bo.getFormApp()==3L){
+            if (bo.getUserId()==null){
+                throw new CustomException("创建用户不能为空");
+            }
+        }
+        if (bo.getFormApp()!=null&&bo.getFormApp()==1L&&bo.getCovenantId() != null) {
             BsCovenantVo bsCovenantVo = this.queryById(bo.getCovenantId());
             this.update(new LambdaUpdateWrapper<BsCovenant>().set(BsCovenant::getStatus, 7).eq(BsCovenant::getCovenantId, bsCovenantVo.getCovenantId()));
             iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, bsCovenantVo.getCovenantId()));
             iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().eq(BsCovenantGoods::getCovenantId, bsCovenantVo.getCovenantId()).set(BsCovenantGoods::getStatus, 0));
-        } else {
-            BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
-            if (ObjectUtils.isNotNull(bo.getCompanyId())) {
-                Company byId = iCompanyService.getById(bo.getCompanyId());
-                add.setJiaCompanyAddress(byId.getCompanyAddress());
-                add.setJiaCompanyContract(byId.getCompanyContacts());
-                add.setJiaCompanyPhone(byId.getContactPhone());
-            }
-            String companyId = ServletUtils.getRequest().getHeader("companyId");
-            if (Validator.isNotEmpty(companyId)) {
-                add.setCompanyId(Long.valueOf(companyId));
-            }
-            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)) {
-                List<String> list = Arrays.asList(sysTenant.getAppList());
-                list.forEach(item -> {
-                    BsCovenantCheckAddBo bsCovenantCheckAddBo = new BsCovenantCheckAddBo();
-                    bsCovenantCheckAddBo.setCovenantId(newBsCovenant.getCovenantId());
-                    bsCovenantCheckAddBo.setCompanyId(bo.getCompanyId());
-                    List<String> list1 = Arrays.asList(item.split(","));
-                    List<Long> longList = list1.stream().map(Long::parseLong).collect(Collectors.toList());
-                    longList.forEach(num -> {
-                        bsCovenantCheckAddBo.setAppId(num);
-                        if (num == 1L) {
-                            bsCovenantCheckAddBo.setSort(4);
-                        } else if (num == 2L) {
-                            bsCovenantCheckAddBo.setSort(1);
-                        } else if (num == 3L) {
-                            bsCovenantCheckAddBo.setSort(2);
-                        } else if (num == 4L) {
-                            bsCovenantCheckAddBo.setCurrentStatus(1);
-                            bsCovenantCheckAddBo.setSort(3);
-                        }
-                        bsCovenantCheckAddBo.setStatus(1);
-                        bsCovenantCheckAddBo.setCreateTime(DateUtils.getNowTime());
-                        bsCovenantCheckAddBo.setUpdateTime(DateUtils.getNowTime());
-                        iBsCovenantCheckService.insertByAddBo(bsCovenantCheckAddBo);
-                    });
+        }
+        List<BsCovenant> bsCovenants = this.list(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getFormApp,bo.getFormApp()));
+        List<String> collect = bsCovenants.stream().map(BsCovenant::getCovenantNum).collect(Collectors.toList());
+        if (ObjectUtils.isNull(bo.getCovenantNum())) {
+            throw new CustomException("协议编号不能为空");
+        }
+        if (collect.contains(bo.getCovenantNum())) {
+            throw new CustomException("协议编号重复");
+        }
+        BsCovenant add = BeanUtil.toBean(bo, BsCovenant.class);
+        if (ObjectUtils.isNotNull(bo.getCompanyId())) {
+            Company byId = iCompanyService.getById(bo.getCompanyId());
+            add.setJiaCompanyAddress(byId.getCompanyAddress());
+            add.setJiaCompanyContract(byId.getCompanyContacts());
+            add.setJiaCompanyPhone(byId.getContactPhone());
+        }
+        String companyId = ServletUtils.getRequest().getHeader("companyId");
+        if (Validator.isNotEmpty(companyId)) {
+            add.setCompanyId(Long.valueOf(companyId));
+        }
+        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.setCompanyId(bo.getCompanyId());
+            if (!sysTenant.getAppList().isEmpty()) {
+                List<String> list1 = Arrays.asList(sysTenant.getAppList().split(","));
+                List<Long> longList = list1.stream().map(Long::parseLong).collect(Collectors.toList());
+                longList.forEach(num -> {
+                    bsCovenantCheckAddBo.setAppId(num);
+                    if (num == 1L) {
+                        bsCovenantCheckAddBo.setSort(4);
+                    } else if (num == 2L) {
+                        bsCovenantCheckAddBo.setSort(1);
+                    } else if (num == 3L) {
+                        bsCovenantCheckAddBo.setSort(2);
+                    } else if (num == 4L) {
+                        bsCovenantCheckAddBo.setCurrentStatus(1);
+                        bsCovenantCheckAddBo.setSort(3);
+                    }
+                    bsCovenantCheckAddBo.setStatus(1);
+                    bsCovenantCheckAddBo.setCreateTime(DateUtils.getNowTime());
+                    bsCovenantCheckAddBo.setUpdateTime(DateUtils.getNowTime());
+                    iBsCovenantCheckService.insertByAddBo(bsCovenantCheckAddBo);
                 });
             }
-            if (Validator.isNotEmpty(bo.getCopyCovenantNum())) {
-                BsCovenant bs = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCopyCovenantNum()).eq(BsCovenant::getStatus, 1));
-                if (ObjectUtils.isNotNull(bo.getCopyStatus())) {
-                    if (bo.getCopyStatus() == 1) {
-                        //复制协议时删除复制协议相关信息
-                        if (ObjectUtils.isNotNull(bs)) {
-                            bs.setStatus(0);
-                            this.updateById(bs);
-                            iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, bs.getCovenantId()));
-                            iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().eq(BsCovenantGoods::getCovenantId, bs.getCovenantId()).set(BsCovenantGoods::getStatus, 0));
-                        } else {
-                            throw new CustomException("当前协议不存在");
-                        }
-                    } else if (bo.getCopyStatus() == 0) {
-                        if (!bo.getBsCovenantBusinessList().isEmpty()) {
-                            //写入协议业务类型
-                            bo.getBsCovenantBusinessList().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.setCompanyId(bo.getCompanyId());
-                                bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
-                                bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
-                                iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
-                                if (!bsCovenantBusinessAddBo.getBsCovenantGoods().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.getBsCovenantGoods().forEach(bsCovenantGoodsAddBo-> {
-                                        bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
-                                        bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
-                                        bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
-                                        bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
-                                        bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
-                                        iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
-                                    });
-                                }
-                            });
-                        }
+        }
+        if (Validator.isNotEmpty(bo.getCopyCovenantNum())) {
+            BsCovenant bs = this.getOne(new LambdaQueryWrapper<BsCovenant>().eq(BsCovenant::getCovenantNum, bo.getCopyCovenantNum()).eq(BsCovenant::getStatus, 1));
+            if (ObjectUtils.isNotNull(bo.getCopyStatus())) {
+                if (bo.getCopyStatus() == 1) {
+                    //复制协议时删除复制协议相关信息
+                    if (ObjectUtils.isNotNull(bs)) {
+                        bs.setStatus(0);
+                        this.updateById(bs);
+                        iBsCovenantBusinessService.update(new LambdaUpdateWrapper<BsCovenantBusiness>().set(BsCovenantBusiness::getStatus, 0).eq(BsCovenantBusiness::getCovenantId, bs.getCovenantId()));
+                        iBsCovenantGoodsService.update(new LambdaUpdateWrapper<BsCovenantGoods>().eq(BsCovenantGoods::getCovenantId, bs.getCovenantId()).set(BsCovenantGoods::getStatus, 0));
+                    } else {
+                        throw new CustomException("当前协议不存在");
+                    }
+                } else if (bo.getCopyStatus() == 0) {
+                    if (!bo.getBsCovenantBusinessList().isEmpty()) {
+                        //写入协议业务类型
+                        bo.getBsCovenantBusinessList().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.setCompanyId(bo.getCompanyId());
+                            bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
+                            bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
+                            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.setCompanyId(bo.getCompanyId());
+                                    bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
+                                    bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
+                                    iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
+                                });
+                            }
+                        });
                     }
-                }else {
-                    throw new CustomException("请选择是否复制协议数据");
                 }
+            } else {
+                throw new CustomException("请选择是否复制协议数据");
             }
-            bo.getBsCovenantBusinessList().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.setCompanyId(bo.getCompanyId());
-                bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
-                bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
-                iBsCovenantBusinessService.insertByAddBo(bsCovenantBusinessAddBo);
-                if (!bsCovenantBusinessAddBo.getBsCovenantGoods().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.getBsCovenantGoods().forEach(bsCovenantGoodsAddBo -> {
-                        bsCovenantGoodsAddBo.setCovenantId(newBsCovenant.getCovenantId());
-                        bsCovenantGoodsAddBo.setCompanyId(bo.getCompanyId());
-                        bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
-                        bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
-                        bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
-                        iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
-                    });
-                }
-            });
         }
+        bo.getBsCovenantBusinessList().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.setCompanyId(bo.getCompanyId());
+            bsCovenantBusinessAddBo.setCreateTime(DateUtils.getNowTime());
+            bsCovenantBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
+            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.setCompanyId(bo.getCompanyId());
+                    bsCovenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
+                    bsCovenantGoodsAddBo.setCreateTime(DateUtils.getNowTime());
+                    bsCovenantGoodsAddBo.setUpdateTime(DateUtils.getNowTime());
+                    iBsCovenantGoodsService.insertByAddBo(bsCovenantGoodsAddBo);
+                });
+            }
+        });
         return true;
     }
 
@@ -523,9 +565,9 @@ 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(bsCovenantBusinessVo -> {
+                                bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessVo -> {
                                     CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessVo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
                                     BsCovenantBusinessAddBo covenantBusiness = BeanUtil.toBean(bsCovenantBusinessVo, BsCovenantBusinessAddBo.class);
                                     covenantBusiness.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
@@ -533,13 +575,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                                     covenantBusiness.setCreateTime(DateUtils.getNowTime());
                                     covenantBusiness.setUpdateTime(DateUtils.getNowTime());
                                     iBsCovenantBusinessService.insertByAddBo(covenantBusiness);
-                                    if (!bsCovenantBusinessVo.getBsCovenantGoods().isEmpty()) {
+                                    if (!bsCovenantBusinessVo.getBsCovenantGoodsVos().isEmpty()) {
                                         BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, bsCovenantBusinessVo.getBusinessId())
                                                 .eq(BsCovenantBusiness::getEducationTypeId, bsCovenantBusinessVo.getEducationTypeId())
                                                 .eq(BsCovenantBusiness::getProjectId, bsCovenantBusinessVo.getProjectId())
                                                 .eq(BsCovenantBusiness::getStatus, 1));
                                         //写入协议业务类型有关商品
-                                        bsCovenantBusinessVo.getBsCovenantGoods().forEach(bsCovenantGoodsVo -> {
+                                        bsCovenantBusinessVo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsVo -> {
                                             BsCovenantGoodsAddBo covenantGoodsAddBo = BeanUtil.toBean(bsCovenantGoodsVo, BsCovenantGoodsAddBo.class);
                                             covenantGoodsAddBo.setCovenantId(bo.getCovenantId());
                                             covenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
@@ -551,11 +593,11 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                                 });
                             }
                         }
-                    }else {
+                    } else {
                         throw new CustomException("请选择是否复制协议数据");
                     }
                 }
-                bo.getBsCovenantBusinessList().forEach(bsCovenantBusinessVo -> {
+                bo.getBsCovenantBusinessVos().forEach(bsCovenantBusinessVo -> {
                     CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, bsCovenantBusinessVo.getBusinessId()).eq(CourseBusiness::getStatus, 1));
                     BsCovenantBusinessAddBo covenantBusiness = BeanUtil.toBean(bsCovenantBusinessVo, BsCovenantBusinessAddBo.class);
                     covenantBusiness.setProjectId(Long.valueOf(courseBusiness.getProjectId()));
@@ -563,13 +605,13 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
                     covenantBusiness.setCreateTime(DateUtils.getNowTime());
                     covenantBusiness.setUpdateTime(DateUtils.getNowTime());
                     iBsCovenantBusinessService.insertByAddBo(covenantBusiness);
-                    if (!bsCovenantBusinessVo.getBsCovenantGoods().isEmpty()) {
+                    if (!bsCovenantBusinessVo.getBsCovenantGoodsVos().isEmpty()) {
                         BsCovenantBusiness bsCovenantBusiness = iBsCovenantBusinessService.getOne(new LambdaQueryWrapper<BsCovenantBusiness>().eq(BsCovenantBusiness::getBusinessId, covenantBusiness.getBusinessId())
                                 .eq(BsCovenantBusiness::getEducationTypeId, covenantBusiness.getEducationTypeId())
                                 .eq(BsCovenantBusiness::getProjectId, covenantBusiness.getProjectId())
                                 .eq(BsCovenantBusiness::getStatus, 1));
                         //写入协议业务类型有关商品
-                        bsCovenantBusinessVo.getBsCovenantGoods().forEach(bsCovenantGoodsVo -> {
+                        bsCovenantBusinessVo.getBsCovenantGoodsVos().forEach(bsCovenantGoodsVo -> {
                             BsCovenantGoodsAddBo covenantGoodsAddBo = BeanUtil.toBean(bsCovenantGoodsVo, BsCovenantGoodsAddBo.class);
                             covenantGoodsAddBo.setCovenantId(bo.getCovenantId());
                             covenantGoodsAddBo.setCovenantBusinessId(bsCovenantBusiness.getCovenantBusinessId());
@@ -609,7 +651,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
     }
 
     @Override
-    public String getJudgeBusiness(Long businessId,Long userId) {
+    public String getJudgeBusiness(Long businessId, Long userId) {
         CourseBusiness courseBusiness = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getId, businessId).eq(CourseBusiness::getStatus, 1));
         return iBsCovenantBusinessService.getCovenantNumByProjectId(Long.valueOf(courseBusiness.getProjectId()), userId, courseBusiness.getId());
 
@@ -632,7 +674,7 @@ public class BsCovenantServiceImpl extends ServiceImpl<BsCovenantMapper, BsCoven
         }
         BsCovenantExportVo bean = BeanUtil.toBean(bsCovenantVo, BsCovenantExportVo.class);
         String zhiyuan = System.getProperty("user.dir");
-        String toPath = zhiyuan + "/zhongzheng-admin-business/src/main/resources/" +DateUtils.getNowTime()+ "培训服务协议" + ".pdf";
+        String toPath = zhiyuan + "/zhongzheng-admin-business/src/main/resources/" + DateUtils.getNowTime() + "培训服务协议" + ".pdf";
         String uploadPdf = null;
         //生成协议pdf文件
         PdfUtils.downloadPdf(bean, toPath, sysTenantAccountVo);

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bs/covenant/vo/BsCovenantVo.java

@@ -120,6 +120,10 @@ public class BsCovenantVo {
 	@Excel(name = "乙方企业名称")
 	@ApiModelProperty("乙方企业名称")
 	private String yiCompanyName;
+	/** 乙方企业名称 */
+	@Excel(name = "乙方企业名称")
+	@ApiModelProperty("乙方企业名称")
+	private String yiCompanyAddress;
 	/** 乙方企业联系人 */
 	@Excel(name = "乙方企业联系人")
 	@ApiModelProperty("乙方企业联系人")
@@ -140,6 +144,10 @@ public class BsCovenantVo {
 	@Excel(name = "乙方收件电话")
 	@ApiModelProperty("乙方收件电话")
 	private String yiRecipientsPhone;
+	/** 创建时间 */
+	@Excel(name = "创建时间")
+	@ApiModelProperty("创建时间")
+	private Long createTime;
 	/** 乙方收件备注 */
 	@Excel(name = "乙方收件备注")
 	@ApiModelProperty("乙方收件备注")
@@ -155,4 +163,19 @@ public class BsCovenantVo {
 	@ApiModelProperty("开户账号")
 	@Excel(name = "开户账号")
 	private String proceedsAccount;
+	@ApiModelProperty("协议审核意见")
+	@Excel(name = "协议审核意见")
+	private String checkRecord;
+	/** 业务员id */
+	@ApiModelProperty("业务员id")
+	@Excel(name = "业务员id")
+	private Long saleId;
+	/** 业务员编号 */
+	@ApiModelProperty("业务员编号")
+	@Excel(name = "业务员编号")
+	private String saleNum;
+	/** 业务员姓名 */
+	@ApiModelProperty("业务员姓名")
+	@Excel(name = "业务员姓名")
+	private String saleName;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -343,6 +343,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             }
         }
         list.forEach(goods -> {
+
 //            if (ObjectUtils.isNotNull(goods.getSpecTemplateId()) &&
 //                    goodsSpecTemplateService.count(new LambdaQueryWrapper<GoodsSpecTemplate>()
 //                            .eq(GoodsSpecTemplate::getSpecTemplateId,goods.getSpecTemplateId())

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordAddBo.java

@@ -30,6 +30,9 @@ public class CovenantCheckRecordAddBo {
     /** 状态 1有效 0无效 */
     @ApiModelProperty("状态 1有效 0无效")
     private Long status;
+    /** 审核不通过状态 1:正常审核不通过 2:终止申请不通过 */
+    @ApiModelProperty("审核不通过状态 1:正常审核不通过 2:终止申请不通过")
+    private Long checkStatus;
     /** 创建时间 */
     @ApiModelProperty("创建时间")
     private Long createTime;

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordEditBo.java

@@ -33,7 +33,9 @@ public class CovenantCheckRecordEditBo {
     /** 审核记录 */
     @ApiModelProperty("审核记录")
     private String checkRecord;
-
+    /** 审核不通过状态 1:正常审核不通过 2:终止申请不通过 */
+    @ApiModelProperty("审核不通过状态 1:正常审核不通过 2:终止申请不通过")
+    private Long checkStatus;
     /** 状态 1有效 0无效 */
     @ApiModelProperty("状态 1有效 0无效")
     private Long status;

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/records/bo/CovenantCheckRecordQueryBo.java

@@ -48,4 +48,7 @@ public class CovenantCheckRecordQueryBo extends BaseEntity {
 	/** 状态 1有效 0无效 */
 	@ApiModelProperty("状态 1有效 0无效")
 	private Long status;
+	/** 审核不通过状态 1:正常审核不通过 2:终止申请不通过 */
+	@ApiModelProperty("审核不通过状态 1:正常审核不通过 2:终止申请不通过")
+	private Long checkStatus;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/records/domain/CovenantCheckRecord.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.records.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -34,6 +35,8 @@ private static final long serialVersionUID=1L;
     private String checkRecord;
     /** 状态 1有效 0无效 */
     private Long status;
+    /** 审核不通过状态 1:正常审核不通过 2:终止申请不通过 */
+    private Long checkStatus;
     /** 创建时间 */
     @TableField(fill = FieldFill.INSERT)
     private Long createTime;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/records/vo/CovenantCheckRecordVo.java

@@ -40,4 +40,8 @@ public class CovenantCheckRecordVo {
 	@Excel(name = "状态 1有效 0无效")
 	@ApiModelProperty("状态 1有效 0无效")
 	private Long status;
+	/** 审核不通过状态 1:正常审核不通过 2:终止申请不通过 */
+	@ApiModelProperty("审核不通过状态 1:正常审核不通过 2:终止申请不通过")
+	@Excel(name = "审核不通过状态 1:正常审核不通过 2:终止申请不通过")
+	private Long checkStatus;
 }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/company/CompanyMapper.xml

@@ -28,6 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="fatherId" column="father_id"/>
         <result property="status" column="status"/>
         <result property="formId" column="form_id"/>
+        <result property="saleId" column="sale_id"/>
+        <result property="saleCompanyId" column="sale_company_id"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
@@ -55,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="fatherId" column="father_id"/>
         <result property="status" column="status"/>
         <result property="formId" column="form_id"/>
+        <result property="saleCompanyId" column="sale_company_id"/>
+        <result property="saleId" column="sale_id"/>
     </resultMap>
 <select id="selectCompanyList" parameterType="com.zhongzheng.modules.bs.company.domain.Company" resultMap="CompanyVoResult">
     select * from bs_company where status=1 and father_id=#{fatherId}

+ 8 - 1
zhongzheng-system/src/main/resources/mapper/modules/covenant/BsCovenantMapper.xml

@@ -38,6 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="openingBank" column="opening_bank"/>
         <result property="openingName" column="opening_name"/>
         <result property="proceedsAccount" column="proceeds_account"/>
+        <result property="saleId" column="sale_id"/>
+        <result property="saleNum" column="sale_num"/>
+        <result property="saleName" column="sale_name"/>
     </resultMap>
     <resultMap type="com.zhongzheng.modules.bs.covenant.vo.BsCovenantVo" id="BsCovenantVoResult">
         <result property="covenantId" column="covenant_id"/>
@@ -70,9 +73,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="yiRecipientsAddress" column="yi_recipients_address"/>
         <result property="yiRecipientsPhone" column="yi_recipients_phone"/>
         <result property="yiRecipientsRemark" column="yi_recipients_remark"/>
+        <result property="createTime" column="create_time"/>
         <result property="openingBank" column="opening_bank"/>
         <result property="openingName" column="opening_name"/>
         <result property="proceedsAccount" column="proceeds_account"/>
+        <result property="saleId" column="sale_id"/>
+        <result property="saleNum" column="sale_num"/>
+        <result property="saleName" column="sale_name"/>
     </resultMap>
 <select id="selectByCovenantId" parameterType="com.zhongzheng.modules.bs.covenant.bo.BsCovenantQueryBo" resultMap="BsCovenantVoResult">
     select distinct bc.* from
@@ -82,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and bc.covenant_id=#{covenantId}
     </if>
     <if test="searchKey !=null and searchKey !=''">
-        and bc.jia_company_name=#{searchKey} or bc.covenant_num=#{searchKey}
+        and bc.jia_company_name=#{searchKey} or bc.covenant_num=#{searchKey} or bc.sale_id=#{searchKey} or bc.sale_name=#{searchKey} or bc.sale_num=#{searchKey}
     </if>
     <if test="listType == 2">
         and bc.stop_status!=0 and bc.stop_status!=2

+ 1 - 2
zhongzheng-system/src/main/resources/mapper/modules/covenant/CovenantCheckRecordMapper.xml

@@ -10,9 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="userId" column="user_id"/>
         <result property="checkRecord" column="check_record"/>
         <result property="status" column="status"/>
+        <result property="checkStatus" column="check_status"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
-
-
 </mapper>