Jelajahi Sumber

质量事故单

yuansh 2 tahun lalu
induk
melakukan
ab59ec5bee
19 mengubah file dengan 1551 tambahan dan 1 penghapusan
  1. 1 1
      jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActTaskController.java
  2. 372 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketController.java
  3. 195 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketMsgController.java
  4. 222 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicket.java
  5. 98 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicketChildren.java
  6. 78 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicketMsg.java
  7. 19 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketChildrenMapper.java
  8. 17 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketMapper.java
  9. 17 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketMsgMapper.java
  10. 16 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketChildrenMapper.xml
  11. 5 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketMapper.xml
  12. 5 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketMsgMapper.xml
  13. 16 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketChildrenService.java
  14. 14 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketMsgService.java
  15. 42 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketService.java
  16. 19 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketMsgServiceImpl.java
  17. 175 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketServiceImpl.java
  18. 222 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/vo/IncidentTicketPage.java
  19. 18 0
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDictController.java

+ 1 - 1
jeecg-boot/jeecg-boot-module-activiti/src/main/java/org/jeecg/modules/activiti/web/ActTaskController.java

@@ -666,7 +666,7 @@ public class ActTaskController {
             // 关联流程信息
             ActZprocess actProcess = actZprocessService.getById(htv.getProcDefId());
             if(actProcess!=null){
-                if(StringUtils.isNotBlank(defname.trim()) && !defname.trim().equals(actProcess.getName())){
+                if(StringUtils.isNotBlank(defname) && StringUtils.isNotBlank(defname.trim()) && !defname.trim().equals(actProcess.getName())){
                     return;
                 }
                 htv.setProcessName(actProcess.getName());

+ 372 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketController.java

@@ -0,0 +1,372 @@
+package org.jeecg.modules.oa.controller;
+
+import java.io.UnsupportedEncodingException;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+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.jeecg.common.system.vo.LoginUser;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import org.jeecg.modules.oa.entity.IncidentTicket;
+import org.jeecg.modules.oa.vo.IncidentTicketPage;
+import org.jeecg.modules.oa.service.IIncidentTicketService;
+import org.jeecg.modules.oa.service.IIncidentTicketChildrenService;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+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 com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Api(tags="森_工厂质量事故单-主表")
+@RestController
+@RequestMapping("/oa/incidentTicket")
+@Slf4j
+public class IncidentTicketController {
+	@Autowired
+	private IIncidentTicketService incidentTicketService;
+	@Autowired
+	private IIncidentTicketChildrenService incidentTicketChildrenService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param incidentTicket
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-分页列表查询")
+	@ApiOperation(value="森_工厂质量事故单-主表-分页列表查询", notes="森_工厂质量事故单-主表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(IncidentTicket incidentTicket,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, req.getParameterMap());
+		Page<IncidentTicket> page = new Page<IncidentTicket>(pageNo, pageSize);
+		IPage<IncidentTicket> pageList = incidentTicketService.page(page, queryWrapper);
+		return Result.ok(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param incidentTicketPage
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-添加")
+	@ApiOperation(value="森_工厂质量事故单-主表-添加", notes="森_工厂质量事故单-主表-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody IncidentTicketPage incidentTicketPage) {
+		IncidentTicket incidentTicket = new IncidentTicket();
+		BeanUtils.copyProperties(incidentTicketPage, incidentTicket);
+		incidentTicketService.saveMain(incidentTicket, incidentTicketPage.getIncidentTicketChildrenList());
+		return Result.ok("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param incidentTicketPage
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-编辑")
+	@ApiOperation(value="森_工厂质量事故单-主表-编辑", notes="森_工厂质量事故单-主表-编辑")
+	@PutMapping(value = "/edit")
+	public Result<?> edit(@RequestBody IncidentTicketPage incidentTicketPage) {
+		IncidentTicket incidentTicket = new IncidentTicket();
+		BeanUtils.copyProperties(incidentTicketPage, incidentTicket);
+		IncidentTicket incidentTicketEntity = incidentTicketService.getById(incidentTicket.getId());
+		if(incidentTicketEntity==null) {
+			return Result.error("未找到对应数据");
+		}
+		incidentTicketService.updateMain(incidentTicket, incidentTicketPage.getIncidentTicketChildrenList());
+		return Result.ok("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-通过id删除")
+	@ApiOperation(value="森_工厂质量事故单-主表-通过id删除", notes="森_工厂质量事故单-主表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		incidentTicketService.delMain(id);
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-批量删除")
+	@ApiOperation(value="森_工厂质量事故单-主表-批量删除", notes="森_工厂质量事故单-主表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.incidentTicketService.delBatchMain(Arrays.asList(ids.split(",")));
+		return Result.ok("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-主表-通过id查询")
+	@ApiOperation(value="森_工厂质量事故单-主表-通过id查询", notes="森_工厂质量事故单-主表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		IncidentTicket incidentTicket = incidentTicketService.getById(id);
+		if(incidentTicket==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.ok(incidentTicket);
+
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "森_工厂质量事故单-子表集合-通过id查询")
+	@ApiOperation(value="森_工厂质量事故单-子表集合-通过id查询", notes="森_工厂质量事故单-子表-通过id查询")
+	@GetMapping(value = "/queryIncidentTicketChildrenByMainId")
+	public Result<?> queryIncidentTicketChildrenListByMainId(@RequestParam(name="id",required=true) String id) {
+		List<IncidentTicketChildren> incidentTicketChildrenList = incidentTicketChildrenService.selectByMainId(id);
+		return Result.ok(incidentTicketChildrenList);
+	}
+
+	/**
+	 * 方珂通知其他人员
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "方珂通知其他人员")
+	@ApiOperation(value="方珂通知其他人员", notes="方珂通知其他人员")
+	@GetMapping(value = "/noticeUser")
+	public Result<?> noticeUser(String ids,String headId,String code,String title) {
+
+		if(StringUtils.isBlank(ids) || StringUtils.isBlank(headId)|| StringUtils.isBlank(code)|| StringUtils.isBlank(title)){
+			return Result.error("参数不完整");
+		}
+		String info = incidentTicketService.noticeUser(ids,headId,code,title);
+		if(info.equals("false")){
+			return Result.error("数据异常,请联系管理员");
+		}else{
+			return Result.ok(info);
+		}
+
+	}
+
+
+	/**
+	 * 其他人员通知方珂
+	 *
+	 * @param headId
+	 * @return
+	 */
+	@AutoLog(value = "其他人员通知方珂")
+	@ApiOperation(value="其他人员通知方珂", notes="其他人员通知方珂")
+	@GetMapping(value = "/noticeUserReturn")
+	public Result<?> noticeUserReturn(String headId,String code,String title) {
+
+		if(StringUtils.isBlank(headId)|| StringUtils.isBlank(code)|| StringUtils.isBlank(title)){
+			return Result.error("参数不完整");
+		}
+		String info = incidentTicketService.noticeUserReturn(headId,code,title);
+		if(info.equals("false")){
+			return Result.error("数据异常,请联系管理员");
+		}else{
+			return Result.ok(info);
+		}
+
+	}
+
+
+	/**
+	 * 推送
+	 *
+	 * @param headId
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单-推送")
+	@ApiOperation(value="质量事故单-推送", notes="质量事故单-推送")
+	@GetMapping(value = "/propelling")
+	public Result<?> propelling(String headId) {
+
+		if(StringUtils.isBlank(headId)){
+			return Result.error("参数不完整");
+		}
+
+		IncidentTicket incidentTicket = incidentTicketService.getById(headId);
+		if(incidentTicket==null) {
+			return Result.error("未找到对应数据");
+		}
+
+		if(incidentTicket.getState().equals("3")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			incidentTicket.setState("4");
+			incidentTicketService.save(incidentTicket);
+			return Result.ok("已完结");
+		}else{
+			return Result.ok("此单据状态下无法推送");
+		}
+
+
+	}
+
+
+	/**
+	 * 完结
+	 *
+	 * @param headId
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单-完结")
+	@ApiOperation(value="质量事故单-完结", notes="质量事故单-完结")
+	@GetMapping(value = "/endOrder")
+	public Result<?> endOrder(String headId) {
+
+		if(StringUtils.isBlank(headId)){
+			return Result.error("参数不完整");
+		}
+		IncidentTicket incidentTicket = incidentTicketService.getById(headId);
+		if(incidentTicket==null) {
+			return Result.error("未找到对应数据");
+		}
+		//完结操作可跳过推送,直接完结
+		if(incidentTicket.getState().equals("3") || incidentTicket.getState().equals("4")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			incidentTicket.setState("5");
+			incidentTicketService.save(incidentTicket);
+			return Result.ok("已完结");
+		}else{
+			return Result.ok("此单据状态下无法完结");
+		}
+
+
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param incidentTicket
+    */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, IncidentTicket incidentTicket) {
+      // Step.1 组装查询条件查询数据
+      QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, request.getParameterMap());
+      LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+      //Step.2 获取导出数据
+      List<IncidentTicket> queryList = incidentTicketService.list(queryWrapper);
+      // 过滤选中数据
+      String selections = request.getParameter("selections");
+      List<IncidentTicket> incidentTicketList = new ArrayList<IncidentTicket>();
+      if(oConvertUtils.isEmpty(selections)) {
+          incidentTicketList = queryList;
+      }else {
+          List<String> selectionList = Arrays.asList(selections.split(","));
+          incidentTicketList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
+      }
+
+      // Step.3 组装pageList
+      List<IncidentTicketPage> pageList = new ArrayList<IncidentTicketPage>();
+      for (IncidentTicket main : incidentTicketList) {
+          IncidentTicketPage vo = new IncidentTicketPage();
+          BeanUtils.copyProperties(main, vo);
+          List<IncidentTicketChildren> incidentTicketChildrenList = incidentTicketChildrenService.selectByMainId(main.getId());
+          vo.setIncidentTicketChildrenList(incidentTicketChildrenList);
+          pageList.add(vo);
+      }
+
+      // Step.4 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      mv.addObject(NormalExcelConstants.FILE_NAME, "森_工厂质量事故单-主表列表");
+      mv.addObject(NormalExcelConstants.CLASS, IncidentTicketPage.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("森_工厂质量事故单-主表数据", "导出人:"+sysUser.getRealname(), "森_工厂质量事故单-主表"));
+      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<IncidentTicketPage> list = ExcelImportUtil.importExcel(file.getInputStream(), IncidentTicketPage.class, params);
+              for (IncidentTicketPage page : list) {
+                  IncidentTicket po = new IncidentTicket();
+                  BeanUtils.copyProperties(page, po);
+                  incidentTicketService.saveMain(po, page.getIncidentTicketChildrenList());
+              }
+              return Result.ok("文件导入成功!数据行数:" + list.size());
+          } catch (Exception e) {
+              log.error(e.getMessage(),e);
+              return Result.error("文件导入失败:"+e.getMessage());
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+    }
+
+}

+ 195 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/controller/IncidentTicketMsgController.java

@@ -0,0 +1,195 @@
+package org.jeecg.modules.oa.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
+import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
+
+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.jeecg.modules.system.entity.SysPermission;
+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.jeecg.common.system.base.controller.JeecgController;
+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;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 质量事故单消息发送人员
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Api(tags="质量事故单消息发送人员")
+@RestController
+@RequestMapping("/oa/incidentTicketMsg")
+@Slf4j
+public class IncidentTicketMsgController extends JeecgController<IncidentTicketMsg, IIncidentTicketMsgService> {
+	@Autowired
+	private IIncidentTicketMsgService incidentTicketMsgService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param incidentTicketMsg
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-分页列表查询")
+	@ApiOperation(value="质量事故单消息发送人员-分页列表查询", notes="质量事故单消息发送人员-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(IncidentTicketMsg incidentTicketMsg,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<IncidentTicketMsg> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicketMsg, req.getParameterMap());
+		Page<IncidentTicketMsg> page = new Page<IncidentTicketMsg>(pageNo, pageSize);
+		IPage<IncidentTicketMsg> pageList = incidentTicketMsgService.page(page, queryWrapper);
+		return Result.ok(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param incidentTicketMsg
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-添加")
+	@ApiOperation(value="质量事故单消息发送人员-添加", notes="质量事故单消息发送人员-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody IncidentTicketMsg incidentTicketMsg) {
+		incidentTicketMsgService.save(incidentTicketMsg);
+		return Result.ok("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param incidentTicketMsg
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-编辑")
+	@ApiOperation(value="质量事故单消息发送人员-编辑", notes="质量事故单消息发送人员-编辑")
+	@PutMapping(value = "/edit")
+	public Result<?> edit(@RequestBody IncidentTicketMsg incidentTicketMsg) {
+		incidentTicketMsgService.updateById(incidentTicketMsg);
+		return Result.ok("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-通过id删除")
+	@ApiOperation(value="质量事故单消息发送人员-通过id删除", notes="质量事故单消息发送人员-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		incidentTicketMsgService.removeById(id);
+		return Result.ok("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-批量删除")
+	@ApiOperation(value="质量事故单消息发送人员-批量删除", notes="质量事故单消息发送人员-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.incidentTicketMsgService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.ok("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-通过id查询")
+	@ApiOperation(value="质量事故单消息发送人员-通过id查询", notes="质量事故单消息发送人员-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		IncidentTicketMsg incidentTicketMsg = incidentTicketMsgService.getById(id);
+		if(incidentTicketMsg==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.ok(incidentTicketMsg);
+	}
+
+
+	/**
+	 * 通过质量事故单主键查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "质量事故单消息发送人员-通过质量事故单主键查询")
+	@ApiOperation(value="质量事故单消息发送人员-通过质量事故单主键查询", notes="质量事故单消息发送人员-通过质量事故单主键查询")
+	@GetMapping(value = "/queryByMainId")
+	public Result<?> queryByMainId(@RequestParam(name="id",required=true) String id) {
+
+		LambdaQueryWrapper<IncidentTicketMsg> query = new LambdaQueryWrapper<IncidentTicketMsg>();
+		query.eq(IncidentTicketMsg::getPkIncidentTicket,id);
+		List<IncidentTicketMsg> list = incidentTicketMsgService.list(query);
+		if(list.size() < 1) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.ok(list);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param incidentTicketMsg
+    */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, IncidentTicketMsg incidentTicketMsg) {
+        return super.exportXls(request, incidentTicketMsg, IncidentTicketMsg.class, "质量事故单消息发送人员");
+    }
+
+    /**
+	 * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, IncidentTicketMsg.class);
+    }
+
+}

+ 222 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicket.java

@@ -0,0 +1,222 @@
+package org.jeecg.modules.oa.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;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@ApiModel(value="incident_ticket对象", description="森_工厂质量事故单-主表")
+@Data
+@TableName("incident_ticket")
+public class IncidentTicket implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ID_WORKER_STR)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    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")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+	@Excel(name = "更新人", width = 15)
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@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")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+	@Excel(name = "所属部门", width = 15)
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private String accidentData;
+	/**质量事故单主题*/
+	@Excel(name = "质量事故单主题", width = 15)
+    @ApiModelProperty(value = "质量事故单主题")
+    private String accidentTheme;
+	/**事故责任人*/
+	@Excel(name = "事故责任人", width = 15)
+    @ApiModelProperty(value = "事故责任人")
+    private String accidentPersonLiable;
+	/**供应商*/
+	@Excel(name = "供应商", width = 15)
+    @ApiModelProperty(value = "供应商")
+    private String supplier;
+	/**责任人*/
+	@Excel(name = "责任人", width = 15)
+    @ApiModelProperty(value = "责任人")
+    private String personLiable;
+	/**质量事故单号*/
+	@Excel(name = "质量事故单号", width = 15)
+    @ApiModelProperty(value = "质量事故单号")
+    private String accidentNumber;
+	/**客户*/
+	@Excel(name = "客户", width = 15)
+    @ApiModelProperty(value = "客户")
+    private String customer;
+	/**工厂*/
+	@Excel(name = "工厂", width = 15)
+    @ApiModelProperty(value = "工厂")
+    private String factory;
+	/**责任人1*/
+	@Excel(name = "责任人1", width = 15)
+    @ApiModelProperty(value = "责任人1")
+    private String responsibilityPerson1;
+	/**责任人2*/
+	@Excel(name = "责任人2", width = 15)
+    @ApiModelProperty(value = "责任人2")
+    private String responsibilityPerson2;
+	/**责任人3*/
+	@Excel(name = "责任人3", width = 15)
+    @ApiModelProperty(value = "责任人3")
+    private String responsibilityPerson3;
+	/**责任人4*/
+	@Excel(name = "责任人4", width = 15)
+    @ApiModelProperty(value = "责任人4")
+    private String responsibilityPerson4;
+	/**责任人5*/
+	@Excel(name = "责任人5", width = 15)
+    @ApiModelProperty(value = "责任人5")
+    private String responsibilityPerson5;
+	/**金额1*/
+	@Excel(name = "金额1", width = 15)
+    @ApiModelProperty(value = "金额1")
+    private String sum1;
+	/**金额2*/
+	@Excel(name = "金额2", width = 15)
+    @ApiModelProperty(value = "金额2")
+    private String sum2;
+	/**金额3*/
+	@Excel(name = "金额3", width = 15)
+    @ApiModelProperty(value = "金额3")
+    private String sum3;
+	/**金额4*/
+	@Excel(name = "金额4", width = 15)
+    @ApiModelProperty(value = "金额4")
+    private String sum4;
+	/**金额5*/
+	@Excel(name = "金额5", width = 15)
+    @ApiModelProperty(value = "金额5")
+    private String sum5;
+	/**责任单位*/
+	@Excel(name = "责任单位", width = 15)
+    @ApiModelProperty(value = "责任单位")
+    private String responsibilityCompany;
+	/**币种*/
+	@Excel(name = "币种", width = 15)
+    @ApiModelProperty(value = "币种")
+    private String moneyType;
+	/**总金额*/
+	@Excel(name = "总金额", width = 15)
+    @ApiModelProperty(value = "总金额")
+    private String totalMoney;
+	/**业务类型*/
+	@Excel(name = "业务类型", width = 15)
+    @ApiModelProperty(value = "业务类型")
+    private String businessType;
+	/**成衣销售订单号*/
+	@Excel(name = "成衣销售订单号", width = 15)
+    @ApiModelProperty(value = "成衣销售订单号")
+    private String garmentSalesOrder;
+	/**款号*/
+	@Excel(name = "款号", width = 15)
+    @ApiModelProperty(value = "款号")
+    private String styleNumber;
+	/**物料*/
+	@Excel(name = "物料", width = 15)
+    @ApiModelProperty(value = "物料")
+    private String material;
+	/**计划员*/
+	@Excel(name = "计划员", width = 15)
+    @ApiModelProperty(value = "计划员")
+    private String planPersonnel;
+	/**业务员*/
+	@Excel(name = "业务员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
+    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
+    @ApiModelProperty(value = "业务员")
+    private String businessPeople;
+	/**QC*/
+	@Excel(name = "QC", width = 15)
+    @ApiModelProperty(value = "QC")
+    private String qualityControl;
+	/**计划单号(主)*/
+	@Excel(name = "计划单号(主)", width = 15)
+    @ApiModelProperty(value = "计划单号(主)")
+    private String planNumber;
+	/**事故类型(主)*/
+	@Excel(name = "事故类型(主)", width = 15)
+    @ApiModelProperty(value = "事故类型(主)")
+    private String accidentType;
+	/**事故金额(主)*/
+	@Excel(name = "事故金额(主)", width = 15)
+    @ApiModelProperty(value = "事故金额(主)")
+    private String accidentSum;
+	/**情况说明*/
+	@Excel(name = "情况说明", width = 15)
+    @ApiModelProperty(value = "情况说明")
+    private String presentationCondition;
+	/**附件上传*/
+	@Excel(name = "附件上传", width = 15)
+    @ApiModelProperty(value = "附件上传")
+    private String accessory;
+	/**填报人*/
+	@Excel(name = "填报人", width = 15, dictTable = "sys_user ", dicText = "realname", dicCode = "username")
+    @Dict(dictTable = "sys_user ", dicText = "realname", dicCode = "username")
+    @ApiModelProperty(value = "填报人")
+    private String informant;
+	/**工厂签章*/
+	@Excel(name = "工厂签章", width = 15)
+    @ApiModelProperty(value = "工厂签章")
+    private String factorySignature;
+	/**财务备注*/
+	@Excel(name = "财务备注", width = 15)
+    @ApiModelProperty(value = "财务备注")
+    private String financeRemark;
+	/**添加附件*/
+	@Excel(name = "添加附件", width = 15)
+    @ApiModelProperty(value = "添加附件")
+    private String accessory2;
+	/**是否部门负责人*/
+	@Excel(name = "是否部门负责人", width = 15)
+    @ApiModelProperty(value = "是否部门负责人")
+    private String isLeaders;
+	/**森_工厂质量事故单(子)*/
+	@Excel(name = "森_工厂质量事故单(子)", width = 15)
+    @ApiModelProperty(value = "森_工厂质量事故单(子)")
+    private String incidentTicketId;
+	/**子表控件*/
+	@Excel(name = "子表控件", width = 15)
+    @ApiModelProperty(value = "子表控件")
+    private String tableNameChildren;
+	/**1未处理 2已通知 3通知已反馈 4已推送 5已完结*/
+	@Excel(name = "1未处理 2已通知 3通知已反馈 4已推送 5已完结", width = 15)
+    @ApiModelProperty(value = "1未处理 2已通知 3通知已反馈 4已推送 5已完结")
+    private String state;
+}

+ 98 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicketChildren.java

@@ -0,0 +1,98 @@
+package org.jeecg.modules.oa.entity;
+
+import java.io.Serializable;
+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;
+import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 森_工厂质量事故单-子表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@ApiModel(value="incident_ticket对象", description="森_工厂质量事故单-主表")
+@Data
+@TableName("incident_ticket_children")
+public class IncidentTicketChildren implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ID_WORKER_STR)
+	@ApiModelProperty(value = "主键")
+	private String id;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	@ApiModelProperty(value = "创建人")
+	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")
+	@ApiModelProperty(value = "创建日期")
+	private Date createTime;
+	/**更新人*/
+	@Excel(name = "更新人", width = 15)
+	@ApiModelProperty(value = "更新人")
+	private String updateBy;
+	/**更新日期*/
+	@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")
+	@ApiModelProperty(value = "更新日期")
+	private Date updateTime;
+	/**所属部门*/
+	@Excel(name = "所属部门", width = 15)
+	@ApiModelProperty(value = "所属部门")
+	private String sysOrgCode;
+	/**计划单号*/
+	@Excel(name = "计划单号", width = 15)
+	@ApiModelProperty(value = "计划单号")
+	private String planNumber;
+	/**事故类型*/
+	@Excel(name = "事故类型", width = 15)
+	@ApiModelProperty(value = "事故类型")
+	private String accidentType;
+	/**事故金额*/
+	@Excel(name = "事故金额", width = 15)
+	@ApiModelProperty(value = "事故金额")
+	private String accidentSum;
+	/**汇率*/
+	@Excel(name = "汇率", width = 15)
+	@ApiModelProperty(value = "汇率")
+	private String exchangeRate;
+	/**实际事故金额*/
+	@Excel(name = "实际事故金额", width = 15)
+	@ApiModelProperty(value = "实际事故金额")
+	private String practicalSum;
+	/**U8生成运费发票号*/
+	@Excel(name = "U8生成运费发票号", width = 15)
+	@ApiModelProperty(value = "U8生成运费发票号")
+	private String u8Invoice;
+	/**账套号*/
+	@Excel(name = "账套号", width = 15)
+	@ApiModelProperty(value = "账套号")
+	private String zhanghaoId;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	/**是否部门负责人*/
+	@Excel(name = "是否部门负责人", width = 15)
+	@ApiModelProperty(value = "是否部门负责人")
+	private String isLeaders;
+	/**主表id*/
+	@ApiModelProperty(value = "主表id")
+	private String incidentTicketId;
+	/**报错字段sort*/
+	@Excel(name = "报错字段sort", width = 15)
+	@ApiModelProperty(value = "报错字段sort")
+	private String sort;
+}

+ 78 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/entity/IncidentTicketMsg.java

@@ -0,0 +1,78 @@
+package org.jeecg.modules.oa.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+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;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 质量事故单消息发送人员
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Data
+@TableName("incident_ticket_msg")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="incident_ticket_msg对象", description="质量事故单消息发送人员")
+public class IncidentTicketMsg implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ID_WORKER_STR)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+    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")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+	@Excel(name = "更新人", width = 15)
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@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")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+	@Excel(name = "所属部门", width = 15)
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**通知人编码*/
+	@Excel(name = "通知人编码", width = 15)
+    @ApiModelProperty(value = "通知人编码")
+    private String userId;
+	/**通知人名称*/
+	@Excel(name = "通知人名称", width = 15)
+    @ApiModelProperty(value = "通知人名称")
+    private String userName;
+	/**确认通知至方珂*/
+	@Excel(name = "确认通知至方珂", width = 15)
+    @ApiModelProperty(value = "确认通知至方珂")
+    private String confirm;
+	/**质量事故单主表主键*/
+	@Excel(name = "质量事故单主表主键", width = 15)
+    @ApiModelProperty(value = "质量事故单主表主键")
+    private String pkIncidentTicket;
+}

+ 19 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketChildrenMapper.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.oa.mapper;
+
+import java.util.List;
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description: 森_工厂质量事故单-子表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IncidentTicketChildrenMapper extends BaseMapper<IncidentTicketChildren> {
+
+	public boolean deleteByMainId(@Param("mainId") String mainId);
+    
+	public List<IncidentTicketChildren> selectByMainId(@Param("mainId") String mainId);
+}

+ 17 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.oa.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.oa.entity.IncidentTicket;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IncidentTicketMapper extends BaseMapper<IncidentTicket> {
+
+}

+ 17 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/IncidentTicketMsgMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.oa.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 质量事故单消息发送人员
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IncidentTicketMsgMapper extends BaseMapper<IncidentTicketMsg> {
+
+}

+ 16 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketChildrenMapper.xml

@@ -0,0 +1,16 @@
+<?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.oa.mapper.IncidentTicketChildrenMapper">
+
+	<delete id="deleteByMainId" parameterType="java.lang.String">
+		DELETE 
+		FROM  incident_ticket_children 
+		WHERE
+			 incident_ticket_id = #{mainId} 	</delete>
+	
+	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.oa.entity.IncidentTicketChildren">
+		SELECT * 
+		FROM  incident_ticket_children
+		WHERE
+			 incident_ticket_id = #{mainId} 	</select>
+</mapper>

+ 5 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketMapper.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.oa.mapper.IncidentTicketMapper">
+
+</mapper>

+ 5 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/mapper/xml/IncidentTicketMsgMapper.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.oa.mapper.IncidentTicketMsgMapper">
+
+</mapper>

+ 16 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketChildrenService.java

@@ -0,0 +1,16 @@
+package org.jeecg.modules.oa.service;
+
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.util.List;
+
+/**
+ * @Description: 森_工厂质量事故单-子表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IIncidentTicketChildrenService extends IService<IncidentTicketChildren> {
+
+	public List<IncidentTicketChildren> selectByMainId(String mainId);
+}

+ 14 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketMsgService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.oa.service;
+
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 质量事故单消息发送人员
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IIncidentTicketMsgService extends IService<IncidentTicketMsg> {
+
+}

+ 42 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/IIncidentTicketService.java

@@ -0,0 +1,42 @@
+package org.jeecg.modules.oa.service;
+
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import org.jeecg.modules.oa.entity.IncidentTicket;
+import com.baomidou.mybatisplus.extension.service.IService;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+public interface IIncidentTicketService extends IService<IncidentTicket> {
+
+	/**
+	 * 添加一对多
+	 * 
+	 */
+	public void saveMain(IncidentTicket incidentTicket,List<IncidentTicketChildren> incidentTicketChildrenList) ;
+	
+	/**
+	 * 修改一对多
+	 * 
+	 */
+	public void updateMain(IncidentTicket incidentTicket,List<IncidentTicketChildren> incidentTicketChildrenList);
+	
+	/**
+	 * 删除一对多
+	 */
+	public void delMain (String id);
+	
+	/**
+	 * 批量删除一对多
+	 */
+	public void delBatchMain (Collection<? extends Serializable> idList);
+
+	public String noticeUser(String ids,String headId,String code,String title);
+	public String noticeUserReturn(String headId,String code,String title);
+}

+ 19 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketMsgServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.oa.service.impl;
+
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
+import org.jeecg.modules.oa.mapper.IncidentTicketMsgMapper;
+import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 质量事故单消息发送人员
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Service
+public class IncidentTicketMsgServiceImpl extends ServiceImpl<IncidentTicketMsgMapper, IncidentTicketMsg> implements IIncidentTicketMsgService {
+
+}

+ 175 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/service/impl/IncidentTicketServiceImpl.java

@@ -0,0 +1,175 @@
+package org.jeecg.modules.oa.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.oa.entity.IncidentTicket;
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
+import org.jeecg.modules.oa.mapper.IncidentTicketChildrenMapper;
+import org.jeecg.modules.oa.mapper.IncidentTicketMapper;
+import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
+import org.jeecg.modules.oa.service.IIncidentTicketService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Collection;
+
+/**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Service
+public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper, IncidentTicket> implements IIncidentTicketService {
+
+	@Autowired
+	private IncidentTicketMapper incidentTicketMapper;
+	@Autowired
+	private IncidentTicketChildrenMapper incidentTicketChildrenMapper;
+	@Autowired
+	private ISysBaseAPI sysBaseAPI;
+	@Autowired
+	private IIncidentTicketMsgService iIncidentTicketMsgService;
+	@Autowired
+	private IIncidentTicketService iIncidentTicketService;
+
+	@Override
+	@Transactional
+	public String noticeUser(String ids,String headId,String code,String title){
+
+		String[] idList = ids.split(",");
+		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		HashMap<String,Object> taskParam = new HashMap<>();
+
+		for(String o:idList){
+
+			sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),o,"质量事故单",code+"  "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
+			IncidentTicketMsg incidentTicketMsg = new IncidentTicketMsg();
+			LoginUser loginUser = sysBaseAPI.getUserByName(o);
+			incidentTicketMsg.setPkIncidentTicket(headId);
+			incidentTicketMsg.setUserId(o);
+			incidentTicketMsg.setUserName(loginUser.getRealname());
+			iIncidentTicketMsgService.save(incidentTicketMsg);
+
+		}
+
+		IncidentTicket incidentTicketEntity = incidentTicketMapper.selectById(headId);
+		if(incidentTicketEntity==null) {
+			return "未找到对应数据";
+		}
+		incidentTicketEntity.setState("2");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+		iIncidentTicketService.save(incidentTicketEntity);
+
+		return "已通知";
+	}
+
+
+	@Override
+	@Transactional
+	public String noticeUserReturn(String headId,String code,String title){
+
+		LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+		LambdaQueryWrapper<IncidentTicketMsg> query = new LambdaQueryWrapper<IncidentTicketMsg>();
+		query.eq(IncidentTicketMsg::getPkIncidentTicket,headId);
+		List<IncidentTicketMsg> list = iIncidentTicketMsgService.list(query);
+
+		boolean isAuth = false;
+		boolean isComplete = true;
+
+		for (IncidentTicketMsg o:list){
+			String userId = o.getUserId();
+
+			if(userId.equals(sysUser.getUsername())){
+				if (StringUtils.isNotBlank(o.getConfirm()) && o.getConfirm().equals("已通知")){
+					return "您已通知,请勿重新操作";
+				}
+
+				o.setConfirm("已通知");
+				iIncidentTicketMsgService.save(o);
+				isAuth = true;
+			}
+
+			if (StringUtils.isBlank(o.getConfirm()) || !o.getConfirm().equals("已通知")){
+				isComplete = false;
+			}
+		}
+
+		if(!isAuth){
+			return "您无权此操作此事故单";
+		}
+
+		HashMap<String,Object> taskParam = new HashMap<>();
+
+		sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),"T0008","质量事故单",code+"  "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
+
+		if(isComplete){
+			IncidentTicket incidentTicketEntity = incidentTicketMapper.selectById(headId);
+			if(incidentTicketEntity==null) {
+				return "未找到对应数据";
+			}
+			incidentTicketEntity.setState("3");//1未处理 2已通知 3通知已反馈 4已推送 5已完结
+			iIncidentTicketService.save(incidentTicketEntity);
+		}
+
+		return "已通知";
+	}
+
+
+	@Override
+	@Transactional
+	public void saveMain(IncidentTicket incidentTicket, List<IncidentTicketChildren> incidentTicketChildrenList) {
+		incidentTicketMapper.insert(incidentTicket);
+		if(incidentTicketChildrenList!=null && incidentTicketChildrenList.size()>0) {
+			for(IncidentTicketChildren entity:incidentTicketChildrenList) {
+				//外键设置
+				entity.setIncidentTicketId(incidentTicket.getId());
+				incidentTicketChildrenMapper.insert(entity);
+			}
+		}
+	}
+
+	@Override
+	@Transactional
+	public void updateMain(IncidentTicket incidentTicket,List<IncidentTicketChildren> incidentTicketChildrenList) {
+		incidentTicketMapper.updateById(incidentTicket);
+		
+		//1.先删除子表数据
+		incidentTicketChildrenMapper.deleteByMainId(incidentTicket.getId());
+		
+		//2.子表数据重新插入
+		if(incidentTicketChildrenList!=null && incidentTicketChildrenList.size()>0) {
+			for(IncidentTicketChildren entity:incidentTicketChildrenList) {
+				//外键设置
+				entity.setIncidentTicketId(incidentTicket.getId());
+				incidentTicketChildrenMapper.insert(entity);
+			}
+		}
+	}
+
+	@Override
+	@Transactional
+	public void delMain(String id) {
+		incidentTicketChildrenMapper.deleteByMainId(id);
+		incidentTicketMapper.deleteById(id);
+	}
+
+	@Override
+	@Transactional
+	public void delBatchMain(Collection<? extends Serializable> idList) {
+		for(Serializable id:idList) {
+			incidentTicketChildrenMapper.deleteByMainId(id.toString());
+			incidentTicketMapper.deleteById(id);
+		}
+	}
+	
+}

+ 222 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/oa/vo/IncidentTicketPage.java

@@ -0,0 +1,222 @@
+package org.jeecg.modules.oa.vo;
+
+import java.util.List;
+import org.jeecg.modules.oa.entity.IncidentTicket;
+import org.jeecg.modules.oa.entity.IncidentTicketChildren;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecgframework.poi.excel.annotation.ExcelEntity;
+import org.jeecgframework.poi.excel.annotation.ExcelCollection;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.util.Date;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Description: 森_工厂质量事故单-主表
+ * @Author: jeecg-boot
+ * @Date:   2023-02-22
+ * @Version: V1.0
+ */
+@Data
+@ApiModel(value="incident_ticketPage对象", description="森_工厂质量事故单-主表")
+public class IncidentTicketPage {
+	
+	/**主键*/
+	@ApiModelProperty(value = "主键")
+	private String id;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	@ApiModelProperty(value = "创建人")
+	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")
+	@ApiModelProperty(value = "创建日期")
+	private Date createTime;
+	/**更新人*/
+	@Excel(name = "更新人", width = 15)
+	@ApiModelProperty(value = "更新人")
+	private String updateBy;
+	/**更新日期*/
+	@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")
+	@ApiModelProperty(value = "更新日期")
+	private Date updateTime;
+	/**所属部门*/
+	@Excel(name = "所属部门", width = 15)
+	@ApiModelProperty(value = "所属部门")
+	private String sysOrgCode;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+	@ApiModelProperty(value = "日期")
+	private String accidentData;
+	/**质量事故单主题*/
+	@Excel(name = "质量事故单主题", width = 15)
+	@ApiModelProperty(value = "质量事故单主题")
+	private String accidentTheme;
+	/**事故责任人*/
+	@Excel(name = "事故责任人", width = 15)
+	@ApiModelProperty(value = "事故责任人")
+	private String accidentPersonLiable;
+	/**供应商*/
+	@Excel(name = "供应商", width = 15)
+	@ApiModelProperty(value = "供应商")
+	private String supplier;
+	/**责任人*/
+	@Excel(name = "责任人", width = 15)
+	@ApiModelProperty(value = "责任人")
+	private String personLiable;
+	/**质量事故单号*/
+	@Excel(name = "质量事故单号", width = 15)
+	@ApiModelProperty(value = "质量事故单号")
+	private String accidentNumber;
+	/**客户*/
+	@Excel(name = "客户", width = 15)
+	@ApiModelProperty(value = "客户")
+	private String customer;
+	/**工厂*/
+	@Excel(name = "工厂", width = 15)
+	@ApiModelProperty(value = "工厂")
+	private String factory;
+	/**责任人1*/
+	@Excel(name = "责任人1", width = 15)
+	@ApiModelProperty(value = "责任人1")
+	private String responsibilityPerson1;
+	/**责任人2*/
+	@Excel(name = "责任人2", width = 15)
+	@ApiModelProperty(value = "责任人2")
+	private String responsibilityPerson2;
+	/**责任人3*/
+	@Excel(name = "责任人3", width = 15)
+	@ApiModelProperty(value = "责任人3")
+	private String responsibilityPerson3;
+	/**责任人4*/
+	@Excel(name = "责任人4", width = 15)
+	@ApiModelProperty(value = "责任人4")
+	private String responsibilityPerson4;
+	/**责任人5*/
+	@Excel(name = "责任人5", width = 15)
+	@ApiModelProperty(value = "责任人5")
+	private String responsibilityPerson5;
+	/**金额1*/
+	@Excel(name = "金额1", width = 15)
+	@ApiModelProperty(value = "金额1")
+	private String sum1;
+	/**金额2*/
+	@Excel(name = "金额2", width = 15)
+	@ApiModelProperty(value = "金额2")
+	private String sum2;
+	/**金额3*/
+	@Excel(name = "金额3", width = 15)
+	@ApiModelProperty(value = "金额3")
+	private String sum3;
+	/**金额4*/
+	@Excel(name = "金额4", width = 15)
+	@ApiModelProperty(value = "金额4")
+	private String sum4;
+	/**金额5*/
+	@Excel(name = "金额5", width = 15)
+	@ApiModelProperty(value = "金额5")
+	private String sum5;
+	/**责任单位*/
+	@Excel(name = "责任单位", width = 15)
+	@ApiModelProperty(value = "责任单位")
+	private String responsibilityCompany;
+	/**币种*/
+	@Excel(name = "币种", width = 15)
+	@ApiModelProperty(value = "币种")
+	private String moneyType;
+	/**总金额*/
+	@Excel(name = "总金额", width = 15)
+	@ApiModelProperty(value = "总金额")
+	private String totalMoney;
+	/**业务类型*/
+	@Excel(name = "业务类型", width = 15)
+	@ApiModelProperty(value = "业务类型")
+	private String businessType;
+	/**成衣销售订单号*/
+	@Excel(name = "成衣销售订单号", width = 15)
+	@ApiModelProperty(value = "成衣销售订单号")
+	private String garmentSalesOrder;
+	/**款号*/
+	@Excel(name = "款号", width = 15)
+	@ApiModelProperty(value = "款号")
+	private String styleNumber;
+	/**物料*/
+	@Excel(name = "物料", width = 15)
+	@ApiModelProperty(value = "物料")
+	private String material;
+	/**计划员*/
+	@Excel(name = "计划员", width = 15)
+	@ApiModelProperty(value = "计划员")
+	private String planPersonnel;
+	/**业务员*/
+	@Excel(name = "业务员", width = 15)
+	@ApiModelProperty(value = "业务员")
+	private String businessPeople;
+	/**QC*/
+	@Excel(name = "QC", width = 15)
+	@ApiModelProperty(value = "QC")
+	private String qualityControl;
+	/**计划单号(主)*/
+	@Excel(name = "计划单号(主)", width = 15)
+	@ApiModelProperty(value = "计划单号(主)")
+	private String planNumber;
+	/**事故类型(主)*/
+	@Excel(name = "事故类型(主)", width = 15)
+	@ApiModelProperty(value = "事故类型(主)")
+	private String accidentType;
+	/**事故金额(主)*/
+	@Excel(name = "事故金额(主)", width = 15)
+	@ApiModelProperty(value = "事故金额(主)")
+	private String accidentSum;
+	/**情况说明*/
+	@Excel(name = "情况说明", width = 15)
+	@ApiModelProperty(value = "情况说明")
+	private String presentationCondition;
+	/**附件上传*/
+	@Excel(name = "附件上传", width = 15)
+	@ApiModelProperty(value = "附件上传")
+	private String accessory;
+	/**填报人*/
+	@Excel(name = "填报人", width = 15)
+	@ApiModelProperty(value = "填报人")
+	private String informant;
+	/**工厂签章*/
+	@Excel(name = "工厂签章", width = 15)
+	@ApiModelProperty(value = "工厂签章")
+	private String factorySignature;
+	/**财务备注*/
+	@Excel(name = "财务备注", width = 15)
+	@ApiModelProperty(value = "财务备注")
+	private String financeRemark;
+	/**添加附件*/
+	@Excel(name = "添加附件", width = 15)
+	@ApiModelProperty(value = "添加附件")
+	private String accessory2;
+	/**是否部门负责人*/
+	@Excel(name = "是否部门负责人", width = 15)
+	@ApiModelProperty(value = "是否部门负责人")
+	private String isLeaders;
+	/**森_工厂质量事故单(子)*/
+	@Excel(name = "森_工厂质量事故单(子)", width = 15)
+	@ApiModelProperty(value = "森_工厂质量事故单(子)")
+	private String incidentTicketId;
+	/**子表控件*/
+	@Excel(name = "子表控件", width = 15)
+	@ApiModelProperty(value = "子表控件")
+	private String tableNameChildren;
+	/**1未处理 2已通知 3通知已反馈 4已推送 5已完结*/
+	@Excel(name = "1未处理 2已通知 3通知已反馈 4已推送 5已完结", width = 15)
+	@ApiModelProperty(value = "1未处理 2已通知 3通知已反馈 4已推送 5已完结")
+	private String state;
+
+	@ExcelCollection(name="森_工厂质量事故单-子表")
+	@ApiModelProperty(value = "森_工厂质量事故单-子表")
+	private List<IncidentTicketChildren> incidentTicketChildrenList;
+	
+}

+ 18 - 0
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysDictController.java

@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CacheConstant;
@@ -521,6 +522,23 @@ public class SysDictController {
 		return result;
 	}
 
+	/**
+	 * 根据id查询字典数据
+	 */
+	@RequestMapping(value = "/getByCodeDict", method = RequestMethod.GET)
+	public String getByCodeDict(String table, String text, String code, String key){
+		if(StringUtils.isBlank(table) ||StringUtils.isBlank(text) ||StringUtils.isBlank(code) ||StringUtils.isBlank(key) ){
+			return "";
+		}
+		try {
+			String sysdict= sysDictService.queryTableDictTextByKey(table,text,code,key);
+			return sysdict;
+		}catch (Exception e){
+			return "";
+		}
+
+	}
+
 
 	/**
 	 * 获取字典数据