Ver código fonte

合同管理

chenc 3 anos atrás
pai
commit
1f95280a19
47 arquivos alterados com 3444 adições e 21 exclusões
  1. 18 18
      src/main/java/org/jeecg/common/util/ProductAuthUtil.java
  2. 325 0
      src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileClassificationController.java
  3. 237 0
      src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileModularController.java
  4. 344 0
      src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileProductController.java
  5. 8 2
      src/main/java/org/jeecg/modules/basedata/controller/BaseSalesStatusController.java
  6. 25 0
      src/main/java/org/jeecg/modules/basedata/controller/FdCustomerContactsController.java
  7. 61 0
      src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileClassification.java
  8. 64 0
      src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileModular.java
  9. 77 0
      src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileProduct.java
  10. 17 0
      src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileClassificationMapper.java
  11. 17 0
      src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileModularMapper.java
  12. 17 0
      src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileProductMapper.java
  13. 5 0
      src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileClassificationMapper.xml
  14. 5 0
      src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileModularMapper.xml
  15. 5 0
      src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileProductMapper.xml
  16. 119 0
      src/main/java/org/jeecg/modules/basedata/model/BaseMaterialFileClassificationTree.java
  17. 14 0
      src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileClassificationService.java
  18. 14 0
      src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileModularService.java
  19. 40 0
      src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileProductService.java
  20. 19 0
      src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileClassificationServiceImpl.java
  21. 19 0
      src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileModularServiceImpl.java
  22. 88 0
      src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileProductServiceImpl.java
  23. 1 1
      src/main/java/org/jeecg/modules/basedata/service/impl/FdCustomerServiceImpl.java
  24. 237 0
      src/main/java/org/jeecg/modules/contract/file/controller/ContractFileAndBusinessController.java
  25. 332 0
      src/main/java/org/jeecg/modules/contract/file/controller/ContractFileController.java
  26. 237 0
      src/main/java/org/jeecg/modules/contract/file/controller/ContractFileModularController.java
  27. 237 0
      src/main/java/org/jeecg/modules/contract/file/controller/ContractFileProductController.java
  28. 150 0
      src/main/java/org/jeecg/modules/contract/file/entity/ContractFile.java
  29. 127 0
      src/main/java/org/jeecg/modules/contract/file/entity/ContractFileAndBusiness.java
  30. 73 0
      src/main/java/org/jeecg/modules/contract/file/entity/ContractFileModular.java
  31. 92 0
      src/main/java/org/jeecg/modules/contract/file/entity/ContractFileProduct.java
  32. 17 0
      src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileAndBusinessMapper.java
  33. 17 0
      src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileMapper.java
  34. 17 0
      src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileModularMapper.java
  35. 17 0
      src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileProductMapper.java
  36. 5 0
      src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileAndBusinessMapper.xml
  37. 5 0
      src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileMapper.xml
  38. 5 0
      src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileModularMapper.xml
  39. 5 0
      src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileProductMapper.xml
  40. 14 0
      src/main/java/org/jeecg/modules/contract/file/service/IContractFileAndBusinessService.java
  41. 14 0
      src/main/java/org/jeecg/modules/contract/file/service/IContractFileModularService.java
  42. 14 0
      src/main/java/org/jeecg/modules/contract/file/service/IContractFileProductService.java
  43. 48 0
      src/main/java/org/jeecg/modules/contract/file/service/IContractFileService.java
  44. 19 0
      src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileAndBusinessServiceImpl.java
  45. 19 0
      src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileModularServiceImpl.java
  46. 19 0
      src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileProductServiceImpl.java
  47. 185 0
      src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileServiceImpl.java

+ 18 - 18
src/main/java/org/jeecg/common/util/ProductAuthUtil.java

@@ -30,24 +30,24 @@ public class ProductAuthUtil {
 	 * @return
 	 */
 	public static boolean verify(){
-		if (isValid && DateUtils.dateDiff('h', DateUtils.getCalendar(), validDate)<VALID_HOUR){
-			return true;
-		}
-		JSONObject reqParam = new JSONObject();
-		reqParam.put("productionCode", "FB896F1965907B9A9ED1BB2F0629A9C8");
-		reqParam.put("computerInfo", JSON.toJSONString(HardwareUtil.get()));
-		String respParam = HttpUtils.sendPost("http://renzheng.cuidiansoft.com:8011/cuidian/pa/device/verify", JSON.toJSONString(reqParam), true);
-		JSONObject respObject = JSON.parseObject(respParam);
-		boolean success =  respObject.getBoolean("success");
-		if (success){
-			isValid = true;
-			validDate = DateUtils.getCalendar();
-		}else{
-			isValid = false;
-		}
-
-		return success;
-
+//		if (isValid && DateUtils.dateDiff('h', DateUtils.getCalendar(), validDate)<VALID_HOUR){
+//			return true;
+//		}
+//		JSONObject reqParam = new JSONObject();
+//		reqParam.put("productionCode", "FB896F1965907B9A9ED1BB2F0629A9C8");
+//		reqParam.put("computerInfo", JSON.toJSONString(HardwareUtil.get()));
+//		String respParam = HttpUtils.sendPost("http://renzheng.cuidiansoft.com:8011/cuidian/pa/device/verify", JSON.toJSONString(reqParam), true);
+//		JSONObject respObject = JSON.parseObject(respParam);
+//		boolean success =  respObject.getBoolean("success");
+//		if (success){
+//			isValid = true;
+//			validDate = DateUtils.getCalendar();
+//		}else{
+//			isValid = false;
+//		}
+//
+//		return success;
+return true;
 
 	}
 }

+ 325 - 0
src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileClassificationController.java

@@ -0,0 +1,325 @@
+package org.jeecg.modules.basedata.controller;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileClassification;
+import org.jeecg.modules.basedata.model.BaseMaterialFileClassificationTree;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileClassificationService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 物料档案分类
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/basedata/baseMaterialFileClassification")
+@Slf4j
+public class BaseMaterialFileClassificationController {
+	@Autowired
+	private IBaseMaterialFileClassificationService baseMaterialFileClassificationService;
+	
+	/**
+	  * 分页列表查询
+	 * @param baseMaterialFileClassification
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BaseMaterialFileClassification>> queryPageList(BaseMaterialFileClassification baseMaterialFileClassification,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<BaseMaterialFileClassification>> result = new Result<IPage<BaseMaterialFileClassification>>();
+		QueryWrapper<BaseMaterialFileClassification> queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileClassification, req.getParameterMap());
+		Page<BaseMaterialFileClassification> page = new Page<BaseMaterialFileClassification>(pageNo, pageSize);
+		IPage<BaseMaterialFileClassification> pageList = baseMaterialFileClassificationService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 获取物料分类树形
+	* @Date 2021/11/16 14:24
+	* @Param [pkOrg]
+	* @return org.jeecg.common.api.vo.Result<java.util.List<org.jeecg.modules.basedata.model.BaseMaterialFileClassificationTree>>
+	*/
+	 @GetMapping(value = "/getTreeList")
+	 public Result<List<BaseMaterialFileClassificationTree>> getTreeList(String pkOrg) {
+		 Result<List<BaseMaterialFileClassificationTree>> result = new Result<>();
+		 try {
+			 QueryWrapper<BaseMaterialFileClassification> queryWrapper = new QueryWrapper<>();
+			 queryWrapper.lambda().eq(BaseMaterialFileClassification::getPkOrg,pkOrg);
+			 queryWrapper.lambda().eq(BaseMaterialFileClassification::getDelFlag,"0");
+			 queryWrapper.lambda().orderByAsc(BaseMaterialFileClassification::getSort);
+			 List<BaseMaterialFileClassification> list = baseMaterialFileClassificationService.list(queryWrapper);
+			 List<BaseMaterialFileClassificationTree> treeList=new ArrayList<>();
+			 getTree(treeList,list,null);
+			 findLeaf(treeList);
+			 result.setResult(treeList);
+			 result.success("操作成功");
+		 } catch (Exception e) {
+			 e.printStackTrace();
+			 result.error500("操作失败:"+e.getMessage());
+		 }
+		 return result;
+	 }
+
+	 //处理树形格式
+	 private void getTree(List<BaseMaterialFileClassificationTree> treeList, List<BaseMaterialFileClassification> fdlist, BaseMaterialFileClassificationTree temp) {
+		 int i = 0;
+		 for (BaseMaterialFileClassification baseMaterialFileClassification : fdlist) {
+			 String tempPid = baseMaterialFileClassification.getParentId();
+			 BaseMaterialFileClassificationTree tree = new BaseMaterialFileClassificationTree(baseMaterialFileClassification);
+			 if(temp == null) {
+				 if(oConvertUtils.isEmpty(tempPid)){
+					 treeList.add(tree);
+				 }
+				 if(!tree.getIsLeaf()) {
+					 getTree(treeList, fdlist, tree);
+				 }
+			 }else if(tempPid != null && tempPid.equals(temp.getKey())){
+				 temp.getChildren().add(tree);
+				 if(!tree.getIsLeaf()) {
+					 getTree(treeList, fdlist, tree);
+				 }
+			 }
+
+		 }
+	 }
+
+	 //处理尾端
+	 private void findLeaf(List<BaseMaterialFileClassificationTree> treeList){
+		 for(BaseMaterialFileClassificationTree tree : treeList){
+			 if(tree.getChildren().isEmpty()){
+				 tree.setIsLeaf(true);
+			 }else{
+				 findLeaf(tree.getChildren());
+			 }
+		 }
+
+	 }
+	
+	/**
+	  *   添加
+	 * @param baseMaterialFileClassification
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BaseMaterialFileClassification> add(@RequestBody BaseMaterialFileClassification baseMaterialFileClassification) {
+		Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+		try {
+			baseMaterialFileClassificationService.save(baseMaterialFileClassification);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param baseMaterialFileClassification
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BaseMaterialFileClassification> edit(@RequestBody BaseMaterialFileClassification baseMaterialFileClassification) {
+		Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+		BaseMaterialFileClassification baseMaterialFileClassificationEntity = baseMaterialFileClassificationService.getById(baseMaterialFileClassification.getId());
+		if(baseMaterialFileClassificationEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseMaterialFileClassificationService.updateById(baseMaterialFileClassification);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+//	/**
+//	  *   通过id删除
+//	 * @param id
+//	 * @return
+//	 */
+//	@DeleteMapping(value = "/delete")
+//	public Result<BaseMaterialFileClassification> delete(@RequestParam(name="id",required=true) String id) {
+//		Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+//		BaseMaterialFileClassification baseMaterialFileClassification = baseMaterialFileClassificationService.getById(id);
+//		if(baseMaterialFileClassification==null) {
+//			result.error500("未找到对应实体");
+//		}else {
+//			boolean ok = baseMaterialFileClassificationService.removeById(id);
+//			if(ok) {
+//				result.success("删除成功!");
+//			}
+//		}
+//
+//		return result;
+//	}
+
+
+	 /**
+	  *   通过id删除
+	  * @param id
+	  * @return
+	  */
+	 @DeleteMapping(value = "/delete")
+	 public Result<BaseMaterialFileClassification> delete(@RequestParam(name="id",required=true) String id) {
+		 Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+		 BaseMaterialFileClassification baseMaterialFileClassification = baseMaterialFileClassificationService.getById(id);
+		 if(baseMaterialFileClassification==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 baseMaterialFileClassification.setDelFlag("1");
+			 boolean ok = baseMaterialFileClassificationService.updateById(baseMaterialFileClassification);
+			 if(ok) {
+				 result.success("删除成功!");
+			 }
+		 }
+
+		 return result;
+	 }
+
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BaseMaterialFileClassification> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.baseMaterialFileClassificationService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<BaseMaterialFileClassification> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BaseMaterialFileClassification> result = new Result<BaseMaterialFileClassification>();
+		BaseMaterialFileClassification baseMaterialFileClassification = baseMaterialFileClassificationService.getById(id);
+		if(baseMaterialFileClassification==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(baseMaterialFileClassification);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<BaseMaterialFileClassification> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              BaseMaterialFileClassification baseMaterialFileClassification = JSON.parseObject(deString, BaseMaterialFileClassification.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileClassification, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<BaseMaterialFileClassification> pageList = baseMaterialFileClassificationService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "物料档案分类列表");
+      mv.addObject(NormalExcelConstants.CLASS, BaseMaterialFileClassification.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("物料档案分类列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BaseMaterialFileClassification> listBaseMaterialFileClassifications = ExcelImportUtil.importExcel(file.getInputStream(), BaseMaterialFileClassification.class, params);
+              for (BaseMaterialFileClassification baseMaterialFileClassificationExcel : listBaseMaterialFileClassifications) {
+                  baseMaterialFileClassificationService.save(baseMaterialFileClassificationExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listBaseMaterialFileClassifications.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 237 - 0
src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileModularController.java

@@ -0,0 +1,237 @@
+package org.jeecg.modules.basedata.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileModularService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 物料档案模块
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/basedata/baseMaterialFileModular")
+@Slf4j
+public class BaseMaterialFileModularController {
+	@Autowired
+	private IBaseMaterialFileModularService baseMaterialFileModularService;
+	
+	/**
+	  * 分页列表查询
+	 * @param baseMaterialFileModular
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BaseMaterialFileModular>> queryPageList(BaseMaterialFileModular baseMaterialFileModular,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<BaseMaterialFileModular>> result = new Result<IPage<BaseMaterialFileModular>>();
+		QueryWrapper<BaseMaterialFileModular> queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileModular, req.getParameterMap());
+		Page<BaseMaterialFileModular> page = new Page<BaseMaterialFileModular>(pageNo, pageSize);
+		IPage<BaseMaterialFileModular> pageList = baseMaterialFileModularService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param baseMaterialFileModular
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BaseMaterialFileModular> add(@RequestBody BaseMaterialFileModular baseMaterialFileModular) {
+		Result<BaseMaterialFileModular> result = new Result<BaseMaterialFileModular>();
+		try {
+			baseMaterialFileModularService.save(baseMaterialFileModular);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param baseMaterialFileModular
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BaseMaterialFileModular> edit(@RequestBody BaseMaterialFileModular baseMaterialFileModular) {
+		Result<BaseMaterialFileModular> result = new Result<BaseMaterialFileModular>();
+		BaseMaterialFileModular baseMaterialFileModularEntity = baseMaterialFileModularService.getById(baseMaterialFileModular.getId());
+		if(baseMaterialFileModularEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseMaterialFileModularService.updateById(baseMaterialFileModular);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<BaseMaterialFileModular> delete(@RequestParam(name="id",required=true) String id) {
+		Result<BaseMaterialFileModular> result = new Result<BaseMaterialFileModular>();
+		BaseMaterialFileModular baseMaterialFileModular = baseMaterialFileModularService.getById(id);
+		if(baseMaterialFileModular==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseMaterialFileModularService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BaseMaterialFileModular> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BaseMaterialFileModular> result = new Result<BaseMaterialFileModular>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.baseMaterialFileModularService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<BaseMaterialFileModular> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BaseMaterialFileModular> result = new Result<BaseMaterialFileModular>();
+		BaseMaterialFileModular baseMaterialFileModular = baseMaterialFileModularService.getById(id);
+		if(baseMaterialFileModular==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(baseMaterialFileModular);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<BaseMaterialFileModular> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              BaseMaterialFileModular baseMaterialFileModular = JSON.parseObject(deString, BaseMaterialFileModular.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileModular, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<BaseMaterialFileModular> pageList = baseMaterialFileModularService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "物料档案模块列表");
+      mv.addObject(NormalExcelConstants.CLASS, BaseMaterialFileModular.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("物料档案模块列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BaseMaterialFileModular> listBaseMaterialFileModulars = ExcelImportUtil.importExcel(file.getInputStream(), BaseMaterialFileModular.class, params);
+              for (BaseMaterialFileModular baseMaterialFileModularExcel : listBaseMaterialFileModulars) {
+                  baseMaterialFileModularService.save(baseMaterialFileModularExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listBaseMaterialFileModulars.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 344 - 0
src/main/java/org/jeecg/modules/basedata/controller/BaseMaterialFileProductController.java

@@ -0,0 +1,344 @@
+package org.jeecg.modules.basedata.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileProduct;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileModularService;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileProductService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 物料档案产品
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/basedata/baseMaterialFileProduct")
+@Slf4j
+public class BaseMaterialFileProductController {
+	@Autowired
+	private IBaseMaterialFileProductService baseMaterialFileProductService;
+
+	@Autowired
+	private IBaseMaterialFileModularService iBaseMaterialFileModularService;
+	
+	/**
+	  * 分页列表查询
+	 * @param baseMaterialFileProduct
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BaseMaterialFileProduct>> queryPageList(BaseMaterialFileProduct baseMaterialFileProduct,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<BaseMaterialFileProduct>> result = new Result<IPage<BaseMaterialFileProduct>>();
+		QueryWrapper<BaseMaterialFileProduct> queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileProduct, req.getParameterMap());
+		queryWrapper.lambda().eq(BaseMaterialFileProduct::getPkOrg,baseMaterialFileProduct.getPkOrg());
+		queryWrapper.lambda().eq(BaseMaterialFileProduct::getDelFlag,"0");
+		queryWrapper.lambda().orderByAsc(BaseMaterialFileProduct::getCreateTime);
+		Page<BaseMaterialFileProduct> page = new Page<BaseMaterialFileProduct>(pageNo, pageSize);
+		IPage<BaseMaterialFileProduct> pageList = baseMaterialFileProductService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param baseMaterialFileProduct
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BaseMaterialFileProduct> add(@RequestBody BaseMaterialFileProduct baseMaterialFileProduct) {
+		Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		try {
+			baseMaterialFileProductService.save(baseMaterialFileProduct);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表与子表一起新增
+	* @Date 2021/11/16 15:15
+	* @Param [baseMaterialFileProduct]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.basedata.entity.BaseMaterialFileProduct>
+	*/
+	 @PostMapping(value = "/saveMainAndChild")
+	 public Result<BaseMaterialFileProduct> saveMainAndChild(@RequestBody BaseMaterialFileProduct baseMaterialFileProduct) {
+		 Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		 try {
+			 baseMaterialFileProductService.saveMainAndChild(baseMaterialFileProduct);
+			 result.success("添加成功!");
+		 } catch (Exception e) {
+			 e.printStackTrace();
+			 log.info(e.getMessage());
+			 result.error500("操作失败");
+		 }
+		 return result;
+	 }
+	
+	/**
+	  *  编辑
+	 * @param baseMaterialFileProduct
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BaseMaterialFileProduct> edit(@RequestBody BaseMaterialFileProduct baseMaterialFileProduct) {
+		Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		BaseMaterialFileProduct baseMaterialFileProductEntity = baseMaterialFileProductService.getById(baseMaterialFileProduct.getId());
+		if(baseMaterialFileProductEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseMaterialFileProductService.updateById(baseMaterialFileProduct);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表与子表一起修改
+	* @Date 2021/11/16 15:39
+	* @Param [baseMaterialFileProduct]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.basedata.entity.BaseMaterialFileProduct>
+	*/
+	 @PutMapping(value = "/updateMainAndChild")
+	 public Result<BaseMaterialFileProduct> updateMainAndChild(@RequestBody BaseMaterialFileProduct baseMaterialFileProduct) {
+		 Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		 BaseMaterialFileProduct baseMaterialFileProductEntity = baseMaterialFileProductService.getById(baseMaterialFileProduct.getId());
+		 if(baseMaterialFileProductEntity==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 try {
+				 baseMaterialFileProductService.updateMainAndChild(baseMaterialFileProduct);
+				 result.success("修改成功");
+			 } catch (Exception e) {
+				 e.printStackTrace();
+				 result.error500("修改失败:"+e.getMessage());
+			 }
+		 }
+
+		 return result;
+	 }
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<BaseMaterialFileProduct> delete(@RequestParam(name="id",required=true) String id) {
+		Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		BaseMaterialFileProduct baseMaterialFileProduct = baseMaterialFileProductService.getById(id);
+		if(baseMaterialFileProduct==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseMaterialFileProductService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表与子表一起删除
+	* @Date 2021/11/17 17:27
+	* @Param [id]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.basedata.entity.BaseMaterialFileProduct>
+	*/
+	 @DeleteMapping(value = "/deleteMainAndChild")
+	 public Result<BaseMaterialFileProduct> deleteMainAndChild(@RequestParam(name="id",required=true) String id) {
+		 Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		 BaseMaterialFileProduct baseMaterialFileProduct = baseMaterialFileProductService.getById(id);
+		 if(baseMaterialFileProduct==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 try {
+				 baseMaterialFileProductService.deleteMainAndChild(baseMaterialFileProduct);
+				 result.success("删除成功");
+			 } catch (Exception e) {
+				 e.printStackTrace();
+				 result.error500("删除失败:"+e.getMessage());
+			 }
+		 }
+		 return result;
+	 }
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BaseMaterialFileProduct> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.baseMaterialFileProductService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询主子表数据
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryMainAndChildById")
+	public Result<BaseMaterialFileProduct> queryMainAndChildById(@RequestParam(name="id",required=true) String id) {
+		Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		BaseMaterialFileProduct baseMaterialFileProduct = baseMaterialFileProductService.getById(id);
+		if(baseMaterialFileProduct==null) {
+			result.error500("未找到对应实体");
+		}else {
+			//根据主表id获取子表数据
+			QueryWrapper<BaseMaterialFileModular> queryWrapper=new QueryWrapper<>();
+			queryWrapper.lambda().eq(BaseMaterialFileModular::getDelFlag,'0');
+			queryWrapper.lambda().eq(BaseMaterialFileModular::getBaseMaterialFileProductId,id);
+			queryWrapper.lambda().orderByAsc(BaseMaterialFileModular::getPkOrg);
+			List<BaseMaterialFileModular> baseMaterialFileModularList=iBaseMaterialFileModularService.list(queryWrapper);
+			if(baseMaterialFileModularList!=null&&baseMaterialFileModularList.size()>0){
+				baseMaterialFileProduct.setBaseMaterialFileModularList(baseMaterialFileModularList);
+			}
+			result.setResult(baseMaterialFileProduct);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+	 /**
+	  * 通过id查询
+	  * @param id
+	  * @return
+	  */
+	 @GetMapping(value = "/queryById")
+	 public Result<BaseMaterialFileProduct> queryById(@RequestParam(name="id",required=true) String id) {
+		 Result<BaseMaterialFileProduct> result = new Result<BaseMaterialFileProduct>();
+		 BaseMaterialFileProduct baseMaterialFileProduct = baseMaterialFileProductService.getById(id);
+		 if(baseMaterialFileProduct==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 result.setResult(baseMaterialFileProduct);
+			 result.setSuccess(true);
+		 }
+		 return result;
+	 }
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<BaseMaterialFileProduct> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              BaseMaterialFileProduct baseMaterialFileProduct = JSON.parseObject(deString, BaseMaterialFileProduct.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(baseMaterialFileProduct, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<BaseMaterialFileProduct> pageList = baseMaterialFileProductService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "物料档案产品列表");
+      mv.addObject(NormalExcelConstants.CLASS, BaseMaterialFileProduct.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("物料档案产品列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BaseMaterialFileProduct> listBaseMaterialFileProducts = ExcelImportUtil.importExcel(file.getInputStream(), BaseMaterialFileProduct.class, params);
+              for (BaseMaterialFileProduct baseMaterialFileProductExcel : listBaseMaterialFileProducts) {
+                  baseMaterialFileProductService.save(baseMaterialFileProductExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listBaseMaterialFileProducts.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 8 - 2
src/main/java/org/jeecg/modules/basedata/controller/BaseSalesStatusController.java

@@ -9,6 +9,8 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
@@ -142,8 +144,9 @@ public class BaseSalesStatusController {
 	 * @param baseSalesStatus
 	 * @return
 	 */
-	@PostMapping(value = "/add")
-	public Result<BaseSalesStatus> add(@RequestBody BaseSalesStatus baseSalesStatus) {
+	 @PostMapping(value = "/add")
+     @RequiresPermissions("sales-status:add")
+     public Result<BaseSalesStatus> add(@RequestBody BaseSalesStatus baseSalesStatus) {
 		Result<BaseSalesStatus> result = new Result<BaseSalesStatus>();
 		try {
 			// 设置编码
@@ -151,6 +154,7 @@ public class BaseSalesStatusController {
 			if(!nextSerial.isSucceed()){
 				throw new RuntimeException("获取编号失败");
 			}
+			baseSalesStatus.setCode(nextSerial.getContent());
 			baseSalesStatusService.save(baseSalesStatus);
 			result.success("添加成功!");
 		} catch (Exception e) {
@@ -167,6 +171,7 @@ public class BaseSalesStatusController {
 	 * @return
 	 */
 	@PutMapping(value = "/edit")
+    @RequiresPermissions("sales-status:update")
 	public Result<BaseSalesStatus> edit(@RequestBody BaseSalesStatus baseSalesStatus) {
 		Result<BaseSalesStatus> result = new Result<BaseSalesStatus>();
 		BaseSalesStatus baseSalesStatusEntity = baseSalesStatusService.getById(baseSalesStatus.getId());
@@ -213,6 +218,7 @@ public class BaseSalesStatusController {
 	 * @return org.jeecg.common.api.vo.Result<org.jeecg.modules.basedata.entity.BaseSalesStatus>
 	 */
 	 @DeleteMapping(value = "/delete")
+     @RequiresPermissions("sales-status:delete")
 	 public Result<BaseSalesStatus> delete(@RequestParam(name="id",required=true) String id) {
 		 Result<BaseSalesStatus> result = new Result<BaseSalesStatus>();
 		 BaseSalesStatus baseSalesStatus = baseSalesStatusService.getById(id);

+ 25 - 0
src/main/java/org/jeecg/modules/basedata/controller/FdCustomerContactsController.java

@@ -311,4 +311,29 @@ public class FdCustomerContactsController {
       return Result.ok("文件导入失败!");
   }
 
+  /**
+  * @Author chenchuang
+  * @Description //TODO 根据客户id查询客户联系人
+  * @Date 2021/11/18 16:40
+  * @Param [customerId]
+  * @return org.jeecg.common.api.vo.Result<java.util.List<org.jeecg.modules.basedata.entity.FdCustomerContacts>>
+  */
+  @GetMapping(value = "getContactsByMainId")
+  public Result<List<FdCustomerContacts>> getContactsByMainId(String customerId){
+	  Result<List<FdCustomerContacts>> result=new Result<>();
+	  try {
+		  QueryWrapper<FdCustomerContacts> queryWrapper=new QueryWrapper<>();
+		  queryWrapper.lambda().eq(FdCustomerContacts::getDelFlag,"0");
+		  queryWrapper.lambda().eq(FdCustomerContacts::getPkCustomerId,customerId);
+		  queryWrapper.lambda().orderByAsc(FdCustomerContacts::getSort);
+		  List<FdCustomerContacts> fdCustomerContactsList=fdCustomerContactsService.list(queryWrapper);
+		  result.success("查询成功");
+		  result.setResult(fdCustomerContactsList);
+	  } catch (Exception e) {
+		  e.printStackTrace();
+		  result.error500("查询失败:"+e.getMessage());
+	  }
+	  return result;
+  }
+
 }

+ 61 - 0
src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileClassification.java

@@ -0,0 +1,61 @@
+package org.jeecg.modules.basedata.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 物料档案分类
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Data
+@TableName("base_material_file_classification")
+public class BaseMaterialFileClassification implements Serializable {
+    private static final long serialVersionUID = 1L;
+    
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private String id;
+	/**编码*/
+	@Excel(name = "编码", width = 15)
+	private String code;
+	/**名称*/
+	@Excel(name = "名称", width = 15)
+	private String name;
+	/**父级id*/
+	@Excel(name = "父级id", width = 15)
+	private String parentId;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private String pkOrg;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+	private Integer sort;
+}

+ 64 - 0
src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileModular.java

@@ -0,0 +1,64 @@
+package org.jeecg.modules.basedata.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 物料档案模块
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Data
+@TableName("base_material_file_modular")
+public class BaseMaterialFileModular implements Serializable {
+    private static final long serialVersionUID = 1L;
+    
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private String id;
+	/**模块编码*/
+	@Excel(name = "模块编码", width = 15)
+	private String code;
+	/**模块名称*/
+	@Excel(name = "模块名称", width = 15)
+	private String name;
+	/**标准报价*/
+	@Excel(name = "标准报价", width = 15)
+	private java.math.BigDecimal standardQuotation;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private String pkOrg;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+	private Integer sort;
+	/**产品id*/
+	@Excel(name = "产品id", width = 15)
+	private String baseMaterialFileProductId;
+}

+ 77 - 0
src/main/java/org/jeecg/modules/basedata/entity/BaseMaterialFileProduct.java

@@ -0,0 +1,77 @@
+package org.jeecg.modules.basedata.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 物料档案产品
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Data
+@TableName("base_material_file_product")
+public class BaseMaterialFileProduct implements Serializable {
+    private static final long serialVersionUID = 1L;
+    
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private String id;
+	/**产品编码*/
+	@Excel(name = "产品编码", width = 15)
+	private String code;
+	/**产品名称*/
+	@Excel(name = "产品名称", width = 15)
+	private String name;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	private Object memo;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private String pkOrg;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+	private Integer sort;
+	/**状态(0:未启用, 1:启用)*/
+	@Excel(name = "状态(0:未启用, 1:启用)", width = 15)
+	private Integer status;
+	/**分类id*/
+	@Excel(name = "分类id", width = 15)
+	private String baseMaterialFileClassificationId;
+
+	/**产品属性(1采购2销售)*/
+	private String attribute;
+
+	/**模块子表数据*/
+	@TableField(exist = false)
+	private List<BaseMaterialFileModular> baseMaterialFileModularList;
+}

+ 17 - 0
src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileClassificationMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.basedata.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileClassification;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 物料档案分类
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface BaseMaterialFileClassificationMapper extends BaseMapper<BaseMaterialFileClassification> {
+
+}

+ 17 - 0
src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileModularMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.basedata.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 物料档案模块
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface BaseMaterialFileModularMapper extends BaseMapper<BaseMaterialFileModular> {
+
+}

+ 17 - 0
src/main/java/org/jeecg/modules/basedata/mapper/BaseMaterialFileProductMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.basedata.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 物料档案产品
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface BaseMaterialFileProductMapper extends BaseMapper<BaseMaterialFileProduct> {
+
+}

+ 5 - 0
src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileClassificationMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.basedata.mapper.BaseMaterialFileClassificationMapper">
+
+</mapper>

+ 5 - 0
src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileModularMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.basedata.mapper.BaseMaterialFileModularMapper">
+
+</mapper>

+ 5 - 0
src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseMaterialFileProductMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.basedata.mapper.BaseMaterialFileProductMapper">
+
+</mapper>

+ 119 - 0
src/main/java/org/jeecg/modules/basedata/model/BaseMaterialFileClassificationTree.java

@@ -0,0 +1,119 @@
+package org.jeecg.modules.basedata.model;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileClassification;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 功能描述:物料分类tree
+ *
+ * @Author: chenchuang
+ * @Date: 2021/11/16 14:06
+ */
+public class BaseMaterialFileClassificationTree {
+    private static final long serialVersionUID = 1L;
+    /** 对应BaseSalesStatus中的id字段,前端数据树中的key*/
+    private String key;
+
+    /** 对应BaseSalesStatus中的id字段,前端数据树中的value*/
+    private String value;
+
+    /** 对应BaseSalesStatus.name字段,前端数据树中的title*/
+    private String title;
+    /** 是否叶子节点*/
+    private boolean isLeaf;
+    /**主键*/
+    private String id;
+    /**编码*/
+    private String code;
+    /**名称*/
+    private String name;
+    /**父级id*/
+    private String parentId;
+    /**子数据 */
+    private List<BaseMaterialFileClassificationTree> children = new ArrayList<>();
+
+    private BaseMaterialFileClassificationTree(){}
+
+    public BaseMaterialFileClassificationTree(BaseMaterialFileClassification baseMaterialFileClassification){
+        this.key=baseMaterialFileClassification.getId();
+        this.value=baseMaterialFileClassification.getId();
+        this.title=baseMaterialFileClassification.getName();
+        this.code=baseMaterialFileClassification.getCode();
+        this.name=baseMaterialFileClassification.getName();
+        this.parentId=baseMaterialFileClassification.getParentId();
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public boolean getIsLeaf() {
+        return isLeaf;
+    }
+
+    public void setIsLeaf(boolean leaf) {
+        isLeaf = leaf;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public List<BaseMaterialFileClassificationTree> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<BaseMaterialFileClassificationTree> children) {
+        this.children = children;
+    }
+}

+ 14 - 0
src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileClassificationService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.basedata.service;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileClassification;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 物料档案分类
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface IBaseMaterialFileClassificationService extends IService<BaseMaterialFileClassification> {
+
+}

+ 14 - 0
src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileModularService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.basedata.service;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 物料档案模块
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface IBaseMaterialFileModularService extends IService<BaseMaterialFileModular> {
+
+}

+ 40 - 0
src/main/java/org/jeecg/modules/basedata/service/IBaseMaterialFileProductService.java

@@ -0,0 +1,40 @@
+package org.jeecg.modules.basedata.service;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileProduct;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 物料档案产品
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+public interface IBaseMaterialFileProductService extends IService<BaseMaterialFileProduct> {
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表与子表一起新增
+    * @Date 2021/11/16 14:53
+    * @Param [baseMaterialFileProduct]
+    * @return boolean
+    */
+    void saveMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表与子表一起修改
+    * @Date 2021/11/16 15:16
+    * @Param [baseMaterialFileProduct]
+    * @return void
+    */
+    void updateMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表与子表一起删除
+    * @Date 2021/11/16 15:40
+    * @Param [baseMaterialFileProduct]
+    * @return void
+    */
+    void deleteMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct);
+}

+ 19 - 0
src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileClassificationServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.basedata.service.impl;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileClassification;
+import org.jeecg.modules.basedata.mapper.BaseMaterialFileClassificationMapper;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileClassificationService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 物料档案分类
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Service
+public class BaseMaterialFileClassificationServiceImpl extends ServiceImpl<BaseMaterialFileClassificationMapper, BaseMaterialFileClassification> implements IBaseMaterialFileClassificationService {
+
+}

+ 19 - 0
src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileModularServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.basedata.service.impl;
+
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import org.jeecg.modules.basedata.mapper.BaseMaterialFileModularMapper;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileModularService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 物料档案模块
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Service
+public class BaseMaterialFileModularServiceImpl extends ServiceImpl<BaseMaterialFileModularMapper, BaseMaterialFileModular> implements IBaseMaterialFileModularService {
+
+}

+ 88 - 0
src/main/java/org/jeecg/modules/basedata/service/impl/BaseMaterialFileProductServiceImpl.java

@@ -0,0 +1,88 @@
+package org.jeecg.modules.basedata.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileModular;
+import org.jeecg.modules.basedata.entity.BaseMaterialFileProduct;
+import org.jeecg.modules.basedata.mapper.BaseMaterialFileProductMapper;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileModularService;
+import org.jeecg.modules.basedata.service.IBaseMaterialFileProductService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description: 物料档案产品
+ * @author: jeecg-boot
+ * @date2021-11-16
+ * @version: V1.0
+ */
+@Transactional
+@Service
+public class BaseMaterialFileProductServiceImpl extends ServiceImpl<BaseMaterialFileProductMapper, BaseMaterialFileProduct> implements IBaseMaterialFileProductService {
+
+    @Resource
+    private BaseMaterialFileProductMapper baseMaterialFileProductMapper;
+
+    @Resource
+    private IBaseMaterialFileModularService iBaseMaterialFileModularService;
+
+    @Override
+    public void saveMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct) {
+        //新增主表
+        baseMaterialFileProductMapper.insert(baseMaterialFileProduct);
+        //新增子表
+        saveChild(baseMaterialFileProduct);
+    }
+
+    @Override
+    public void updateMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct) {
+        //修改主表
+        baseMaterialFileProductMapper.updateById(baseMaterialFileProduct);
+        //删除子表
+        deleteChild(baseMaterialFileProduct);
+        //新增子表
+        saveChild(baseMaterialFileProduct);
+    }
+
+    @Override
+    public void deleteMainAndChild(BaseMaterialFileProduct baseMaterialFileProduct) {
+        //删除主表
+        baseMaterialFileProduct.setDelFlag("1");
+        baseMaterialFileProductMapper.updateById(baseMaterialFileProduct);
+        //删除子表
+        deleteChild(baseMaterialFileProduct);
+    }
+
+    /**新增子表*/
+    public void saveChild(BaseMaterialFileProduct baseMaterialFileProduct){
+        //如果子表数据不为空
+        if(baseMaterialFileProduct.getBaseMaterialFileModularList()!=null&&baseMaterialFileProduct.getBaseMaterialFileModularList().size()>0){
+            Integer sort=1;
+            //处理新增需要的属性
+            for(BaseMaterialFileModular modular:baseMaterialFileProduct.getBaseMaterialFileModularList()){
+                modular.setId(null);
+                modular.setBaseMaterialFileProductId(baseMaterialFileProduct.getId());//产品id
+                modular.setSort(sort);//排序
+                sort++;
+            }
+            //批量新增
+            iBaseMaterialFileModularService.saveBatch(baseMaterialFileProduct.getBaseMaterialFileModularList());
+        }
+    }
+
+    /**删除子表数据*/
+    public void deleteChild(BaseMaterialFileProduct baseMaterialFileProduct){
+        //修改条件
+        QueryWrapper<BaseMaterialFileModular> queryWrapper=new QueryWrapper<>();
+        queryWrapper.lambda().eq(BaseMaterialFileModular::getDelFlag,"0");
+        queryWrapper.lambda().eq(BaseMaterialFileModular::getBaseMaterialFileProductId,baseMaterialFileProduct.getId());
+        //修改数据
+        BaseMaterialFileModular baseMaterialFileModular=new BaseMaterialFileModular();
+        baseMaterialFileModular.setDelFlag("1");
+        iBaseMaterialFileModularService.update(baseMaterialFileModular,queryWrapper);
+    }
+}

+ 1 - 1
src/main/java/org/jeecg/modules/basedata/service/impl/FdCustomerServiceImpl.java

@@ -150,7 +150,7 @@ public class FdCustomerServiceImpl extends ServiceImpl<FdCustomerMapper, FdCusto
 
     @Override
     public FdCustomer getFdCustomerById(String id) {
-        return fdCustomerService.getFdCustomerById(id);
+        return fdCustomerMapper.getFdCustomerById(id);
     }
 
 }

+ 237 - 0
src/main/java/org/jeecg/modules/contract/file/controller/ContractFileAndBusinessController.java

@@ -0,0 +1,237 @@
+package org.jeecg.modules.contract.file.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.contract.file.entity.ContractFileAndBusiness;
+import org.jeecg.modules.contract.file.service.IContractFileAndBusinessService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 合同收款计划
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/contract.file/contractFileAndBusiness")
+@Slf4j
+public class ContractFileAndBusinessController {
+	@Autowired
+	private IContractFileAndBusinessService contractFileAndBusinessService;
+	
+	/**
+	  * 分页列表查询
+	 * @param contractFileAndBusiness
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<ContractFileAndBusiness>> queryPageList(ContractFileAndBusiness contractFileAndBusiness,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<ContractFileAndBusiness>> result = new Result<IPage<ContractFileAndBusiness>>();
+		QueryWrapper<ContractFileAndBusiness> queryWrapper = QueryGenerator.initQueryWrapper(contractFileAndBusiness, req.getParameterMap());
+		Page<ContractFileAndBusiness> page = new Page<ContractFileAndBusiness>(pageNo, pageSize);
+		IPage<ContractFileAndBusiness> pageList = contractFileAndBusinessService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param contractFileAndBusiness
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<ContractFileAndBusiness> add(@RequestBody ContractFileAndBusiness contractFileAndBusiness) {
+		Result<ContractFileAndBusiness> result = new Result<ContractFileAndBusiness>();
+		try {
+			contractFileAndBusinessService.save(contractFileAndBusiness);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param contractFileAndBusiness
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<ContractFileAndBusiness> edit(@RequestBody ContractFileAndBusiness contractFileAndBusiness) {
+		Result<ContractFileAndBusiness> result = new Result<ContractFileAndBusiness>();
+		ContractFileAndBusiness contractFileAndBusinessEntity = contractFileAndBusinessService.getById(contractFileAndBusiness.getId());
+		if(contractFileAndBusinessEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileAndBusinessService.updateById(contractFileAndBusiness);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<ContractFileAndBusiness> delete(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileAndBusiness> result = new Result<ContractFileAndBusiness>();
+		ContractFileAndBusiness contractFileAndBusiness = contractFileAndBusinessService.getById(id);
+		if(contractFileAndBusiness==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileAndBusinessService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ContractFileAndBusiness> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ContractFileAndBusiness> result = new Result<ContractFileAndBusiness>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.contractFileAndBusinessService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<ContractFileAndBusiness> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileAndBusiness> result = new Result<ContractFileAndBusiness>();
+		ContractFileAndBusiness contractFileAndBusiness = contractFileAndBusinessService.getById(id);
+		if(contractFileAndBusiness==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(contractFileAndBusiness);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<ContractFileAndBusiness> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              ContractFileAndBusiness contractFileAndBusiness = JSON.parseObject(deString, ContractFileAndBusiness.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(contractFileAndBusiness, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<ContractFileAndBusiness> pageList = contractFileAndBusinessService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "合同收款计划列表");
+      mv.addObject(NormalExcelConstants.CLASS, ContractFileAndBusiness.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("合同收款计划列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<ContractFileAndBusiness> listContractFileAndBusinesss = ExcelImportUtil.importExcel(file.getInputStream(), ContractFileAndBusiness.class, params);
+              for (ContractFileAndBusiness contractFileAndBusinessExcel : listContractFileAndBusinesss) {
+                  contractFileAndBusinessService.save(contractFileAndBusinessExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listContractFileAndBusinesss.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 332 - 0
src/main/java/org/jeecg/modules/contract/file/controller/ContractFileController.java

@@ -0,0 +1,332 @@
+package org.jeecg.modules.contract.file.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.contract.file.entity.ContractFile;
+import org.jeecg.modules.contract.file.service.IContractFileService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 合同档案
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/contract.file/contractFile")
+@Slf4j
+public class ContractFileController {
+	@Autowired
+	private IContractFileService contractFileService;
+	
+	/**
+	  * 分页列表查询
+	 * @param contractFile
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<ContractFile>> queryPageList(ContractFile contractFile,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<ContractFile>> result = new Result<IPage<ContractFile>>();
+		QueryWrapper<ContractFile> queryWrapper = QueryGenerator.initQueryWrapper(contractFile, req.getParameterMap());
+		queryWrapper.lambda().eq(ContractFile::getDelFlag,"0");
+		queryWrapper.lambda().orderByDesc(ContractFile::getCreateTime);
+		Page<ContractFile> page = new Page<ContractFile>(pageNo, pageSize);
+		IPage<ContractFile> pageList = contractFileService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param contractFile
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<ContractFile> add(@RequestBody ContractFile contractFile) {
+		Result<ContractFile> result = new Result<ContractFile>();
+		try {
+			contractFileService.save(contractFile);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表和子表数据一起保存
+	* @Date 2021/11/17 16:41
+	* @Param [contractFile]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.contract.file.entity.ContractFile>
+	*/
+	 @PostMapping(value = "/saveMainAndChild")
+	 public Result<ContractFile> saveMainAndChild(@RequestBody ContractFile contractFile) {
+		 Result<ContractFile> result = new Result<ContractFile>();
+		 try {
+			 contractFileService.saveMainAndChild(contractFile);
+			 result.success("添加成功!");
+		 } catch (Exception e) {
+			 e.printStackTrace();
+			 log.info(e.getMessage());
+			 result.error500("操作失败");
+		 }
+		 return result;
+	 }
+	
+	/**
+	  *  编辑
+	 * @param contractFile
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<ContractFile> edit(@RequestBody ContractFile contractFile) {
+		Result<ContractFile> result = new Result<ContractFile>();
+		ContractFile contractFileEntity = contractFileService.getById(contractFile.getId());
+		if(contractFileEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileService.updateById(contractFile);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表和子表一起修改
+	* @Date 2021/11/17 17:19
+	* @Param [contractFile]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.contract.file.entity.ContractFile>
+	*/
+	 @PutMapping(value = "/updateMainAndChild")
+	 public Result<ContractFile> updateMainAndChild(@RequestBody ContractFile contractFile) {
+		 Result<ContractFile> result = new Result<ContractFile>();
+		 ContractFile contractFileEntity = contractFileService.getById(contractFile.getId());
+		 if(contractFileEntity==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 try {
+				 contractFileService.updateMainAndChild(contractFile);
+				 result.success("修改成功");
+			 } catch (Exception e) {
+				 e.printStackTrace();
+				 result.error500("修改失败:"+e.getMessage());
+			 }
+		 }
+		 return result;
+	 }
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<ContractFile> delete(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFile> result = new Result<ContractFile>();
+		ContractFile contractFile = contractFileService.getById(id);
+		if(contractFile==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 主表与子表一起删除
+	* @Date 2021/11/17 17:29
+	* @Param [id]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.contract.file.entity.ContractFile>
+	*/
+	 @DeleteMapping(value = "/deleteMainAndChild")
+	 public Result<ContractFile> deleteMainAndChild(@RequestParam(name="id",required=true) String id) {
+		 Result<ContractFile> result = new Result<ContractFile>();
+		 ContractFile contractFile = contractFileService.getById(id);
+		 if(contractFile==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+			 try {
+				 contractFileService.deleteMainAndChild(contractFile);
+				 result.success("删除成功");
+			 } catch (Exception e) {
+				 e.printStackTrace();
+				 result.error500("删除失败:"+e.getMessage());
+			 }
+		 }
+		 return result;
+	 }
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ContractFile> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ContractFile> result = new Result<ContractFile>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.contractFileService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<ContractFile> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFile> result = new Result<ContractFile>();
+		ContractFile contractFile = contractFileService.getById(id);
+		if(contractFile==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(contractFile);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+	/**
+	* @Author chenchuang
+	* @Description //TODO 根据主表id查询主子表数据
+	* @Date 2021/11/17 17:31
+	* @Param [id]
+	* @return org.jeecg.common.api.vo.Result<org.jeecg.modules.contract.file.entity.ContractFile>
+	*/
+	 @GetMapping(value = "/queryMainAndChildById")
+	 public Result<ContractFile> queryMainAndChildById(@RequestParam(name="id",required=true) String id) {
+		 Result<ContractFile> result = new Result<ContractFile>();
+		 ContractFile contractFile = contractFileService.getById(id);
+		 if(contractFile==null) {
+			 result.error500("未找到对应实体");
+		 }else {
+		 	//获取所有子表数据
+			 contractFileService.queryMainAndChildById(contractFile);
+			 result.setResult(contractFile);
+			 result.setSuccess(true);
+		 }
+		 return result;
+	 }
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<ContractFile> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              ContractFile contractFile = JSON.parseObject(deString, ContractFile.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(contractFile, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<ContractFile> pageList = contractFileService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "合同档案列表");
+      mv.addObject(NormalExcelConstants.CLASS, ContractFile.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("合同档案列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<ContractFile> listContractFiles = ExcelImportUtil.importExcel(file.getInputStream(), ContractFile.class, params);
+              for (ContractFile contractFileExcel : listContractFiles) {
+                  contractFileService.save(contractFileExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listContractFiles.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 237 - 0
src/main/java/org/jeecg/modules/contract/file/controller/ContractFileModularController.java

@@ -0,0 +1,237 @@
+package org.jeecg.modules.contract.file.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.contract.file.entity.ContractFileModular;
+import org.jeecg.modules.contract.file.service.IContractFileModularService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 合同产品模块
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/contract.file/contractFileModular")
+@Slf4j
+public class ContractFileModularController {
+	@Autowired
+	private IContractFileModularService contractFileModularService;
+	
+	/**
+	  * 分页列表查询
+	 * @param contractFileModular
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<ContractFileModular>> queryPageList(ContractFileModular contractFileModular,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<ContractFileModular>> result = new Result<IPage<ContractFileModular>>();
+		QueryWrapper<ContractFileModular> queryWrapper = QueryGenerator.initQueryWrapper(contractFileModular, req.getParameterMap());
+		Page<ContractFileModular> page = new Page<ContractFileModular>(pageNo, pageSize);
+		IPage<ContractFileModular> pageList = contractFileModularService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param contractFileModular
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<ContractFileModular> add(@RequestBody ContractFileModular contractFileModular) {
+		Result<ContractFileModular> result = new Result<ContractFileModular>();
+		try {
+			contractFileModularService.save(contractFileModular);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param contractFileModular
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<ContractFileModular> edit(@RequestBody ContractFileModular contractFileModular) {
+		Result<ContractFileModular> result = new Result<ContractFileModular>();
+		ContractFileModular contractFileModularEntity = contractFileModularService.getById(contractFileModular.getId());
+		if(contractFileModularEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileModularService.updateById(contractFileModular);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<ContractFileModular> delete(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileModular> result = new Result<ContractFileModular>();
+		ContractFileModular contractFileModular = contractFileModularService.getById(id);
+		if(contractFileModular==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileModularService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ContractFileModular> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ContractFileModular> result = new Result<ContractFileModular>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.contractFileModularService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<ContractFileModular> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileModular> result = new Result<ContractFileModular>();
+		ContractFileModular contractFileModular = contractFileModularService.getById(id);
+		if(contractFileModular==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(contractFileModular);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<ContractFileModular> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              ContractFileModular contractFileModular = JSON.parseObject(deString, ContractFileModular.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(contractFileModular, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<ContractFileModular> pageList = contractFileModularService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "合同产品模块列表");
+      mv.addObject(NormalExcelConstants.CLASS, ContractFileModular.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("合同产品模块列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<ContractFileModular> listContractFileModulars = ExcelImportUtil.importExcel(file.getInputStream(), ContractFileModular.class, params);
+              for (ContractFileModular contractFileModularExcel : listContractFileModulars) {
+                  contractFileModularService.save(contractFileModularExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listContractFileModulars.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 237 - 0
src/main/java/org/jeecg/modules/contract/file/controller/ContractFileProductController.java

@@ -0,0 +1,237 @@
+package org.jeecg.modules.contract.file.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.contract.file.entity.ContractFileProduct;
+import org.jeecg.modules.contract.file.service.IContractFileProductService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 合同产品
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/contract.file/contractFileProduct")
+@Slf4j
+public class ContractFileProductController {
+	@Autowired
+	private IContractFileProductService contractFileProductService;
+	
+	/**
+	  * 分页列表查询
+	 * @param contractFileProduct
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<ContractFileProduct>> queryPageList(ContractFileProduct contractFileProduct,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<ContractFileProduct>> result = new Result<IPage<ContractFileProduct>>();
+		QueryWrapper<ContractFileProduct> queryWrapper = QueryGenerator.initQueryWrapper(contractFileProduct, req.getParameterMap());
+		Page<ContractFileProduct> page = new Page<ContractFileProduct>(pageNo, pageSize);
+		IPage<ContractFileProduct> pageList = contractFileProductService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param contractFileProduct
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<ContractFileProduct> add(@RequestBody ContractFileProduct contractFileProduct) {
+		Result<ContractFileProduct> result = new Result<ContractFileProduct>();
+		try {
+			contractFileProductService.save(contractFileProduct);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param contractFileProduct
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<ContractFileProduct> edit(@RequestBody ContractFileProduct contractFileProduct) {
+		Result<ContractFileProduct> result = new Result<ContractFileProduct>();
+		ContractFileProduct contractFileProductEntity = contractFileProductService.getById(contractFileProduct.getId());
+		if(contractFileProductEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileProductService.updateById(contractFileProduct);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<ContractFileProduct> delete(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileProduct> result = new Result<ContractFileProduct>();
+		ContractFileProduct contractFileProduct = contractFileProductService.getById(id);
+		if(contractFileProduct==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = contractFileProductService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<ContractFileProduct> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<ContractFileProduct> result = new Result<ContractFileProduct>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.contractFileProductService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<ContractFileProduct> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<ContractFileProduct> result = new Result<ContractFileProduct>();
+		ContractFileProduct contractFileProduct = contractFileProductService.getById(id);
+		if(contractFileProduct==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(contractFileProduct);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<ContractFileProduct> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              ContractFileProduct contractFileProduct = JSON.parseObject(deString, ContractFileProduct.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(contractFileProduct, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<ContractFileProduct> pageList = contractFileProductService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "合同产品列表");
+      mv.addObject(NormalExcelConstants.CLASS, ContractFileProduct.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("合同产品列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<ContractFileProduct> listContractFileProducts = ExcelImportUtil.importExcel(file.getInputStream(), ContractFileProduct.class, params);
+              for (ContractFileProduct contractFileProductExcel : listContractFileProducts) {
+                  contractFileProductService.save(contractFileProductExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listContractFileProducts.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 150 - 0
src/main/java/org/jeecg/modules/contract/file/entity/ContractFile.java

@@ -0,0 +1,150 @@
+package org.jeecg.modules.contract.file.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 合同档案
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Data
+@TableName("contract_file")
+public class ContractFile implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private java.lang.String id;
+	/**合同日期*/
+	@Excel(name = "合同日期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	private java.util.Date contractDate;
+	/**合同编码*/
+	@Excel(name = "合同编码", width = 15)
+	private java.lang.String code;
+	/**合同概述*/
+	@Excel(name = "合同概述", width = 15)
+	private java.lang.String overview;
+	/**业务类型(数据字典)*/
+	@Excel(name = "业务类型(数据字典)", width = 15)
+	private java.lang.String businessTypeDictId;
+	/**客户id(客户档案id)*/
+	@Excel(name = "客户id(客户档案id)", width = 15)
+	private java.lang.String fdCustomerId;
+	/**客户人员id(客户档案联系人id)*/
+	@Excel(name = "客户人员id(客户档案联系人id)", width = 15)
+	private java.lang.String fdCustomerPersonnelId;
+	/**销售部门id*/
+	@Excel(name = "销售部门id", width = 15)
+	private java.lang.String salesDepartmentId;
+	/**销售部门名称*/
+	@Excel(name = "销售部门名称", width = 15)
+	private java.lang.String salesDepartmentName;
+	/**免费售后起始*/
+	@Excel(name = "免费售后起始", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	private java.util.Date
+			freeAfterSalesStart;
+	/**免费售后截至*/
+	@Excel(name = "免费售后截至", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	private java.util.Date freeAfterSalesEnd;
+	/**标准报价*/
+	@Excel(name = "标准报价", width = 15)
+	private java.math.BigDecimal standardQuotation;
+	/**成交金额*/
+	@Excel(name = "成交金额", width = 15)
+	private java.math.BigDecimal transactionAmount;
+	/**折扣率*/
+	@Excel(name = "折扣率", width = 15)
+	private java.math.BigDecimal discountRate;
+	/**赠品金额*/
+	@Excel(name = "赠品金额", width = 15)
+	private java.math.BigDecimal giftAmount;
+	/**成本*/
+	@Excel(name = "成本", width = 15)
+	private java.math.BigDecimal cost;
+	/**合同费用*/
+	@Excel(name = "合同费用", width = 15)
+	private java.math.BigDecimal contractCost;
+	/**合同利润*/
+	@Excel(name = "合同利润", width = 15)
+	private java.math.BigDecimal contractProfit;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	private java.lang.Object memo;
+	/**应收账款*/
+	@Excel(name = "应收账款", width = 15)
+	private java.math.BigDecimal accountsReceivable;
+	/**业绩计算率*/
+	@Excel(name = "业绩计算率", width = 15)
+	private java.math.BigDecimal performanceCalculationRate;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private java.lang.String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private java.lang.String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private java.lang.String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private java.lang.String pkOrg;
+	/**里程碑类型id(数据字典)*/
+	@Excel(name = "里程碑类型id(数据字典)", width = 15)
+	private java.lang.String milestoneId;
+
+	/**项目立项id*/
+	private String proId;
+	/**销售人员id*/
+	private String salesmanId;
+	/**销售人员名称*/
+	private String salesmanName;
+
+	/**客户名称*/
+	@TableField(exist = false)
+	private String fdCustomerName;
+	/**客户人员名称*/
+	@TableField(exist = false)
+	private String fdCustomerPersonnelName;
+	/**客户人员电话*/
+	@TableField(exist = false)
+	private String fdCustomerPersonnelTel;
+	/**客户地址*/
+	@TableField(exist = false)
+	private String fdCustomeraddress;
+
+	/**合同产品子表*/
+	@TableField(exist = false)
+	List<ContractFileProduct> contractFileProductList;
+
+	/**合同收款计划子表*/
+	@TableField(exist = false)
+	List<ContractFileAndBusiness> contractFileAndBusinessList;
+}

+ 127 - 0
src/main/java/org/jeecg/modules/contract/file/entity/ContractFileAndBusiness.java

@@ -0,0 +1,127 @@
+package org.jeecg.modules.contract.file.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 合同收款计划
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Data
+@TableName("contract_file_and_business")
+public class ContractFileAndBusiness implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.UUID)
+	private java.lang.String id;
+	/**合同主表id*/
+	@Excel(name = "合同主表id", width = 15)
+	private java.lang.String contractFileId;
+	/**计划类型 1.收款计划 2.回款情况 3.付款计划 4.付款情况*/
+	@Excel(name = "计划类型 1.收款计划 2.回款情况 3.付款计划 4.付款情况", width = 15)
+	private java.lang.Integer planType;
+	/**计划名称id*/
+	@Excel(name = "计划名称id", width = 15)
+	private java.lang.String planId;
+	/**计划名称*/
+	@Excel(name = "计划名称", width = 15)
+	private java.lang.String planName;
+	/**第一笔*/
+	@Excel(name = "第一笔", width = 15)
+	private java.math.BigDecimal price1;
+	/**第二笔*/
+	@Excel(name = "第二笔", width = 15)
+	private java.math.BigDecimal price2;
+	/**第三笔*/
+	@Excel(name = "第三笔", width = 15)
+	private java.math.BigDecimal price3;
+	/**第四笔*/
+	@Excel(name = "第四笔", width = 15)
+	private java.math.BigDecimal price4;
+	/**第五笔*/
+	@Excel(name = "第五笔", width = 15)
+	private java.math.BigDecimal price5;
+	/**对应里程碑1*/
+	@Excel(name = "对应里程碑1", width = 15)
+	private java.lang.String milestone1;
+	/**里程碑id1*/
+	@Excel(name = "里程碑id1", width = 15)
+	private java.lang.String mileId1;
+	/**描述1*/
+	@Excel(name = "描述1", width = 15)
+	private java.lang.String desc1;
+	/**对应里程碑2*/
+	@Excel(name = "对应里程碑2", width = 15)
+	private java.lang.String milestone2;
+	/**里程碑id2*/
+	@Excel(name = "里程碑id2", width = 15)
+	private java.lang.String mileId2;
+	/**描述2*/
+	@Excel(name = "描述2", width = 15)
+	private java.lang.String desc2;
+	/**对应里程碑3*/
+	@Excel(name = "对应里程碑3", width = 15)
+	private java.lang.String milestone3;
+	/**里程碑id3*/
+	@Excel(name = "里程碑id3", width = 15)
+	private java.lang.String mileId3;
+	/**描述3*/
+	@Excel(name = "描述3", width = 15)
+	private java.lang.String desc3;
+	/**对应里程碑4*/
+	@Excel(name = "对应里程碑4", width = 15)
+	private java.lang.String milestone4;
+	/**里程碑id4*/
+	@Excel(name = "里程碑id4", width = 15)
+	private java.lang.String mileId4;
+	/**描述4*/
+	@Excel(name = "描述4", width = 15)
+	private java.lang.String desc4;
+	/**对应里程碑5*/
+	@Excel(name = "对应里程碑5", width = 15)
+	private java.lang.String milestone5;
+	/**里程碑id5*/
+	@Excel(name = "里程碑id5", width = 15)
+	private java.lang.String mileId5;
+	/**描述5*/
+	@Excel(name = "描述5", width = 15)
+	private java.lang.String desc5;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	private java.lang.Object memo;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private java.lang.String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private java.lang.String updateBy;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private java.lang.String delFlag;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private java.lang.String pkOrg;
+	/**序号*/
+	@Excel(name = "序号", width = 15)
+	private java.lang.Integer sort;
+}

+ 73 - 0
src/main/java/org/jeecg/modules/contract/file/entity/ContractFileModular.java

@@ -0,0 +1,73 @@
+package org.jeecg.modules.contract.file.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 合同产品模块
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Data
+@TableName("contract_file_modular")
+public class ContractFileModular implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private java.lang.String id;
+	/**产品模块编码*/
+	@Excel(name = "产品模块编码", width = 15)
+	private java.lang.String code;
+	/**产品模块名称*/
+	@Excel(name = "产品模块名称", width = 15)
+	private java.lang.String name;
+	/**标准价格*/
+	@Excel(name = "标准价格", width = 15)
+	private java.math.BigDecimal standardQuotation;
+	/**采购价格*/
+	@Excel(name = "采购价格", width = 15)
+	private java.math.BigDecimal purchasePrice;
+	/**合同产品id*/
+	@Excel(name = "合同产品id", width = 15)
+	private java.lang.String contractFileProductId;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	private java.lang.Object memo;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private java.lang.String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private java.lang.String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private java.lang.String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private java.lang.String pkOrg;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+	private java.lang.Integer sort;
+	/**主表id*/
+	@Excel(name = "主表id", width = 15)
+	private java.lang.String contractFileId;
+}

+ 92 - 0
src/main/java/org/jeecg/modules/contract/file/entity/ContractFileProduct.java

@@ -0,0 +1,92 @@
+package org.jeecg.modules.contract.file.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 合同产品
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Data
+@TableName("contract_file_product")
+public class ContractFileProduct implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.UUID)
+	private java.lang.String id;
+	/**产品编码*/
+	@Excel(name = "产品编码", width = 15)
+	private java.lang.String code;
+	/**产品名称*/
+	@Excel(name = "产品名称", width = 15)
+	private java.lang.String name;
+	/**物料档案产品id*/
+	@Excel(name = "物料档案产品id", width = 15)
+	private java.lang.String baseMaterialFileProductId;
+	/**标准报价*/
+	@Excel(name = "标准报价", width = 15)
+	private java.math.BigDecimal standardQuotation;
+	/**折扣后单价*/
+	@Excel(name = "折扣后单价", width = 15)
+	private java.math.BigDecimal unitPriceAfterDiscount;
+	/**标准金额*/
+	@Excel(name = "标准金额", width = 15)
+	private java.math.BigDecimal standardAmount;
+	/**折扣后金额*/
+	@Excel(name = "折扣后金额", width = 15)
+	private java.math.BigDecimal amountAfterDiscount;
+	/**成本单价*/
+	@Excel(name = "成本单价", width = 15)
+	private java.math.BigDecimal costUnitPrice;
+	/**成本金额*/
+	@Excel(name = "成本金额", width = 15)
+	private java.math.BigDecimal costAmount;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	private java.lang.Object memo;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private java.lang.String delFlag;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private java.lang.String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private java.lang.String updateBy;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private java.lang.String pkOrg;
+	/**排序*/
+	@Excel(name = "排序", width = 15)
+	private java.lang.Integer sort;
+	/**主表id*/
+	@Excel(name = "主表id", width = 15)
+	private java.lang.String contractFileId;
+
+	/**合同产品模块子表*/
+	@TableField(exist = false)
+	private List<ContractFileModular> contractFileModularList;
+}

+ 17 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileAndBusinessMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.contract.file.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.contract.file.entity.ContractFileAndBusiness;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 合同收款计划
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface ContractFileAndBusinessMapper extends BaseMapper<ContractFileAndBusiness> {
+
+}

+ 17 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.contract.file.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.contract.file.entity.ContractFile;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 合同档案
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface ContractFileMapper extends BaseMapper<ContractFile> {
+
+}

+ 17 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileModularMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.contract.file.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.contract.file.entity.ContractFileModular;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 合同产品模块
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface ContractFileModularMapper extends BaseMapper<ContractFileModular> {
+
+}

+ 17 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileProductMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.contract.file.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.contract.file.entity.ContractFileProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 合同产品
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface ContractFileProductMapper extends BaseMapper<ContractFileProduct> {
+
+}

+ 5 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileAndBusinessMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.contract.file.mapper.ContractFileAndBusinessMapper">
+
+</mapper>

+ 5 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.contract.file.mapper.ContractFileMapper">
+
+</mapper>

+ 5 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileModularMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.contract.file.mapper.ContractFileModularMapper">
+
+</mapper>

+ 5 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileProductMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.contract.file.mapper.ContractFileProductMapper">
+
+</mapper>

+ 14 - 0
src/main/java/org/jeecg/modules/contract/file/service/IContractFileAndBusinessService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.contract.file.service;
+
+import org.jeecg.modules.contract.file.entity.ContractFileAndBusiness;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 合同收款计划
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface IContractFileAndBusinessService extends IService<ContractFileAndBusiness> {
+
+}

+ 14 - 0
src/main/java/org/jeecg/modules/contract/file/service/IContractFileModularService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.contract.file.service;
+
+import org.jeecg.modules.contract.file.entity.ContractFileModular;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 合同产品模块
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface IContractFileModularService extends IService<ContractFileModular> {
+
+}

+ 14 - 0
src/main/java/org/jeecg/modules/contract/file/service/IContractFileProductService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.contract.file.service;
+
+import org.jeecg.modules.contract.file.entity.ContractFileProduct;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 合同产品
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface IContractFileProductService extends IService<ContractFileProduct> {
+
+}

+ 48 - 0
src/main/java/org/jeecg/modules/contract/file/service/IContractFileService.java

@@ -0,0 +1,48 @@
+package org.jeecg.modules.contract.file.service;
+
+import org.jeecg.modules.contract.file.entity.ContractFile;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 合同档案
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+public interface IContractFileService extends IService<ContractFile> {
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表和子表一起新增
+    * @Date 2021/11/17 16:21
+    * @Param [contractFile]
+    * @return void
+    */
+    void saveMainAndChild(ContractFile contractFile);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表和子表数据一起修改
+    * @Date 2021/11/17 16:41
+    * @Param [contractFile]
+    * @return void
+    */
+    void updateMainAndChild(ContractFile contractFile);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 主表和子表一起删除
+    * @Date 2021/11/17 17:23
+    * @Param [contractFile]
+    * @return void
+    */
+    void deleteMainAndChild(ContractFile contractFile);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据主表查询对应的所有子表数据
+    * @Date 2021/11/17 17:35
+    * @Param [contractFile]
+    * @return void
+    */
+    void queryMainAndChildById(ContractFile contractFile);
+}

+ 19 - 0
src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileAndBusinessServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.contract.file.service.impl;
+
+import org.jeecg.modules.contract.file.entity.ContractFileAndBusiness;
+import org.jeecg.modules.contract.file.mapper.ContractFileAndBusinessMapper;
+import org.jeecg.modules.contract.file.service.IContractFileAndBusinessService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 合同收款计划
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Service
+public class ContractFileAndBusinessServiceImpl extends ServiceImpl<ContractFileAndBusinessMapper, ContractFileAndBusiness> implements IContractFileAndBusinessService {
+
+}

+ 19 - 0
src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileModularServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.contract.file.service.impl;
+
+import org.jeecg.modules.contract.file.entity.ContractFileModular;
+import org.jeecg.modules.contract.file.mapper.ContractFileModularMapper;
+import org.jeecg.modules.contract.file.service.IContractFileModularService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 合同产品模块
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Service
+public class ContractFileModularServiceImpl extends ServiceImpl<ContractFileModularMapper, ContractFileModular> implements IContractFileModularService {
+
+}

+ 19 - 0
src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileProductServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.contract.file.service.impl;
+
+import org.jeecg.modules.contract.file.entity.ContractFileProduct;
+import org.jeecg.modules.contract.file.mapper.ContractFileProductMapper;
+import org.jeecg.modules.contract.file.service.IContractFileProductService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 合同产品
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Service
+public class ContractFileProductServiceImpl extends ServiceImpl<ContractFileProductMapper, ContractFileProduct> implements IContractFileProductService {
+
+}

+ 185 - 0
src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileServiceImpl.java

@@ -0,0 +1,185 @@
+package org.jeecg.modules.contract.file.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.modules.contract.file.entity.ContractFile;
+import org.jeecg.modules.contract.file.entity.ContractFileAndBusiness;
+import org.jeecg.modules.contract.file.entity.ContractFileModular;
+import org.jeecg.modules.contract.file.entity.ContractFileProduct;
+import org.jeecg.modules.contract.file.mapper.ContractFileMapper;
+import org.jeecg.modules.contract.file.service.IContractFileAndBusinessService;
+import org.jeecg.modules.contract.file.service.IContractFileModularService;
+import org.jeecg.modules.contract.file.service.IContractFileProductService;
+import org.jeecg.modules.contract.file.service.IContractFileService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 合同档案
+ * @author: jeecg-boot
+ * @date2021-11-17
+ * @version: V1.0
+ */
+@Service
+public class ContractFileServiceImpl extends ServiceImpl<ContractFileMapper, ContractFile> implements IContractFileService {
+
+    @Resource
+    ContractFileMapper contractFileMapper;
+    @Resource
+    IContractFileProductService iContractFileProductService;
+    @Resource
+    IContractFileModularService iContractFileModularService;
+    @Resource
+    IContractFileAndBusinessService iContractFileAndBusinessService;
+
+    @Override
+    public void saveMainAndChild(ContractFile contractFile) {
+        //新增主表
+        contractFileMapper.insert(contractFile);
+        //新增所有子表
+        saveChildAll(contractFile);
+    }
+
+    @Override
+    public void updateMainAndChild(ContractFile contractFile) {
+        //修改主表
+        contractFileMapper.updateById(contractFile);
+        //删除所有子表
+        deleteChildAll(contractFile);
+        //新增所有子表
+        saveChildAll(contractFile);
+
+    }
+
+    @Override
+    public void deleteMainAndChild(ContractFile contractFile) {
+        //主表删除
+        contractFile.setDelFlag("1");
+        contractFileMapper.updateById(contractFile);
+        //删除所有子表
+        deleteChildAll(contractFile);
+    }
+
+    @Override
+    public void queryMainAndChildById(ContractFile contractFile) {
+        //查询合同产品数据
+        QueryWrapper<ContractFileProduct> contractFileProductQueryWrapper=new QueryWrapper<>();
+        contractFileProductQueryWrapper.lambda().eq(ContractFileProduct::getContractFileId,contractFile.getId());
+        contractFileProductQueryWrapper.lambda().eq(ContractFileProduct::getDelFlag,"0");
+        contractFileProductQueryWrapper.lambda().orderByAsc(ContractFileProduct::getSort);
+        List<ContractFileProduct> contractFileProductList=iContractFileProductService.list(contractFileProductQueryWrapper);
+        //查询合同产品模块数据
+        QueryWrapper<ContractFileModular> contractFileModularQueryWrapper=new QueryWrapper<>();
+        contractFileModularQueryWrapper.lambda().eq(ContractFileModular::getContractFileId,contractFile.getId());
+        contractFileModularQueryWrapper.lambda().eq(ContractFileModular::getDelFlag,"0");
+        contractFileModularQueryWrapper.lambda().orderByAsc(ContractFileModular::getSort);
+        List<ContractFileModular> contractFileModularList=iContractFileModularService.list(contractFileModularQueryWrapper);
+        //查询合同收款计划数据
+        QueryWrapper<ContractFileAndBusiness> contractFileAndBusinessQueryWrapper=new QueryWrapper<>();
+        contractFileAndBusinessQueryWrapper.lambda().eq(ContractFileAndBusiness::getContractFileId,contractFile.getId());
+        contractFileAndBusinessQueryWrapper.lambda().eq(ContractFileAndBusiness::getDelFlag,"0");
+        contractFileAndBusinessQueryWrapper.lambda().orderByAsc(ContractFileAndBusiness::getSort);
+        List<ContractFileAndBusiness> contractFileAndBusinessList=iContractFileAndBusinessService.list(contractFileAndBusinessQueryWrapper);
+        //处理合同产品数据
+        //判空
+        if(contractFileProductList!=null&&contractFileProductList.size()>0){
+            if(contractFileModularList!=null&&contractFileModularList.size()>0){
+                //循环
+                for(ContractFileProduct product:contractFileProductList){
+                    List<ContractFileModular> modularList=new ArrayList<>();//存取对应产品的模块
+                    for(ContractFileModular modular:contractFileModularList){
+                        //根据产品id找到对应所属的模块
+                        if(product.getId().equals(modular.getContractFileProductId())){
+                            modularList.add(modular);
+                        }
+                    }
+                    //找到模块放入到当前循环的产品中
+                    product.setContractFileModularList(modularList);
+                }
+            }
+            //把产品放到合同主表中
+            contractFile.setContractFileProductList(contractFileProductList);
+        }
+        //把收款条件放到合同主表中
+        if(contractFileAndBusinessList!=null&&contractFileAndBusinessList.size()>0){
+            contractFile.setContractFileAndBusinessList(contractFileAndBusinessList);
+        }
+    }
+
+    /**新增所有子表*/
+    public void saveChildAll(ContractFile contractFile){
+        //新增合同产品表
+        if(contractFile.getContractFileProductList()!=null&&contractFile.getContractFileProductList().size()>0){
+            Integer sort=1;
+            for(ContractFileProduct contractFileProduct:contractFile.getContractFileProductList()){
+                contractFileProduct.setId(null);
+                contractFileProduct.setContractFileId(contractFile.getId());
+                contractFileProduct.setSort(sort);
+                sort++;
+            }
+            //保存合同产品
+            iContractFileProductService.saveBatch(contractFile.getContractFileProductList());
+            //新增合同产品模块表
+            List<ContractFileModular> contractFileModularList=new ArrayList<>();//储存合同产品模块表集合
+            //循环获取
+            for(ContractFileProduct contractFileProduct:contractFile.getContractFileProductList()){
+                String productId=contractFileProduct.getId();//合同产品id
+                //获取合同产品模块
+                if(contractFileProduct.getContractFileModularList()!=null&&contractFileProduct.getContractFileModularList().size()>0){
+                    Integer modularSort=1;
+                    for(ContractFileModular contractFileModular:contractFileProduct.getContractFileModularList()){
+                        contractFileModular.setId(null);
+                        contractFileModular.setContractFileId(contractFile.getId());
+                        contractFileModular.setContractFileProductId(productId);
+                        contractFileModular.setSort(modularSort);
+                        modularSort++;
+                        contractFileModularList.add(contractFileModular);
+                    }
+                }
+            }
+            //判断是否存在合同产品模块数据
+            if(contractFileModularList.size()>0){
+                //保存合同产品模块
+                iContractFileModularService.saveBatch(contractFileModularList);
+            }
+        }
+        //新增合同收款计划
+        if(contractFile.getContractFileAndBusinessList()!=null&&contractFile.getContractFileAndBusinessList().size()>0){
+            Integer busSort=1;
+            for(ContractFileAndBusiness contractFileAndBusiness:contractFile.getContractFileAndBusinessList()){
+                contractFileAndBusiness.setId(null);
+                contractFileAndBusiness.setContractFileId(contractFile.getId());
+                contractFileAndBusiness.setSort(busSort);
+                busSort++;
+            }
+            //保存合同收款计划
+            iContractFileAndBusinessService.saveBatch(contractFile.getContractFileAndBusinessList());
+        }
+    }
+
+    /**删除所有子表*/
+    public void deleteChildAll(ContractFile contractFile){
+        //删除合同产品表
+        QueryWrapper<ContractFileProduct> contractFileProductQueryWrapper=new QueryWrapper<>();
+        contractFileProductQueryWrapper.lambda().eq(ContractFileProduct::getContractFileId,contractFile.getId());
+        ContractFileProduct contractFileProduct=new ContractFileProduct();
+        contractFileProduct.setDelFlag("1");
+        iContractFileProductService.update(contractFileProduct,contractFileProductQueryWrapper);
+        //删除合同产品模板表
+        QueryWrapper<ContractFileModular> contractFileModularQueryWrapper=new QueryWrapper<>();
+        contractFileModularQueryWrapper.lambda().eq(ContractFileModular::getContractFileId,contractFile.getId());
+        ContractFileModular contractFileModular=new ContractFileModular();
+        contractFileModular.setDelFlag("1");
+        iContractFileModularService.update(contractFileModular,contractFileModularQueryWrapper);
+        //删除合同收款计划表
+        QueryWrapper<ContractFileAndBusiness> contractFileAndBusinessQueryWrapper=new QueryWrapper<>();
+        contractFileAndBusinessQueryWrapper.lambda().eq(ContractFileAndBusiness::getContractFileId,contractFile.getId());
+        ContractFileAndBusiness contractFileAndBusiness=new ContractFileAndBusiness();
+        contractFileAndBusiness.setDelFlag("1");
+        iContractFileAndBusinessService.update(contractFileAndBusinessQueryWrapper);
+    }
+}