diff --git a/src/main/java/com/zcloud/controller/depository/LabelFactoryController.java b/src/main/java/com/zcloud/controller/depository/LabelFactoryController.java new file mode 100644 index 00000000..6ce29364 --- /dev/null +++ b/src/main/java/com/zcloud/controller/depository/LabelFactoryController.java @@ -0,0 +1,219 @@ +package com.zcloud.controller.depository; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.depository.LabelFactoryService; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:标签库 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/labelFactory") +public class LabelFactoryController extends BaseController { + + @Resource + private LabelFactoryService labelfactoryService; + + @RequestMapping(value = "/list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + page.setPd(pd); + List varList = labelfactoryService.list(page); //列出LabelFacory列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * description:保存根节点方法 + * + * @author sparrow + * + * @return save result + * @throws Exception all + */ + @RequestMapping(value = "/addAncestors") + @ResponseBody + public Object addAncestors() throws Exception { + Map map = new HashMap(); + map.put("result", "success"); + PageData pd = this.getPageData(); + PageData condition = new PageData(); + condition.put("NAME",pd.getString("NAME")); + List warden = labelfactoryService.listAll(condition); + if (warden != null && warden.size() >0){ + map.put("code","9999"); + map.put("errorMessage","节点名重复"); + return map; + } + pd.put("BUS_LABEL_FACTORY_ID", this.get32UUID()); //主键 + pd.put("PARENT_ID", "0"); + pd.put("ANCESTORS_ID", pd.getString("BUS_LABEL_FACTORY_ID")); + pd.put("IS_ANCESTORS_FLAG", "1"); + pd.put("CREATOR_ID", Jurisdiction.getUSER_ID()); + pd.put("CREATED_TIME", new Date()); + pd.put("ISDELETE", "0"); + pd.put("LEVEL", "0"); + labelfactoryService.save(pd); + map.put("code","0"); + + return map; + } + + @RequestMapping(value = "/getAncestors") + @ResponseBody + public Object getAncestors() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = this.getPageData(); + List list = labelfactoryService.findAllAncestors(pd); + map.put("list",list); + map.put("result", errInfo); + return map; + } + + @RequestMapping(value = "/tree") + @ResponseBody + public Object tree() throws Exception { + Map map = new HashMap(); + PageData pd = this.getPageData(); + List tree = labelfactoryService.getTree(pd); //列出LabelFacory列表 + map.put("tree", tree); + map.put("result", "success"); + return map; + } + + @RequestMapping(value = "/saveTree") + @ResponseBody + public Object saveTree() throws Exception { + Map map = new HashMap(); + PageData pd = this.getPageData(); + // 此处一定会炸雷(解决方案见历史版本) + List tree = labelfactoryService.saveTree(pd); //列出LabelFacory列表 + map.put("tree", tree); + map.put("result", "success"); + return map; + } + + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + @ResponseBody + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = this.getPageData(); + pd.put("LABELFACORY_ID", this.get32UUID()); //主键 + labelfactoryService.save(pd); + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @throws Exception + */ + @RequestMapping(value = "/delete") + @RequiresPermissions("labelfacory:del") + @ResponseBody + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + labelfactoryService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + @RequiresPermissions("labelfacory:edit") + @ResponseBody + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + labelfactoryService.edit(pd); + map.put("result", errInfo); + return map; + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = labelfactoryService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + @RequiresPermissions("labelfacory:del") + @ResponseBody + public Object deleteAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String DATA_IDS = pd.getString("DATA_IDS"); + if (Tools.notEmpty(DATA_IDS)) { + String ArrayDATA_IDS[] = DATA_IDS.split(","); + labelfactoryService.deleteAll(ArrayDATA_IDS); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } + +} diff --git a/src/main/java/com/zcloud/controller/depository/TermLibraryController.java b/src/main/java/com/zcloud/controller/depository/TermLibraryController.java new file mode 100644 index 00000000..0563c07e --- /dev/null +++ b/src/main/java/com/zcloud/controller/depository/TermLibraryController.java @@ -0,0 +1,34 @@ +package com.zcloud.controller.depository; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.PageData; +import com.zcloud.service.depository.TermLibraryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping("/labelFactory") +public class TermLibraryController extends BaseController { + + @Autowired + private TermLibraryService termLibraryService; + + @RequestMapping(value = "/termList") + @ResponseBody + public Object list() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List varList = termLibraryService.listAll(pd); //列出LabelFacory列表 + map.put("varList", varList); + map.put("result", errInfo); + return map; + } +} diff --git a/src/main/java/com/zcloud/controller/depository/TextLibraryController.java b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java new file mode 100644 index 00000000..739f5228 --- /dev/null +++ b/src/main/java/com/zcloud/controller/depository/TextLibraryController.java @@ -0,0 +1,328 @@ +package com.zcloud.controller.depository; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.bus.CorpInfoService; +import com.zcloud.service.depository.TextLibraryService; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import com.zcloud.util.Warden; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 说明:文本信息 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/textLibrary") +public class TextLibraryController extends BaseController { + + @Resource + private TextLibraryService textlibraryService; + + @Resource + private CorpInfoService corpInfoService; + + @RequestMapping(value = "/init") + @ResponseBody + public Object init(@RequestParam(value = "FILE", required = false) MultipartFile[] FILE) throws Exception { + Map response = new HashMap<>(); + PageData request = this.getPageData(); + textlibraryService.init(request, FILE); + response.put("result", "success"); + return response; + } + + @RequestMapping(value = "/list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + PageData pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + List labels_condition = new ArrayList<>(); + List category_condition = new ArrayList<>(); + + if (StringUtils.isNotEmpty(pd.getString("labels"))) { + List _labels = Warden.getList(pd.getString("labels")); + List labels = _labels.stream().map(n -> n.getString("BUS_LABEL_FACTORY_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + if (labels.size() > 0) labels_condition.addAll(labels); + } + if (StringUtils.isNotEmpty(pd.getString("CATEGORY_LIST"))) { + List _category_list = Warden.getList(pd.getString("CATEGORY_LIST")); + List category_list = _category_list.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + if (category_list.size() > 0) category_condition.addAll(category_list); + } + if (StringUtils.isNotEmpty(pd.getString("SPECIFICATION_TYPES"))) { + List _SPECIFICATION_TYPES = Warden.getList(pd.getString("SPECIFICATION_TYPES")); + List specification_types = _SPECIFICATION_TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + if (specification_types.size() > 0) category_condition.addAll(specification_types); + } + if (StringUtils.isNotEmpty(pd.getString("TYPES"))) { + List _TYPES = Warden.getList(pd.getString("TYPES")); + List types = _TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + if (types.size() > 0) category_condition.addAll(types); + } + if (StringUtils.isNotEmpty(pd.getString("ATTRIBUTE_LIST"))) { + List _TYPES = Warden.getList(pd.getString("ATTRIBUTE_LIST")); + List types = _TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + if (types.size() > 0) category_condition.addAll(types); + } + + pd.put("LABELS", labels_condition.toArray()); + pd.put("CATEGORY_IDS", category_condition.toArray()); + + PageData condition = new PageData(); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corp_info = corpInfoService.findById(condition); + + if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE4"))) { + if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE3"))) { + if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE2"))) { + pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE")); + } else { + pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE2")); + } + } else { + pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE3")); + } + } else { + pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE4")); + } + if (StringUtils.isEmpty(pd.getString("CORPINFO_ID"))) + pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + + if ("3".equals(pd.getString("ASSOCIATION"))) { + pd.put("TYPE_ONE", "43ed4012090d4614bb35da60d06c8264"); + pd.put("plan",pd.getString("CATEGORY_ID")); + pd.put("CATEGORY_ID",""); + } + if ("2".equals(pd.getString("ASSOCIATION"))){ + pd.put("TYPE_ONE", "7158f688d0f34054a28a9275139298df"); + } + if ("1".equals(pd.getString("ASSOCIATION"))){ + pd.put("TYPE_ONE", "691346658ed744a1bda2ed3a755f606c"); + } + if ("0".equals(pd.getString("ASSOCIATION"))){ + pd.put("TYPE_ONE", "8051d985a2bc406a83ea9360b64182b2"); + } + + pd.put("STATUS","1"); + + page.setPd(pd); + List varList = textlibraryService.list(page); + map.put("varList", varList); + map.put("page", page); + map.put("result", "success"); + return map; + } + + /** + * 删除 + * + * @throws Exception + */ + @RequestMapping(value = "/delete") + @ResponseBody + public Object delete() throws Exception { + Map map = new HashMap(); + map.put("result", "success"); + try { + PageData pd = this.getPageData(); + textlibraryService.delete(pd); + map.put("code", "0"); + return map; + } catch (Exception e) { + e.printStackTrace(); + map.put("code", "9999"); + map.put("errorMessage", e.getMessage()); + return map; + } + + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = textlibraryService.findById(pd); //根据ID读取 + map.put("data", pd); + map.put("result", errInfo); + return map; + } + + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + @ResponseBody + public Object deleteAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String DATA_IDS = pd.getString("DATA_IDS"); + if (Tools.notEmpty(DATA_IDS)) { + String ArrayDATA_IDS[] = DATA_IDS.split(","); + textlibraryService.deleteAll(ArrayDATA_IDS); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } + + @RequestMapping("lock") + @ResponseBody + public Object lock() throws Exception { + Map response = new HashMap<>(); + try { + PageData request = this.getPageData(); + textlibraryService.lock(request); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("top") + @ResponseBody + public Object top() throws Exception { + Map response = new HashMap<>(); + try { + PageData request = this.getPageData(); + textlibraryService.top(request); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("updateFile") + @ResponseBody + public Object updateFile(@RequestParam(value = "FILE", required = false) MultipartFile[] FILE) throws Exception { + Map response = new HashMap<>(); + try { + textlibraryService.updateFile(FILE, this.getPageData()); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("getUpdateLog") + @ResponseBody + public Object getUpdateLog() throws Exception { + Map response = new HashMap<>(); + try { + response.put("list", textlibraryService.getUpdateLog(this.getPageData())); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("setStatus") + @ResponseBody + public Object setStatus() throws Exception { + Map response = new HashMap<>(); + try { + textlibraryService.setStatus(this.getPageData()); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("getTextInfo") + @ResponseBody + public Object getTextInfo() throws Exception{ + Map response = new HashMap<>(); + try { + PageData text_info = textlibraryService.getTextInfo(this.getPageData()); + response.put("info",text_info); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } + + @RequestMapping("exportWord") + public void exportWord(HttpServletResponse response) throws Exception{ + try { + textlibraryService.exportWord(this.getPageData(),response); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @RequestMapping("copyToOperate") + @ResponseBody + public Object copyToOperate() throws Exception{ + Map response = new HashMap<>(); + try { + textlibraryService.copyToOperate(this.getPageData()); + response.put("code", "0"); + } catch (Exception e) { + e.printStackTrace(); + response.put("code", "9999"); + response.put("message", e.getMessage()); + } + response.put("result", "success"); + return response; + } +} diff --git a/src/main/java/com/zcloud/mapper/datasource/bus/CorpInfoMapper.java b/src/main/java/com/zcloud/mapper/datasource/bus/CorpInfoMapper.java index 3d1f18d9..2f13ea5e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/bus/CorpInfoMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/bus/CorpInfoMapper.java @@ -84,5 +84,7 @@ public interface CorpInfoMapper{ List datalistPageRetrieval(Page page); List listAllForMap(PageData pd); + + PageData getInfo(PageData corpCondition); } diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/LabelFactoryMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/LabelFactoryMapper.java new file mode 100644 index 00000000..3ac4ebae --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/LabelFactoryMapper.java @@ -0,0 +1,64 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:标签库 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface LabelFactoryMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + List findByAncestors(PageData condition); + + void deleteByAncestors(PageData leafInfo); + + List findAllAncestors(PageData condition); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLabelsMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLabelsMapper.java new file mode 100644 index 00000000..77d1a851 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLabelsMapper.java @@ -0,0 +1,62 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:文本关联标签 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface LibraryLabelsMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + List findBylibraryId(PageData info); + + void deleteByLibraryId(PageData condition); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLogMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLogMapper.java new file mode 100644 index 00000000..6de4adf9 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/LibraryLogMapper.java @@ -0,0 +1,21 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:文本信息 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface LibraryLogMapper { + + void save(PageData entity) throws Exception; + + PageData findById(PageData condition) throws Exception; + + List findByLogId(PageData condition) throws Exception; +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/TermLibraryMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/TermLibraryMapper.java new file mode 100644 index 00000000..f5c8ff55 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/TermLibraryMapper.java @@ -0,0 +1,59 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:包保责任人明细项 + * 作者:luoxiaobao + * 时间:2023-10-13 + * 官网:www.zcloudchina.com + */ +public interface TermLibraryMapper{ + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/TextInfoMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/TextInfoMapper.java new file mode 100644 index 00000000..715b5ce4 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/TextInfoMapper.java @@ -0,0 +1,60 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:文件内容详情 + * 作者:luoxiaobao + * 时间:2023-08-16 + * 官网:www.zcloudchina.com + */ +public interface TextInfoMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + PageData findByMainId(PageData textInfo); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/depository/TextLibraryMapper.java b/src/main/java/com/zcloud/mapper/datasource/depository/TextLibraryMapper.java new file mode 100644 index 00000000..fa52c823 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/depository/TextLibraryMapper.java @@ -0,0 +1,59 @@ +package com.zcloud.mapper.datasource.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:文本信息 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface TextLibraryMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + +} + diff --git a/src/main/java/com/zcloud/service/depository/LabelFactoryService.java b/src/main/java/com/zcloud/service/depository/LabelFactoryService.java new file mode 100644 index 00000000..e7d3e241 --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/LabelFactoryService.java @@ -0,0 +1,64 @@ +package com.zcloud.service.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:标签库 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface LabelFactoryService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + List getTree(PageData condition) throws Exception; + + List saveTree(PageData pd) throws Exception; + + List findAllAncestors(PageData condition) throws Exception; +} + diff --git a/src/main/java/com/zcloud/service/depository/TermLibraryService.java b/src/main/java/com/zcloud/service/depository/TermLibraryService.java new file mode 100644 index 00000000..e98ad514 --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/TermLibraryService.java @@ -0,0 +1,59 @@ +package com.zcloud.service.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:包保责任人明细项 + * 作者:luoxiaobao + * 时间:2023-10-13 + * 官网:www.zcloudchina.com + */ +public interface TermLibraryService{ + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/depository/TextLibraryService.java b/src/main/java/com/zcloud/service/depository/TextLibraryService.java new file mode 100644 index 00000000..140df87c --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/TextLibraryService.java @@ -0,0 +1,78 @@ +package com.zcloud.service.depository; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 说明:文本信息 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +public interface TextLibraryService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + void init(PageData request, MultipartFile [] file) throws Exception; + + void lock(PageData request) throws Exception; + + void top(PageData request) throws Exception; + + void updateFile(MultipartFile[] file, PageData pageData) throws Exception; + + List getUpdateLog(PageData pageData) throws Exception; + + void setStatus(PageData pageData) throws Exception; + + void exportWord(PageData pageData, HttpServletResponse response) throws Exception; + + PageData getTextInfo(PageData pageData); + + void copyToOperate(PageData pageData) throws Exception; +} + diff --git a/src/main/java/com/zcloud/service/depository/impl/LabelFacoryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/LabelFacoryServiceImpl.java new file mode 100644 index 00000000..90a6f81b --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/impl/LabelFacoryServiceImpl.java @@ -0,0 +1,249 @@ +package com.zcloud.service.depository.impl; + +import com.alibaba.fastjson.JSONArray; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.depository.LabelFactoryMapper; +import com.zcloud.service.depository.LabelFactoryService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Warden; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 说明:标签库 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class LabelFacoryServiceImpl implements LabelFactoryService { + + @Resource + private LabelFactoryMapper labelFactoryMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + labelFactoryMapper.save(pd); + } + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + labelFactoryMapper.delete(pd); + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + labelFactoryMapper.edit(pd); + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + return labelFactoryMapper.datalistPage(page); + } + + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + public List listAll(PageData pd) throws Exception { + return labelFactoryMapper.listAll(pd); + } + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return labelFactoryMapper.findById(pd); + } + + /** + * 批量删除 + * + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS) throws Exception { + labelFactoryMapper.deleteAll(ArrayDATA_IDS); + } + + @Override + public List getTree(PageData request) throws Exception { + List result = new ArrayList<>(); + PageData condition = new PageData(); + List labels = labelFactoryMapper.findByAncestors(condition); + for (PageData label : labels) { + if ("1".equals(label.getString("IS_ANCESTORS_FLAG"))){ + condition.clear(); + condition.put("BUS_LABEL_FACTORY_ID",label.getString("BUS_LABEL_FACTORY_ID")); + PageData ancestors = labelFactoryMapper.findById(condition); + analysis(labels, ancestors); + if (ancestors != null) { + result.add(ancestors); + } + } + } + result = result.stream().sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString())))).collect(Collectors.toList()); + return result; + } + + @Override + @Transactional + public List saveTree(PageData pd) throws Exception { + // 组织 + List _tree = Warden.getList(pd.getString("tree")); + PageData condition = new PageData(); + // 删除所有标签 + condition.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + condition.put("TYPE",pd.getString("TYPE")); + labelFactoryMapper.deleteByAncestors(condition); + List result = new ArrayList<>(); + for (PageData leaf : _tree) { + Warden.initDate(leaf); + leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + if (leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30) { + if ("1".equals(leaf.getString("IS_ANCESTORS_FLAG"))) { + leaf.put("NAME", leaf.getString("NAME")); + labelFactoryMapper.save(leaf); + } else { + leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID")); + leaf.put("NAME", leaf.getString("NAME")); + leaf.put("PARENT_ID", "0"); + leaf.put("IS_ANCESTORS_FLAG", "1"); + leaf.put("TYPE", pd.getString("TYPE")); + labelFactoryMapper.save(leaf); + } + } else { + leaf.put("BUS_LABEL_FACTORY_ID", Warden.get32UUID()); + leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID")); + leaf.put("NAME", leaf.getString("NAME")); + leaf.put("PARENT_ID", "0"); + leaf.put("IS_ANCESTORS_FLAG", "1"); + leaf.put("TYPE", pd.getString("TYPE")); + labelFactoryMapper.save(leaf); + } + analysis(leaf, result, 1); + } + return result; + } + + @Override + public List findAllAncestors(PageData condition) throws Exception { + return labelFactoryMapper.findAllAncestors(condition); + } + + private void analysis(PageData pd, List result, Integer level) { + JSONArray children = (JSONArray) pd.get("children"); + if (children == null || children.size() <= 0) { + return; + } + List tree = Warden.getList(children); + result.addAll(tree); + for (PageData leaf : tree) { + leaf.put("BUS_LABEL_FACTORY_ID", leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? leaf.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID()); + leaf.put("ANCESTORS_ID", pd.getString("ANCESTORS_ID")); + leaf.put("PARENT_ID", pd.getString("BUS_LABEL_FACTORY_ID")); + leaf.put("IS_ANCESTORS_FLAG", "0"); + leaf.put("LEVEL", level); + leaf.put("CREATOR_ID", Jurisdiction.getUSER_ID()); + leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + leaf.put("CREATED_TIME", DateUtil.date2Str(new Date())); + leaf.put("ISDELETE", "0"); + leaf.put("TYPE", pd.getString("TYPE")); + labelFactoryMapper.save(leaf); + analysis(leaf, result, ++level); + } + } + + private void analysis(List labels, PageData parent) { + List sons = labels.stream() + .filter(n -> n.getString("PARENT_ID").equals(parent.getString("BUS_LABEL_FACTORY_ID"))) + .sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString())))) + .collect(Collectors.toList()); + if (parent == null) { + return; + } + parent.put("children", sons); + if (sons.size() > 0) { + for (PageData son : sons) { + analysis(labels, son); + } + } + } + + private PageData findParentNode(List tree, PageData branch) throws Exception { + for (PageData root : tree) { + List branches = (List) root.get("children"); + if (branches.size() <= 0) { + continue; + } + for (PageData _branch : branches) { + if (branch.getString("BUS_LABEL_FACTORY_ID").equals(_branch.getString("BUS_LABEL_FACTORY_ID"))) { + return root; + } + } + PageData parentNode = findParentNode(branches, branch); + if (parentNode != null && parentNode.size() > 0) { + return parentNode; + } + } + return null; + } + + private void initNode(PageData info, PageData gene) { + info.put("BUS_LABEL_FACTORY_ID", info.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? info.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID()); + info.put("PARENT_ID", gene.getString("BUS_LABEL_FACTORY_ID")); + info.put("ANCESTORS_ID", gene.getString("ANCESTORS_ID")); + info.put("IS_ANCESTORS_FLAG", "0"); + info.put("LEVEL", Integer.parseInt(gene.get("LEVEL").toString()) + 1); + info.put("CREATOR_ID", Jurisdiction.getUSER_ID()); + info.put("CREATED_TIME", DateUtil.date2Str(new Date())); + info.put("ISDELETE", "0"); + info.put("TYPE", gene.getString("TYPE")); + JSONArray _children = (JSONArray) info.get("children"); + if (_children == null || _children.size() <= 0) { + return; + } + List children = Warden.getList(_children); + for (PageData child : children) { + initNode(child, info); + } + } + +} + diff --git a/src/main/java/com/zcloud/service/depository/impl/TermLibraryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/TermLibraryServiceImpl.java new file mode 100644 index 00000000..a6880f0b --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/impl/TermLibraryServiceImpl.java @@ -0,0 +1,83 @@ +package com.zcloud.service.depository.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.depository.TermLibraryMapper; +import com.zcloud.service.depository.TermLibraryService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 说明:包保责任人明细项 + * 作者:luoxiaobao + * 时间:2023-10-13 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class TermLibraryServiceImpl implements TermLibraryService { + + @Resource + private TermLibraryMapper termlibraryMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + termlibraryMapper.save(pd); + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + termlibraryMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + termlibraryMapper.edit(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return termlibraryMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return termlibraryMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return termlibraryMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + termlibraryMapper.deleteAll(ArrayDATA_IDS); + } + +} + diff --git a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java new file mode 100644 index 00000000..3cb3a945 --- /dev/null +++ b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java @@ -0,0 +1,416 @@ +package com.zcloud.service.depository.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.bus.CorpInfoMapper; +import com.zcloud.mapper.datasource.depository.LibraryLabelsMapper; +import com.zcloud.mapper.datasource.depository.LibraryLogMapper; +import com.zcloud.mapper.datasource.depository.TextInfoMapper; +import com.zcloud.mapper.datasource.depository.TextLibraryMapper; +import com.zcloud.service.depository.TextLibraryService; +import com.zcloud.util.*; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 说明:文本信息 + * 作者:luoxiaobao + * 时间:2022-12-27 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class TextLibraryServiceImpl implements TextLibraryService { + + @Resource + private TextLibraryMapper textlibraryMapper; + + @Resource + private LibraryLabelsMapper libraryLabelsMapper; + + @Resource + private LibraryLogMapper libraryLogMapper; + + @Resource + private CorpInfoMapper corpInfoMapper; + + @Resource + private Smb smb; + + @Resource + private TextInfoMapper textInfoMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + textlibraryMapper.save(pd); + } + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + PageData entity = textlibraryMapper.findById(pd); + if (StringUtils.isNotBlank(entity.getString("LOCKTOOL"))) { + throw new RuntimeException("数据已被锁定,请先解锁数据"); + } + textlibraryMapper.delete(pd); + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + textlibraryMapper.edit(pd); + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + List list = textlibraryMapper.datalistPage(page); + for (PageData entity : list) { + List _labels = libraryLabelsMapper.findBylibraryId(entity); + // 安全操作规程 + entity.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList())); + entity.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).collect(Collectors.toList())); + entity.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).collect(Collectors.toList())); + entity.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).collect(Collectors.toList())); + entity.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).collect(Collectors.toList())); + } + return list; + } + + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + public List listAll(PageData pd) throws Exception { + return textlibraryMapper.listAll(pd); + } + + /** + * 通过id获取数据 + * + * @param condition 查询条件 + * @throws Exception all + */ + public PageData findById(PageData condition) throws Exception { + PageData info = textlibraryMapper.findById(condition); + if (info != null && info.size() > 0) { + List _labels = libraryLabelsMapper.findBylibraryId(info); + if ("0".equals(info.getString("ASSOCIATION")) || "1".equals(info.getString("ASSOCIATION")) || "2".equals(info.getString("ASSOCIATION"))) { + info.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList())); + info.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).map(Warden::addDic).collect(Collectors.toList())); + info.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).map(Warden::addDic).collect(Collectors.toList())); + info.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).map(Warden::addDic).collect(Collectors.toList())); + } + if ("3".equals(info.getString("ASSOCIATION"))) { + info.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).map(Warden::addDic).collect(Collectors.toList())); + info.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList())); + info.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).map(Warden::addDic).collect(Collectors.toList())); + info.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).map(Warden::addDic).collect(Collectors.toList())); + info.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).map(Warden::addDic).collect(Collectors.toList())); + } + } + return info; + } + + /** + * 批量删除 + * + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS) throws Exception { + textlibraryMapper.deleteAll(ArrayDATA_IDS); + } + + @Override + public void init(PageData condition, MultipartFile[] file) throws Exception { + if (file != null && file.length > 0) { + String path = smb.saveFile(file[0]); + condition.put("PATH", path); + } + if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID"))) { + // 保存历史文件 + PageData entity = textlibraryMapper.findById(condition); + condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); + condition.put("CREATED_TIME", entity.get("CREATED_TIME")); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + condition.put("STATUS", "1"); + textlibraryMapper.edit(condition); + libraryLabelsMapper.deleteByLibraryId(condition); + List types = Warden.getList(condition.getString("TYPES")); + List list = new ArrayList<>(types); + + PageData corp_condition = new PageData(); + corp_condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corp = corpInfoMapper.getInfo(corp_condition); + + List specificationTypes = Warden.initSpecificationTypes(corp); + list.addAll(specificationTypes); + List labels = Warden.getList(condition.getString("labels")); + list.addAll(labels); + if ("3".equals(condition.getString("ASSOCIATION"))) { + List attributeList = Warden.getList(condition.getString("ATTRIBUTE_LIST")); + list.addAll(attributeList); + List specification_types = Warden.getList(condition.getString("SPECIFICATION_TYPES")); + list.addAll(specification_types); + + PageData type = new PageData(); + type.put("CATEGORY_ID", "43ed4012090d4614bb35da60d06c8264"); + type.put("CATEGORY", "TYPES"); + type.put("CATEGORY_NAME", "企业预案"); + list.add(type); + } else { + List category_list = Warden.getList(condition.getString("CATEGORY_LIST")); + list.addAll(category_list); + } + + for (PageData _label : list) { + PageData label = new PageData(); + label.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + label.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID()); + label.put("BUS_LABEL_FACTORY_ID", _label.getString("BUS_LABEL_FACTORY_ID")); + label.put("NAME", _label.getString("NAME")); + label.put("ISDELETE", "0"); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY_ID"))) + label.put("CATEGORY_ID", _label.getString("CATEGORY_ID")); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY"))) + label.put("CATEGORY", _label.getString("CATEGORY")); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY_NAME"))) + label.put("CATEGORY_NAME", _label.getString("CATEGORY_NAME")); + libraryLabelsMapper.save(label); + } + if (StringUtils.isNotBlank(condition.getString("TEXT_INFO"))) { + PageData text_info = new PageData(); + text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + text_info = textInfoMapper.findByMainId(text_info); + if (text_info == null || text_info.size() == 0) { + text_info = new PageData(); + text_info.put("CREATED_TIME", new Date()); + text_info.put("TEXT_INFO_ID", Warden.get32UUID()); + text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + text_info.put("ISDELETE", "0"); + text_info.put("OPERATE_TIME", new Date()); + text_info.put("TEXT_INFO", condition.getString("TEXT_INFO")); + textInfoMapper.save(text_info); + } else { + text_info.put("OPERATE_TIME", new Date()); + text_info.put("TEXT_INFO", condition.getString("TEXT_INFO")); + text_info.put("ISDELETE", "0"); + textInfoMapper.edit(text_info); + } + } + } else { + condition.put("BUS_TEXT_LIBRARY_ID", Warden.get32UUID()); + condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); + condition.put("UPLOAD_TIME", DateUtil.date2Str(new Date())); + condition.put("UPLOAD_USER", Jurisdiction.getUSER_ID()); + condition.put("UPLOAD_USER_NAME", Jurisdiction.getUsername()); + condition.put("CREATED_TIME", new Date()); + condition.put("ISDELETE", "0"); + condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + condition.put("STATUS", "1"); + textlibraryMapper.save(condition); + + List list = new ArrayList<>(); + + PageData corp_condition = new PageData(); + corp_condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + PageData corp = corpInfoMapper.getInfo(corp_condition); + + List specificationTypes = Warden.initSpecificationTypes(corp); + if ("3".equals(condition.getString("ASSOCIATION"))) { + List attributeList = Warden.getList(condition.getString("ATTRIBUTE_LIST")); + list.addAll(attributeList); + + List specification_types = Warden.getList(condition.getString("SPECIFICATION_TYPES")); + list.addAll(specification_types); + + PageData type = new PageData(); + type.put("CATEGORY_ID", "43ed4012090d4614bb35da60d06c8264"); + type.put("CATEGORY", "TYPES"); + type.put("CATEGORY_NAME", "企业预案"); + list.add(type); + + for (PageData entity : specificationTypes) { + entity.put("CATEGORY", "CATEGORY_LIST"); + } + } else { + List category_list = Warden.getList(condition.getString("CATEGORY_LIST")); + list.addAll(category_list); + } + list.addAll(specificationTypes); + + List labels = Warden.getList(condition.getString("labels")); + List types = Warden.getList(condition.getString("TYPES")); + + list.addAll(labels); + list.addAll(types); + for (PageData _label : list) { + PageData label = new PageData(); + label.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID()); + label.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + label.put("BUS_LABEL_FACTORY_ID", _label.getString("BUS_LABEL_FACTORY_ID")); + label.put("NAME", _label.getString("NAME")); + label.put("ISDELETE", "0"); + label.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY"))) + label.put("CATEGORY", _label.getString("CATEGORY")); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY_ID"))) + label.put("CATEGORY_ID", _label.getString("CATEGORY_ID")); + if (StringUtils.isNotEmpty(_label.getString("CATEGORY_NAME"))) + label.put("CATEGORY_NAME", _label.getString("CATEGORY_NAME")); + libraryLabelsMapper.save(label); + } + + PageData text_info = new PageData(); + text_info.put("CREATED_TIME", new Date()); + text_info.put("OPERATE_TIME", new Date()); + text_info.put("TEXT_INFO_ID", Warden.get32UUID()); + text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + text_info.put("TEXT_INFO", condition.getString("TEXT_INFO")); + text_info.put("ISDELETE", "0"); + textInfoMapper.save(text_info); + } + } + + @Override + public void lock(PageData request) throws Exception { + PageData entity = textlibraryMapper.findById(request); + Optional.ofNullable(entity).orElseThrow(() -> new RuntimeException("数据不正确")); + if ("1".equals(request.getString("isLock"))) { + entity.put("LOCKTOOL", Jurisdiction.getUSER_ID()); + textlibraryMapper.edit(entity); + } else { + if (Jurisdiction.getUSER_ID().equals(entity.getString("LOCKTOOL"))) { + entity.put("LOCKTOOL", null); + textlibraryMapper.edit(entity); + } else { + throw new RuntimeException("此条数据不能解锁,因为您不是锁定数据人"); + } + } + } + + @Override + public void top(PageData request) throws Exception { + PageData entity = textlibraryMapper.findById(request); + Optional.ofNullable(entity).orElseThrow(() -> new RuntimeException("数据不正确")); + if ("1".equals(request.getString("isTop"))) { + entity.put("ISTOPTIME", new Date().getTime()); + textlibraryMapper.edit(entity); + } else { + entity.put("ISTOPTIME", null); + textlibraryMapper.edit(entity); + } + } + + @Override + public void updateFile(MultipartFile[] file, PageData pageData) throws Exception { + if (file == null || file.length <= 0) throw new RuntimeException("系统异常,没用要更新的文件"); + String path = smb.saveFile(file[0]); + + PageData condition = new PageData(); + condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID")); + PageData entity = textlibraryMapper.findById(condition); + + PageData log = new PageData(); + log.put("LIBRARY_LOG_ID", Warden.get32UUID()); + log.put("PATH", entity.getString("PATH")); + log.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID")); + Warden.initDate(log); + libraryLogMapper.save(log); + entity.put("PATH", path); + textlibraryMapper.edit(entity); + } + + @Override + public List getUpdateLog(PageData pageData) throws Exception { + PageData condition = new PageData(); + condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID")); + return libraryLogMapper.findByLogId(condition); + } + + @Override + public void setStatus(PageData pageData) throws Exception { + PageData condtion = new PageData(); + condtion.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID")); + PageData entity = textlibraryMapper.findById(condtion); + entity.put("STATUS", pageData.getString("STATUS")); + textlibraryMapper.edit(entity); + } + + @Override + public void copyToOperate(PageData pageData) throws Exception { + PageData condition = new PageData(); + condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID")); + PageData info = textlibraryMapper.findById(condition); + List label_list = libraryLabelsMapper.findBylibraryId(condition); + //复制数据 + info.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + info.put("BUS_TEXT_LIBRARY_ID", Warden.get32UUID()); + // 2023-08-17 张志军要求,从其他企业加入库的数据自动置顶 + info.put("ISTOPTIME", null); + + for (PageData entity : label_list) { + entity.put("BUS_TEXT_LIBRARY_ID", info.getString("BUS_TEXT_LIBRARY_ID")); + entity.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID()); + } + + textlibraryMapper.save(info); + for (PageData entity : label_list) { + libraryLabelsMapper.save(entity); + } + + PageData text_info = textInfoMapper.findByMainId(condition); + if (text_info != null && text_info.size() > 0){ + text_info.put("TEXT_INFO_ID",Warden.get32UUID()); + text_info.put("BUS_TEXT_LIBRARY_ID",info.getString("BUS_TEXT_LIBRARY_ID")); + textInfoMapper.save(text_info); + } + } + + @Override + public PageData getTextInfo(PageData pageData) { + return textInfoMapper.findByMainId(pageData); + } + + @Override + public void exportWord(PageData pageData, HttpServletResponse response) throws Exception { + PageData condition = new PageData(); + condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID")); + PageData info = textInfoMapper.findByMainId(condition); + + //2023-08-21 created by liu jun 解决文本样式问题 + WordUtil.exportHtmlToWord(null,response,info.getString("TEXT_INFO"),"data"); + } + +} + diff --git a/src/main/java/com/zcloud/util/Smb.java b/src/main/java/com/zcloud/util/Smb.java index 7440c569..92dec0bf 100644 --- a/src/main/java/com/zcloud/util/Smb.java +++ b/src/main/java/com/zcloud/util/Smb.java @@ -284,4 +284,25 @@ public class Smb { channelSftp.exit(); } + + public String saveFile(MultipartFile multipartFile) throws Exception{ + return this.saveFile(multipartFile,Const.FILEPATHFILE); + } + + public String saveFile(MultipartFile file, String cost) throws Exception{ + // 生成文件名 + String fileName = Warden.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + // 根据项目类型生成项目文件 + String filePath; + if ("admin".equals(Jurisdiction.getUsername())) { + filePath = cost + "admin" + "/" + DateUtil.getDays(); + } else { + filePath = cost + "imgFactory" + "/" + DateUtil.getDays(); + } + + // 保存文件 + sshSftp(file, fileName, filePath); + // 返回文件保存目录 + return filePath + "/" + fileName; + } } diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 8f2b9c81..bf830fd4 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import org.apache.commons.lang.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpPost; @@ -19,10 +20,7 @@ import java.net.URLConnection; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class Warden { @@ -294,5 +292,60 @@ public class Warden { } } + public static void initDate(PageData entity) { + entity.put("CREATOR", Jurisdiction.getUSER_ID()); + entity.put("CREATE_TIME", DateUtil.getTime()); + entity.put("CREATOR_NAME", Jurisdiction.getName()); + entity.put("CREATTIME", DateUtil.getTime()); + entity.put("OPERATOR", Jurisdiction.getUSER_ID()); + entity.put("OPERATOR_NAME", Jurisdiction.getName()); + entity.put("OPERAT_TIME", DateUtil.getTime()); + entity.put("OPERATTIME", DateUtil.getTime()); + entity.put("ISDELETE", "0"); + } + + public static PageData addDic(PageData pageData) { + pageData.put("DICTIONARIES_ID",pageData.getString("CATEGORY_ID")); + pageData.put("NAME",pageData.getString("CATEGORY_NAME")); + return pageData; + } + + public static String getFileName(String img_path) { + if (StringUtils.isBlank(img_path)) { + throw new RuntimeException("被解析路径为空"); + } + String[] info = img_path.split("/"); + return info[info.length - 1]; + } + + public static List initSpecificationTypes(PageData corp) { + List list = new ArrayList<>(); + PageData one = new PageData(); + one.put("CATEGORY","SPECIFICATION_TYPES"); + one.put("CATEGORY_ID",corp.getString("CORP_TYPE")); + one.put("CATEGORY_NAME",corp.getString("CORP_TYPE_ONE_NAME")); + list.add(one); + + PageData two = new PageData(); + two.put("CATEGORY","SPECIFICATION_TYPES"); + two.put("CATEGORY_ID",corp.getString("CORP_TYPE2")); + two.put("CATEGORY_NAME",corp.getString("CORP_TYPE_TWO_NAME")); + list.add(two); + + PageData three = new PageData(); + three.put("CATEGORY","SPECIFICATION_TYPES"); + three.put("CATEGORY_ID",corp.getString("CORP_TYPE3")); + three.put("CATEGORY_NAME",corp.getString("CORP_TYPE_THREE_NAME")); + list.add(three); + + PageData four = new PageData(); + four.put("CATEGORY","SPECIFICATION_TYPES"); + four.put("CATEGORY_ID",corp.getString("CORP_TYPE4")); + four.put("CATEGORY_NAME",corp.getString("CORP_TYPE_FOUR_NAME")); + list.add(four); + + return list; + } + } diff --git a/src/main/java/com/zcloud/util/WordUtil.java b/src/main/java/com/zcloud/util/WordUtil.java new file mode 100644 index 00000000..2999c902 --- /dev/null +++ b/src/main/java/com/zcloud/util/WordUtil.java @@ -0,0 +1,103 @@ +package com.zcloud.util; + +import org.apache.poi.poifs.filesystem.DirectoryEntry; +import org.apache.poi.poifs.filesystem.DocumentEntry; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; + + +/** + * poi操作word工具类 + * @author lei + * @version 1.0 + * @date 2022/11/14 10:23 + */ +public class WordUtil { + + /** + * 导出富文本内容到word + * @param request + * @param response + * @param content 输出内容 + * @param fileName 导出文件名称 + * @throws Exception + */ + public static void exportHtmlToWord(HttpServletRequest request, HttpServletResponse response, String content, String fileName) throws Exception { + //图片转为base64方法 + //String imagebase64 = getImageStr(imagePath); + // 拼接html格式内容 + StringBuffer sbf = new StringBuffer(); + // 这里拼接一下html标签,便于word文档能够识别 + sbf.append(""); + sbf.append("" + + "" + + ""); + sbf.append(""); + // 富文本内容 + sbf.append(content); + sbf.append(""); + + // 必须要设置编码,避免中文就会乱码 + byte[] b = sbf.toString().getBytes("GBK"); + // 将字节数组包装到流中 + ByteArrayInputStream bais = new ByteArrayInputStream(b); + POIFSFileSystem poifs = new POIFSFileSystem(); + DirectoryEntry directory = poifs.getRoot(); + // 这代码不能省略,否则导出乱码。 + DocumentEntry documentEntry = directory.createDocument("WordDocument", bais); + //输出文件 +// request.setCharacterEncoding("utf-8"); + // 导出word格式 + response.setContentType("application/msword"); + response.addHeader("Content-Disposition", "attachment;filename=" + + new String(fileName.getBytes("GB2312"),"iso8859-1") + ".doc"); + ServletOutputStream ostream = response.getOutputStream(); + poifs.writeFilesystem(ostream); + bais.close(); + ostream.close(); + } + + /** + * 富文本内容到word(本地) + * @param content 输出内容 + * @param fileName 导出文件名称 + * @throws Exception + */ + public static void exportHtmlToWord(String filepath, String content, String fileName) throws Exception { + // 拼接html格式内容 + StringBuffer sbf = new StringBuffer(); + // 这里拼接一下html标签,便于word文档能够识别 + sbf.append(""); + sbf.append("" + + "" + + ""); + sbf.append(""); + // 富文本内容 + sbf.append(content); + sbf.append(""); + + // 必须要设置编码,避免中文就会乱码 + byte[] b = sbf.toString().getBytes("GBK"); + // 将字节数组包装到流中 + ByteArrayInputStream bais = new ByteArrayInputStream(b); + POIFSFileSystem poifs = new POIFSFileSystem(); + DirectoryEntry directory = poifs.getRoot(); + // 这代码不能省略,否则导出乱码。 + DocumentEntry documentEntry = directory.createDocument("WordDocument", bais); + + FileOutputStream out = new FileOutputStream(new File(filepath+fileName)); + poifs.writeFilesystem(out); + bais.close(); + out.close(); + } +} diff --git a/src/main/resources/mybatis/datasource/bus/CorpInfoMapper.xml b/src/main/resources/mybatis/datasource/bus/CorpInfoMapper.xml index 860f3659..757644a5 100644 --- a/src/main/resources/mybatis/datasource/bus/CorpInfoMapper.xml +++ b/src/main/resources/mybatis/datasource/bus/CorpInfoMapper.xml @@ -682,4 +682,53 @@ where USER_ID = #{USER_ID} + + diff --git a/src/main/resources/mybatis/datasource/depository/HiddenLibraryMapper.xml b/src/main/resources/mybatis/datasource/depository/HiddenLibraryMapper.xml new file mode 100644 index 00000000..31579d6e --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/HiddenLibraryMapper.xml @@ -0,0 +1,278 @@ + + + + + + + BUS_HIDDEN_LIBRARY + + + + + SYS_DICTIONARIES + + + + + f.INDUSTRY_TYPE_ONE, + f.INDUSTRY_TYPE_TWO, + f.INDUSTRY_TYPE_THREE, + f.INDUSTRY_TYPE_FOUR, + f.HIDDEN_TYPES, + f.RISK_UNIT_ID, + f.RISK_UNIT_NAME, + f.HIDDEN_PART, + f.HIDDEN_DESCR, + f.CREATOR_ID, + f.CREATOR_NAME, + f.CREATED_TIME, + f.OPERATOR_ID, + f.OPERATOR_NAME, + f.OPERATE_TIME, + f.INSPECTION_BASIS, + f.INSPECTION_INFO, + f.RECTIFYDESCR, + f.CORP_INFO_ID, + f.ISDELETE, + f.STATUS, + f.HIDDEN_LIBRARY_ID, + f.SOURCE, + f.HIDDEN_TYPE_ONE, + f.HIDDEN_TYPE_TWO, + f.HIDDEN_TYPE_THREE + + + + + INDUSTRY_TYPE_ONE, + INDUSTRY_TYPE_TWO, + INDUSTRY_TYPE_THREE, + INDUSTRY_TYPE_FOUR, + HIDDEN_TYPES, + RISK_UNIT_ID, + RISK_UNIT_NAME, + HIDDEN_PART, + HIDDEN_DESCR, + CREATOR_ID, + CREATOR_NAME, + CREATED_TIME, + OPERATOR_ID, + OPERATOR_NAME, + OPERATE_TIME, + INSPECTION_BASIS, + INSPECTION_INFO, + RECTIFYDESCR, + CORP_INFO_ID, + ISDELETE, + STATUS, + HIDDEN_LIBRARY_ID, + SOURCE, + HIDDEN_TYPE_ONE, + HIDDEN_TYPE_TWO, + HIDDEN_TYPE_THREE + + + + + #{INDUSTRY_TYPE_ONE}, + #{INDUSTRY_TYPE_TWO}, + #{INDUSTRY_TYPE_THREE}, + #{INDUSTRY_TYPE_FOUR}, + #{HIDDEN_TYPES}, + #{RISK_UNIT_ID}, + #{RISK_UNIT_NAME}, + #{HIDDEN_PART}, + #{HIDDEN_DESCR}, + #{CREATOR_ID}, + #{CREATOR_NAME}, + #{CREATED_TIME}, + #{OPERATOR_ID}, + #{OPERATOR_NAME}, + #{OPERATE_TIME}, + #{INSPECTION_BASIS}, + #{INSPECTION_INFO}, + #{RECTIFYDESCR}, + #{CORP_INFO_ID}, + #{ISDELETE}, + #{STATUS}, + #{HIDDEN_LIBRARY_ID}, + #{SOURCE}, + #{HIDDEN_TYPE_ONE}, + #{HIDDEN_TYPE_TWO}, + #{HIDDEN_TYPE_THREE} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + HIDDEN_LIBRARY_ID = #{HIDDEN_LIBRARY_ID} + + + + + update + + set + INDUSTRY_TYPE_ONE = #{INDUSTRY_TYPE_ONE}, + INDUSTRY_TYPE_TWO = #{INDUSTRY_TYPE_TWO}, + INDUSTRY_TYPE_THREE = #{INDUSTRY_TYPE_THREE}, + INDUSTRY_TYPE_FOUR = #{INDUSTRY_TYPE_FOUR}, + HIDDEN_TYPES = #{HIDDEN_TYPES}, + RISK_UNIT_ID = #{RISK_UNIT_ID}, + RISK_UNIT_NAME = #{RISK_UNIT_NAME}, + HIDDEN_PART = #{HIDDEN_PART}, + HIDDEN_DESCR = #{HIDDEN_DESCR}, + CREATOR_ID = #{CREATOR_ID}, + CREATOR_NAME = #{CREATOR_NAME}, + CREATED_TIME = #{CREATED_TIME}, + OPERATOR_ID = #{OPERATOR_ID}, + OPERATOR_NAME = #{OPERATOR_NAME}, + OPERATE_TIME = #{OPERATE_TIME}, + INSPECTION_BASIS = #{INSPECTION_BASIS}, + INSPECTION_INFO = #{INSPECTION_INFO}, + RECTIFYDESCR = #{RECTIFYDESCR}, + CORP_INFO_ID = #{CORP_INFO_ID}, + ISDELETE = #{ISDELETE}, + STATUS = #{STATUS}, + SOURCE = #{SOURCE}, + HIDDEN_TYPE_ONE = #{HIDDEN_TYPE_ONE}, + HIDDEN_TYPE_TWO = #{HIDDEN_TYPE_TWO}, + HIDDEN_TYPE_THREE = #{HIDDEN_TYPE_THREE}, + HIDDEN_LIBRARY_ID = HIDDEN_LIBRARY_ID + where + HIDDEN_LIBRARY_ID = #{HIDDEN_LIBRARY_ID} + + + + + update + + set + STATUS = '1' + where + HIDDEN_LIBRARY_ID in + + #{item} + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + HIDDEN_LIBRARY_ID in + + #{item} + + + + diff --git a/src/main/resources/mybatis/datasource/depository/LabelFacoryMapper.xml b/src/main/resources/mybatis/datasource/depository/LabelFacoryMapper.xml new file mode 100644 index 00000000..4895b0c6 --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/LabelFacoryMapper.xml @@ -0,0 +1,197 @@ + + + + + + + BUS_LABEL_FACTORY + + + + + SYS_DICTIONARIES + + + + + f.PARENT_ID, + f.ANCESTORS_ID, + f.IS_ANCESTORS_FLAG, + f.LEVEL, + f.NAME, + f.CREATOR_ID, + f.CREATED_TIME, + f.ISDELETE, + f.SORT, + f.TYPE, + f.BUS_LABEL_FACTORY_ID, + f.CORPINFO_ID + + + + + PARENT_ID, + ANCESTORS_ID, + IS_ANCESTORS_FLAG, + LEVEL, + NAME, + CREATOR_ID, + CREATED_TIME, + ISDELETE, + SORT, + TYPE, + BUS_LABEL_FACTORY_ID, + CORPINFO_ID + + + + + #{PARENT_ID}, + #{ANCESTORS_ID}, + #{IS_ANCESTORS_FLAG}, + #{LEVEL}, + #{NAME}, + #{CREATOR_ID}, + #{CREATED_TIME}, + #{ISDELETE}, + #{SORT}, + #{TYPE}, + #{BUS_LABEL_FACTORY_ID}, + #{CORPINFO_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID} + + + delete from + + where TYPE = #{TYPE} + + and CORPINFO_ID = #{CORPINFO_ID} + + + + + + update + + set + PARENT_ID = #{PARENT_ID}, + ANCESTORS_ID = #{ANCESTORS_ID}, + IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG}, + LEVEL = #{LEVEL}, + NAME = #{NAME}, + CREATOR_ID = #{CREATOR_ID}, + CREATED_TIME = #{CREATED_TIME}, + SORT = #{SORT}, + TYPE = #{TYPE}, + CORPINFO_ID = #{CORPINFO_ID}, + BUS_LABEL_FACTORY_ID = BUS_LABEL_FACTORY_ID + where + BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID} + + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + BUS_LABEL_FACTORY_ID in + + #{item} + + + + diff --git a/src/main/resources/mybatis/datasource/depository/LibraryLabelsMapper.xml b/src/main/resources/mybatis/datasource/depository/LibraryLabelsMapper.xml new file mode 100644 index 00000000..00ff5e05 --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/LibraryLabelsMapper.xml @@ -0,0 +1,164 @@ + + + + + + + BUS_LIBRARY_LABELS + + + + + SYS_DICTIONARIES + + + + + f.BUS_TEXT_LIBRARY_ID, + f.NAME, + f.BUS_LABEL_FACTORY_ID, + f.CREATED_TIME, + f.LABEL_NAME, + f.ISDELETE, + f.BUS_LIBRARY_LABELS_ID, + f.CORPINFO_ID, + f.CATEGORY, + f.CATEGORY_ID, + f.CATEGORY_NAME + + + + + BUS_TEXT_LIBRARY_ID, + NAME, + BUS_LABEL_FACTORY_ID, + CREATED_TIME, + LABEL_NAME, + ISDELETE, + BUS_LIBRARY_LABELS_ID, + CORPINFO_ID, + CATEGORY, + CATEGORY_ID, + CATEGORY_NAME + + + + + #{BUS_TEXT_LIBRARY_ID}, + #{NAME}, + #{BUS_LABEL_FACTORY_ID}, + #{CREATED_TIME}, + #{LABEL_NAME}, + #{ISDELETE}, + #{BUS_LIBRARY_LABELS_ID}, + #{CORPINFO_ID}, + #{CATEGORY}, + #{CATEGORY_ID}, + #{CATEGORY_NAME} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + BUS_LIBRARY_LABELS_ID = #{BUS_LIBRARY_LABELS_ID} + + + delete from + + where + BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID} + + + + + update + + set + BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}, + NAME = #{NAME}, + CREATED_TIME = #{CREATED_TIME}, + LABEL_NAME = #{LABEL_NAME}, + ISDELETE = #{ISDELETE}, + CORPINFO_ID = #{CORPINFO_ID}, + CATEGORY = #{CATEGORY}, + CATEGORY_ID = #{CATEGORY_ID}, + CATEGORY_NAME = #{CATEGORY_NAME}, + BUS_LIBRARY_LABELS_ID = BUS_LIBRARY_LABELS_ID + where + BUS_LIBRARY_LABELS_ID = #{BUS_LIBRARY_LABELS_ID} + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + BUS_LIBRARY_LABELS_ID in + + #{item} + + + + diff --git a/src/main/resources/mybatis/datasource/depository/LibraryLogMapper.xml b/src/main/resources/mybatis/datasource/depository/LibraryLogMapper.xml new file mode 100644 index 00000000..281a170c --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/LibraryLogMapper.xml @@ -0,0 +1,72 @@ + + + + + + + BUS_LIBRARY_LOG + + + + + SYS_DICTIONARIES + + + + + f.LIBRARY_LOG_ID, + f.PATH, + f.CREATOR, + f.CREATOR_NAME, + f.CREATE_TIME, + f.BUS_TEXT_LIBRARY_ID + + + + LIBRARY_LOG_ID, + PATH, + CREATOR, + CREATOR_NAME, + CREATE_TIME, + BUS_TEXT_LIBRARY_ID + + + + #{LIBRARY_LOG_ID}, + #{PATH}, + #{CREATOR}, + #{CREATOR_NAME}, + #{CREATE_TIME}, + #{BUS_TEXT_LIBRARY_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + + + diff --git a/src/main/resources/mybatis/datasource/depository/TextInfoMapper.xml b/src/main/resources/mybatis/datasource/depository/TextInfoMapper.xml new file mode 100644 index 00000000..8ee04b6c --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/TextInfoMapper.xml @@ -0,0 +1,138 @@ + + + + + + + BUS_TEXT_INFO + + + + + SYS_DICTIONARIES + + + + + f.TEXT_INFO, + f.BUS_TEXT_LIBRARY_ID, + f.ISDELETE, + f.CREATED_TIME, + f.OPERATE_TIME, + f.TEXT_INFO_ID + + + + + TEXT_INFO, + BUS_TEXT_LIBRARY_ID, + ISDELETE, + CREATED_TIME, + OPERATE_TIME, + TEXT_INFO_ID + + + + + #{TEXT_INFO}, + #{BUS_TEXT_LIBRARY_ID}, + #{ISDELETE}, + #{CREATED_TIME}, + #{OPERATE_TIME}, + #{TEXT_INFO_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + TEXT_INFO_ID = #{TEXT_INFO_ID} + + + + + update + + set + TEXT_INFO = #{TEXT_INFO}, + BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}, + ISDELETE = #{ISDELETE}, + OPERATE_TIME = #{OPERATE_TIME}, + TEXT_INFO_ID = TEXT_INFO_ID + where + TEXT_INFO_ID = #{TEXT_INFO_ID} + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + TEXT_INFO_ID in + + #{item} + + + + diff --git a/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml b/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml new file mode 100644 index 00000000..26a14f9f --- /dev/null +++ b/src/main/resources/mybatis/datasource/depository/TextLibraryMapper.xml @@ -0,0 +1,202 @@ + + + + + + + BUS_TEXT_LIBRARY + + + + + SYS_DICTIONARIES + + + + + f.REMARKS, + f.TYPE, + f.TYPE_NAME, + f.FILE_NAME, + f.UPLOAD_TIME, + f.UPLOAD_USER, + f.UPLOAD_USER_NAME, + f.PATH, + f.REMOTE_PATH, + f.CREATED_TIME, + f.ISDELETE, + f.REMOTE_FILE_NAME, + f.LOCKTOOL, + f.ISTOPTIME, + f.ASSOCIATION, + f.STATUS, + f.BUS_TEXT_LIBRARY_ID, + f.CORPINFO_ID + + + + + REMARKS, + TYPE, + TYPE_NAME, + FILE_NAME, + UPLOAD_TIME, + UPLOAD_USER, + UPLOAD_USER_NAME, + PATH, + REMOTE_PATH, + CREATED_TIME, + ISDELETE, + REMOTE_FILE_NAME, + LOCKTOOL, + ISTOPTIME, + ASSOCIATION, + STATUS, + BUS_TEXT_LIBRARY_ID, + CORPINFO_ID + + + + + #{REMARKS}, + #{TYPE}, + #{TYPE_NAME}, + #{FILE_NAME}, + #{UPLOAD_TIME}, + #{UPLOAD_USER}, + #{UPLOAD_USER_NAME}, + #{PATH}, + #{REMOTE_PATH}, + #{CREATED_TIME}, + #{ISDELETE}, + #{REMOTE_FILE_NAME}, + #{LOCKTOOL}, + #{ISTOPTIME}, + #{ASSOCIATION}, + #{STATUS}, + #{BUS_TEXT_LIBRARY_ID}, + #{CORPINFO_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID} + + + + + update + + set + REMARKS = #{REMARKS}, + TYPE = #{TYPE}, + FILE_NAME = #{FILE_NAME}, + REMOTE_FILE_NAME = #{REMOTE_FILE_NAME}, + UPLOAD_TIME = #{UPLOAD_TIME}, + UPLOAD_USER = #{UPLOAD_USER}, + UPLOAD_USER_NAME = #{UPLOAD_USER_NAME}, + PATH = #{PATH}, + REMOTE_PATH = #{REMOTE_PATH}, + CREATED_TIME = #{CREATED_TIME}, + LOCKTOOL = #{LOCKTOOL}, + ISTOPTIME = #{ISTOPTIME}, + TYPE_NAME = #{TYPE_NAME}, + ASSOCIATION = #{ASSOCIATION}, + STATUS = #{STATUS}, + CORPINFO_ID = #{CORPINFO_ID}, + BUS_TEXT_LIBRARY_ID = BUS_TEXT_LIBRARY_ID + where + BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + BUS_TEXT_LIBRARY_ID in + + #{item} + + and LOCKTOOL is null + + +