diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java b/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java new file mode 100644 index 00000000..e94949b8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/controller/BusinessFileController.java @@ -0,0 +1,327 @@ +package com.hzya.frame.sys.businessFile.controller; + +import com.github.pagehelper.PageInfo; +import com.hzya.frame.page.PageAttribute; +import com.hzya.frame.sys.businessFile.entity.BusinessFileEntity; +import com.hzya.frame.sys.businessFile.service.IBusinessFileService; +import com.hzya.frame.sys.file.download.service.IFileDownloadService; +import com.hzya.frame.web.action.DefaultController; +import com.hzya.frame.web.action.SessionContext; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.zip.ZipOutputStream; + +/** + * @description: 文件业务关系 controller + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * 包含: + * 1、分页查询(queryPaged) + * 2、index页面(goIndexPage) + * 3、新增页面(goAddPage) + * 4、新增信息保存(save) + * 5、修改页面(goEditPage) + * 6、修改信息保存(update) + * 7、信息查看(goShowPage) + * 8、删除信息(delete) + * @author: gjh + * @history: 1.0 + */ + +@Controller("sys_business_file") +@RequestMapping("/sys/business/file/BusinessFileController") +public class BusinessFileController extends DefaultController { + @Autowired + protected IBusinessFileService businessfileService; + @Autowired + private IFileDownloadService fileDownloadService; + + /** + * 文件业务关系分页信息 + **/ + @RequestMapping(value = "queryPaged") + @ResponseBody + public PageAttribute queryPaged(BusinessFileEntity entity) throws Exception { + PageAttribute page = null; + try { + page = businessfileService.queryPaged(entity); + } catch (Exception e) { + e.printStackTrace(); + } + return page; + } + + @RequestMapping(value = "queryList") + @ResponseBody + public List queryList(BusinessFileEntity entity) throws Exception { + List list = null; + try { + list = businessfileService.query(entity); + } catch (Exception e) { + e.printStackTrace(); + } + return list; + } + + /** + * 跳转到文件业务关系的index页面 + **/ + @RequestMapping(value = "goIndexPage", method = RequestMethod.GET) + public ModelAndView goIndexPage() { + ModelAndView view = new ModelAndView(); + /**这里根据实际的需要填写需要传到前台的对象**/ + //view.addObject(attributeName, attributeValue); + /**这里是返回对应的页面路径**/ + view.setViewName("/sys/businessFile/businessFile/list"); + return view; + } + + /** + * 跳转到文件业务关系信息新增页面 + **/ + @RequestMapping(value = "goAddPage") + public ModelAndView goAddPage() { + ModelAndView view = new ModelAndView(); + /**这里根据实际的需要填写需要传到前台的对象**/ + //view.addObject(attributeName, attributeValue); + /**这里是返回对应的页面路径**/ + view.setViewName("/sys/businessFile/businessFile/add"); + return view; + } + + /** + * 文件业务关系新增信息保存 + **/ + @RequestMapping(value = "save", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity save(BusinessFileEntity entity) { + try { + businessfileService.save(entity); + return getSuccessMessageEntity("保存成功", "save"); + } catch (Exception e) { + logger.error("save", e); + e.printStackTrace(); + return getFailureMessageEntity("保存失败!" + e.getMessage(), "save"); + } + } + + /** + * 跳转到文件业务关系信息修改页面 + **/ + @RequestMapping(value = "edit/{id}") + public ModelAndView goEditPage(@PathVariable("id") Long id) { + ModelAndView view = new ModelAndView(); + /**这里根据实际的需要填写需要传到前台的对象**/ + BusinessFileEntity entity = businessfileService.get(id); + view.addObject("entity", entity); + /**这里是返回对应的页面路径**/ + view.setViewName("/sys/businessFile/businessFile/edit"); + return view; + } + + /** + * 文件业务关系修改信息保存 + **/ + @RequestMapping(value = "update", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity update(BusinessFileEntity entity) { + try { + businessfileService.update(entity); + return getSuccessMessageEntity("更新成功!", "update"); + } catch (Exception e) { + logger.error("update", e); + e.printStackTrace(); + return getFailureMessageEntity("更新失败!" + e.getMessage(), "update"); + } + } + + /** + * 跳转到文件业务关系信息查看 + **/ + @RequestMapping(value = "show/{id}") + public ModelAndView goShowPage(@PathVariable("id") Long id) { + ModelAndView view = new ModelAndView(); + /**这里根据实际的需要填写需要传到前台的对象**/ + BusinessFileEntity entity = businessfileService.get(id); + view.addObject("entity", entity); + /**这里是返回对应的页面路径**/ + view.setViewName("/sys/businessFile/businessFile/show"); + return view; + } + + /** + * 删除文件业务关系信息 + **/ + @RequestMapping(value = "delete", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity delete(Long id) { + try { + return getSuccessMessageEntity("删除成功!", "delete"); + } catch (Exception e) { + logger.error("delete", e); + e.printStackTrace(); + return getFailureMessageEntity("删除失败!" + e.getMessage(), "delete"); + } + } + + /** + * 业务附件批量保存,通过JSON字符串传入保存参数 + **/ + @RequestMapping(value = "saveBusinessFile", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity saveBusinessFile(BusinessFileEntity entity) { + try { + entity = businessfileService.saveBatchBusinessFile(entity); + return getSuccessMessageEntity("保存成功!" ); + } catch (Exception e) { + logger.error("save", e); + e.printStackTrace(); + return getFailureMessageEntity("保存失败!" + e.getMessage(), "delete"); + } + } + + /** + * 业务附件批量保存 + **/ + @RequestMapping(value = "saveBatchBusinessFile", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity saveBatchBusinessFile(BusinessFileEntity entity) { + try { + entity = businessfileService.saveBusinessFile(entity); + return getSuccessMessageEntity("保存成功!" ); + } catch (Exception e) { + logger.error("save", e); + e.printStackTrace(); + return getFailureMessageEntity("保存失败!" + e.getMessage(), "delete"); + } + } + + + /** + * 业务附件批量保存 + **/ + @RequestMapping(value = "validateTicketFiles", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity validateTicketFiles(BusinessFileEntity entity) { + try { + entity = businessfileService.validateTicketFiles(entity); + return getSuccessMessageEntity("验证成功!" ); + } catch (Exception e) { + logger.error("save", e); + e.printStackTrace(); + return getFailureMessageEntity(e.getMessage(), "validate"); + } + } + + @RequestMapping(value = "listQueryBusinessFilesByGroup", method = RequestMethod.POST) + @ResponseBody + public List listQueryBusinessFilesByGroup(BusinessFileEntity entity) { + List listQueryBusinessFilesByGroup = businessfileService.listQueryBusinessFilesByGroup(entity); + return listQueryBusinessFilesByGroup; + } + + + /*** + * 根据单票ID下载所有的附件 + * @param entity + * @param response + */ + @RequestMapping(value = "ticketFilesDownloadToZip") + public void ticketFilesDownloadToZip(BusinessFileEntity entity, HttpServletResponse response) { + ZipOutputStream out = null; + response.setContentType("APPLICATION/OCTET-STREAM"); + String zipName = entity.getZipName() + ".zip"; + try { + zipName = new String(zipName.getBytes(StandardCharsets.UTF_8), "iso8859-1"); + response.setHeader("Content-Disposition", "attachment; filename=" + zipName); + out = new ZipOutputStream(response.getOutputStream()); + + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + /** + * 文件业务关系分页信息 + **/ + @RequestMapping(value = "queryBusinessFileByServiceType") + @ResponseBody + public List queryBusinessFileByServiceType(BusinessFileEntity entity) throws Exception { + List businessFileEntityList = null; + try { + businessFileEntityList = businessfileService.queryBusinessFileByServiceType(entity); + } catch (Exception e) { + e.printStackTrace(); + } + return businessFileEntityList; + } + + + + /** + * 跳转到国内清关文件文件上传页面 + **/ + @RequestMapping(value = "goDomesticUploadPage/{id}") + public ModelAndView goDomesticUploadPage(@PathVariable("id") Long id) { + ModelAndView view = new ModelAndView(); + /** 传入整个单票对象*/ + + /** 获取当前登陆人的服务项*/ + + /**这里是返回对应的页面路径**/ + view.setViewName("/sys/businessFile/businessFile/add"); + return view; + } + + + /** + * 跳转制作保函列表页面 + **/ + @RequestMapping(value = "goTicketFileDocumentsIndexPage", method = RequestMethod.GET) + public ModelAndView goTicketFileDocumentsIndexPage(Long ticket_id, Long business_id, String business_type, boolean fileFlag) { + ModelAndView view = new ModelAndView(); + /**这里根据实际的需要填写需要传到前台的对象**/ + view.addObject("business_type", "guarantee"); + /**这里是返回对应的页面路径**/ + + view.setViewName("/sys/businessFile/businessFile/documents"); + return view; + } + + + /** + * 业务附件批量保存 + **/ + @RequestMapping(value = "saveBusinessFileToGuarantee", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity saveBusinessFileToGuarantee(BusinessFileEntity entity) { + try { + entity = businessfileService.saveBusinessFileToGuarantee(entity); + return getSuccessMessageEntity("保存成功!" ); + } catch (Exception e) { + logger.error("save", e); + e.printStackTrace(); + return getFailureMessageEntity("保存失败!" + e.getMessage(), "delete"); + } + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/dao/IBusinessFileDao.java b/service/src/main/java/com/hzya/frame/sys/businessFile/dao/IBusinessFileDao.java new file mode 100644 index 00000000..00a293b0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/dao/IBusinessFileDao.java @@ -0,0 +1,28 @@ +package com.hzya.frame.sys.businessFile.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sys.businessFile.entity.BusinessFileEntity; + +import java.util.List; + +/** + * @description: 文件业务关系 dao + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * @author: gjh + * @history: 1.0 + */ +public interface IBusinessFileDao extends IBaseDao { + /*** + * 根据业务条件获取根据单证编号分组的附件列表 + * @param entity + * @return + */ + List listQueryBusinessFiles(BusinessFileEntity entity); + + /**** + * 根据服务项类型列表获取附件列表 + * @param entity + * @return + */ + List queryBusinessFileByServiceType(BusinessFileEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/dao/impl/BusinessFileDaoImpl.java b/service/src/main/java/com/hzya/frame/sys/businessFile/dao/impl/BusinessFileDaoImpl.java new file mode 100644 index 00000000..9a3ccfda --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/dao/impl/BusinessFileDaoImpl.java @@ -0,0 +1,29 @@ +package com.hzya.frame.sys.businessFile.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sys.businessFile.dao.IBusinessFileDao; +import com.hzya.frame.sys.businessFile.entity.BusinessFileEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @description: 文件业务关系 dao + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * @author: gjh + * @history:1.0 + */ +@Repository("sys_business_filedao") +public class BusinessFileDaoImpl extends MybatisGenericDao implements IBusinessFileDao { + + @Override + public List listQueryBusinessFiles(BusinessFileEntity entity) { + return super.queryList(entity, "com.hzya.frame.sys.businessFile.entity.BusinessFileEntity.BusinessFileEntity_list_base_group"); + } + + @Override + public List queryBusinessFileByServiceType(BusinessFileEntity entity) { + return super.queryList(entity, "com.hzya.frame.sys.businessFile.entity.BusinessFileEntity.BusinessFileEntity_queryBusinessFileByServiceType"); + } +} diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.java b/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.java new file mode 100644 index 00000000..f0dba502 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.java @@ -0,0 +1,321 @@ +package com.hzya.frame.sys.businessFile.entity; + + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * @description: 文件业务关系 + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * @author: gjh + * @history: 1.0 + */ +public class BusinessFileEntity extends BaseEntity { + + /** + * 附件表生成的唯一新名称 + */ + private String file_save_name; + /** + * 业务表ID(应用表,) + */ + private String business_id; + /**** + * 业务类型 1、应用 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-10-09 8:19 + * @param + * @return + **/ + private String business_type; + /** + * 单票ID + */ + private Long ticket_id; + /** + * 附件类型 + */ + private String file_type; + /** + * 附件名称 + */ + private String file_name; + /** + * 上传人名称 + */ + private String upload_user; + /** + * 单证号码 + */ + private String file_number; + /** + * 单证名称 + */ + private String documents_name; + /** + * 备注 + */ + private String remark; + /** + * 关联查询文件路径 + */ + private String file_path; + /** + * 关联查询单票号码 + */ + private String ticket_code; + /** + * 接收打包下载的文件集合 + */ + private List businessFileEntityList; + /** + * JSON数据字符串 + */ + private String jsonDataStr; + /** + * 打包下载的名称 + */ + private String zipName; + //附件数量 + private Long file_count; + /** + * 单票服务项List的类型查询条件集合 + */ + private List ticketAllServiceEntities; + /** + * 接收字符串 + */ + private String ticketAllJsonStr; + + /** + * 根据服务项,查询特定的附件 + */ + private List business_type_list; + /** + * 附件集合 + */ + private String fileInfo; + + /** + * 根据服务项,查询特定的附件 + */ + public List getBusiness_type_list() { + return business_type_list; + } + + /** + * 根据服务项,查询特定的附件 + */ + public void setBusiness_type_list(List business_type_list) { + this.business_type_list = business_type_list; + } + + /** + * 附件表生成的唯一新名称 + */ + public String getFile_save_name() { + return file_save_name; + } + + /** + * 附件表生成的唯一新名称 + */ + public void setFile_save_name(String file_save_name) { + this.file_save_name = file_save_name; + } + + /** + * 业务表ID(合同,预报,单票,国际物流) + */ + public String getBusiness_id() { + return business_id; + } + + /** + * 业务表ID(合同,预报,单票,国际物流) + */ + public void setBusiness_id(String business_id) { + this.business_id = business_id; + } + + /** + * 业务类型(contract/合同prediction/预报changeOrder /纯换单customsClearance /报关报检unboxing/纯开箱单shipSeal/船司盖章harbourSeal /港区盖章) + */ + public String getBusiness_type() { + return business_type; + } + + /** + * 业务类型(contract/合同prediction/预报changeOrder /纯换单customsClearance /报关报检unboxing/纯开箱单shipSeal/船司盖章harbourSeal /港区盖章) + */ + public void setBusiness_type(String business_type) { + this.business_type = business_type; + } + + /** + * 单票ID + */ + public Long getTicket_id() { + return ticket_id; + } + + /** + * 单票ID + */ + public void setTicket_id(Long ticket_id) { + this.ticket_id = ticket_id; + } + + /** + * 附件类型 + */ + public String getFile_type() { + return file_type; + } + + /** + * 附件类型 + */ + public void setFile_type(String file_type) { + this.file_type = file_type; + } + + /** + * 附件名称 + */ + public String getFile_name() { + return file_name; + } + + /** + * 附件名称 + */ + public void setFile_name(String file_name) { + this.file_name = file_name; + } + + /** + * 上传人名称 + */ + public String getUpload_user() { + return upload_user; + } + + /** + * 上传人名称 + */ + public void setUpload_user(String upload_user) { + this.upload_user = upload_user; + } + + /** + * 单证号码 + */ + public String getFile_number() { + return file_number; + } + + /** + * 单证号码 + */ + public void setFile_number(String file_number) { + this.file_number = file_number; + } + + /** + * 备注 + */ + public String getRemark() { + return remark; + } + + /** + * 备注 + */ + public void setRemark(String remark) { + this.remark = remark; + } + + public String getTicket_code() { + return ticket_code; + } + + public void setTicket_code(String ticket_code) { + this.ticket_code = ticket_code; + } + + public List getBusinessFileEntityList() { + return businessFileEntityList; + } + + public void setBusinessFileEntityList(List businessFileEntityList) { + this.businessFileEntityList = businessFileEntityList; + } + + public String getFile_path() { + return file_path; + } + + public void setFile_path(String file_path) { + this.file_path = file_path; + } + + public Long getFile_count() { + return file_count; + } + + public void setFile_count(Long file_count) { + this.file_count = file_count; + } + + public String getDocuments_name() { + return documents_name; + } + + public void setDocuments_name(String documents_name) { + this.documents_name = documents_name; + } + + public List getTicketAllServiceEntities() { + return ticketAllServiceEntities; + } + + public void setTicketAllServiceEntities(List ticketAllServiceEntities) { + this.ticketAllServiceEntities = ticketAllServiceEntities; + } + + public String getTicketAllJsonStr() { + return ticketAllJsonStr; + } + + public void setTicketAllJsonStr(String ticketAllJsonStr) { + this.ticketAllJsonStr = ticketAllJsonStr; + } + + public String getJsonDataStr() { + return jsonDataStr; + } + + public void setJsonDataStr(String jsonDataStr) { + this.jsonDataStr = jsonDataStr; + } + + public String getZipName() { + return zipName; + } + + public void setZipName(String zipName) { + this.zipName = zipName; + } + + public String getFileInfo() { + return fileInfo; + } + + public void setFileInfo(String fileInfo) { + this.fileInfo = fileInfo; + } +} diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.xml b/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.xml new file mode 100644 index 00000000..90b73caa --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/entity/BusinessFileEntity.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + file_save_name, + business_id, + business_type, + ticket_id, + file_type, + file_name, + upload_user, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + file_number, + documents_name, + remark + + + + COUNT(1) as file_count, + file_save_name, + business_id, + business_type, + ticket_id, + file_type, + file_name, + upload_user, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + file_number, + documents_name, + remark + + + + + + + + + + + + + + + + + + + + + + + + + insert into sys_business_file( + + id, + file_save_name, + business_id, + business_type, + ticket_id, + file_type, + file_name, + upload_user, + create_user_id, + modify_user_id, + file_number, + documents_name, + remark, + create_time, + modify_time, + sts + + )values + ( + + #{id}, + #{file_save_name}, + #{business_id}, + #{business_type}, + #{ticket_id}, + #{file_type}, + #{file_name}, + #{upload_user}, + #{create_user_id}, + #{modify_user_id}, + #{file_number}, + #{documents_name}, + #{remark}, + #{create_time} , + now(), + #{modify_time}, + now(), + 'Y' + + ) + + + + + + update sys_business_file set + + file_save_name = #{file_save_name}, + business_id = #{business_id}, + business_type = #{business_type}, + ticket_id = #{ticket_id}, + file_type = #{file_type}, + file_name = #{file_name}, + upload_user = #{upload_user}, + create_user_id = #{create_user_id}, + modify_user_id = #{modify_user_id}, + file_number = #{file_number}, + documents_name = #{documents_name}, + remark = #{remark}, + modify_time =#{modify_time} + modify_time = now() + + where id = #{id} + + + + + update sys_business_file set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where + id = #{id} + + + + + update sys_business_file set + sts='N',modify_time = now(),modify_user_id = #{modify_user_id} + + id=#{id} + and file_save_name = #{file_save_name} + and business_id = #{business_id} + and business_type = #{business_type} + and ticket_id = #{ticket_id} + and file_type = #{file_type} + and file_name = #{file_name} + and upload_user = #{upload_user} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and file_number = #{file_number} + and remark = #{remark} + + + + + + delete from sys_business_file where id =#{id} + + diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/service/IBusinessFileService.java b/service/src/main/java/com/hzya/frame/sys/businessFile/service/IBusinessFileService.java new file mode 100644 index 00000000..005da343 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/service/IBusinessFileService.java @@ -0,0 +1,73 @@ +package com.hzya.frame.sys.businessFile.service; + import com.alibaba.fastjson.JSONObject; + import com.hzya.frame.basedao.service.IBaseService; + import com.hzya.frame.sys.businessFile.entity.BusinessFileEntity; + import com.hzya.frame.web.entity.JsonResultEntity; + + import java.util.List; + +/** + * @description: 文件业务关系 service + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * @author: gjh + * @history: 1.0 + */ +public interface IBusinessFileService extends IBaseService { + /*** + * 保存业务表和文件表的关系 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-10-09 8:32 + * @param + * @return com.hzya.frame.sys.businessFile.entity.BusinessFileEntity + **/ + BusinessFileEntity saveBusinessFile(BusinessFileEntity requestData); + /*** + * 保存业务表和文件表的关系 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-10-09 8:32 + * @param + * @return com.hzya.frame.sys.businessFile.entity.BusinessFileEntity + **/ + JsonResultEntity saveBusinessFileByJsonObj(JSONObject requestData); + + /*** + * 批量保存文件业务相关信息 + * @param entity + * @return + */ + BusinessFileEntity saveBatchBusinessFile(BusinessFileEntity entity) throws Exception; + + + /*** + * 根据业务条件获取根据单证编号分组的附件列表 + * @param entity + * @return + */ + List listQueryBusinessFilesByGroup(BusinessFileEntity entity); + + /*** + * 根据服务项类型获取附件列表 + * @param entity + * @return + */ + List queryBusinessFileByServiceType(BusinessFileEntity entity); + + /*** + * 验证单票是否有附件可以下载 + * @param entity + * @return + */ + BusinessFileEntity validateTicketFiles(BusinessFileEntity entity); + + /**** + * @Content: 保存保函附件 + * @Author guojh + * @Date 2019/5/16 19:16 + * @Param [entity] + * @return com.hzya.frame.sys.businessFile.entity.BusinessFileEntity + **/ + BusinessFileEntity saveBusinessFileToGuarantee(BusinessFileEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/sys/businessFile/service/impl/BusinessFileServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/businessFile/service/impl/BusinessFileServiceImpl.java new file mode 100644 index 00000000..ae02230b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/businessFile/service/impl/BusinessFileServiceImpl.java @@ -0,0 +1,204 @@ +package com.hzya.frame.sys.businessFile.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sys.businessFile.dao.IBusinessFileDao; +import com.hzya.frame.sys.businessFile.entity.BusinessFileEntity; +import com.hzya.frame.sys.businessFile.service.IBusinessFileService; +import com.hzya.frame.sys.file.upload.entity.FileResultEntity; +import com.hzya.frame.sys.file.upload.entity.FileUploadEntity; +import com.hzya.frame.sys.file.upload.service.IFileUploadService; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.web.action.SessionContext; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @description: 文件业务关系 service + * @tableName: sys_business_file + * @entityName: BusinessFileEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value = "sys_business_fileService") +public class BusinessFileServiceImpl extends BaseService implements IBusinessFileService { + protected IBusinessFileDao businessfileDao; + + @Autowired + private IFileUploadService fileUploadService; + + @Autowired + public void setBusinessFileDao(IBusinessFileDao dao) { + + this.businessfileDao = dao; + this.dao = dao; + } + + @Override + public BusinessFileEntity saveBusinessFile(BusinessFileEntity entity) { + entity.setId(String.valueOf(UUIDLong.longUUID())); + businessfileDao.save(entity); + return entity; + } + @Override + public JsonResultEntity saveBusinessFileByJsonObj(JSONObject requestData) { + String jsonStr = requestData.getString("jsonStr"); + BusinessFileEntity entity = JSON.parseObject(jsonStr,BusinessFileEntity.class); + entity.setId(String.valueOf(UUIDLong.longUUID())); + businessfileDao.save(entity); + + return BaseResult.getSuccessMessageEntity("保存成功",entity); + } + @Override + public BusinessFileEntity saveBatchBusinessFile(BusinessFileEntity entity) throws Exception { + /** 获取传入的文件集合*/ + List entityBusinessFileEntityList = null; + String jsonStr = entity.getJsonDataStr(); + + if (jsonStr != null && !"".equals(jsonStr)) { + BusinessFileEntity businessFileEntity = JSON.parseObject(jsonStr, BusinessFileEntity.class); + entity.setTicket_id(businessFileEntity.getTicket_id() == null ? entity.getTicket_id() : businessFileEntity.getTicket_id()); + entity.setBusiness_type(businessFileEntity.getBusiness_type()); + entityBusinessFileEntityList = businessFileEntity.getBusinessFileEntityList(); + } else { + entityBusinessFileEntityList = entity.getBusinessFileEntityList(); + + } + + + if (null != entityBusinessFileEntityList && entityBusinessFileEntityList.size() > 0) { +// UserEntity userEntity = SessionContext.getCurrentUser(); + for (BusinessFileEntity businessFileEntity : entityBusinessFileEntityList) { + + String file_business_id = businessFileEntity.getBusiness_id(); + //如果businessFileEntity内的business_id 与主表传入的不一致,说明需要重新上传附件 + if (null != file_business_id && !"".equals(file_business_id) && !file_business_id.equals(entity.getBusiness_id())) { + + String fileSaveName = businessFileEntity.getFile_save_name(); + FileUploadEntity oldFileEntity = new FileUploadEntity(); + oldFileEntity.setFilesavename(fileSaveName); + List fileUploadEntityList = fileUploadService.query(oldFileEntity); + if (fileUploadEntityList.size() > 0) { + oldFileEntity = fileUploadEntityList.get(0); + } else { + throw new BaseSystemException("获取历史附件错误,请联系管理员!"); + } + String oldPath = oldFileEntity.getFilepath() + "/" + fileSaveName; + //根据老文件获取文件,写到新的文件夹下面 + File oldFile = new File(oldPath); + //获取流 + InputStream in = new FileInputStream(oldFile); + //创建文件 + MockMultipartFile mockMultipartFile = new MockMultipartFile(oldFileEntity.getFilename(), oldFileEntity.getFilename(), oldFileEntity.getType(), in); + + FileResultEntity fileResultEntity = new FileResultEntity(); + fileResultEntity.setBusiness_id(Long.valueOf(entity.getBusiness_id())); + fileResultEntity.setTicket_id(entity.getTicket_id()); + fileResultEntity.setBusiness_type(entity.getBusiness_type()); + fileResultEntity = fileUploadService.fileUpload(mockMultipartFile, fileResultEntity); + FileUploadEntity fileUploadEntity = (FileUploadEntity) fileResultEntity.getAttribute(); + businessFileEntity.setFile_save_name(fileUploadEntity.getFilesavename()); + businessFileEntity.setFile_name(oldFileEntity.getFilename()); + businessFileEntity.setId(null); + } + + + businessFileEntity.setBusiness_id(entity.getBusiness_id()); + businessFileEntity.setBusiness_type(entity.getBusiness_type()); + businessFileEntity.setFile_number(entity.getFile_number()); + businessFileEntity.setTicket_id(businessFileEntity.getTicket_id() == null ? entity.getTicket_id() : businessFileEntity.getTicket_id()); + businessFileEntity.setDocuments_name(entity.getDocuments_name()); +// businessFileEntity.setCreate_user_id(userEntity.getId()); +// businessFileEntity.setUpload_user(userEntity.getView_name()); +// businessFileEntity.setModify_user_id(userEntity.getId()); + businessfileDao.saveOrUpdate(businessFileEntity); + } + } + + return entity; + } + + @Override + public List listQueryBusinessFilesByGroup(BusinessFileEntity entity) { + return businessfileDao.listQueryBusinessFiles(entity); + } + + @Override + public List queryBusinessFileByServiceType(BusinessFileEntity entity) { + /** 返回的附件集合*/ + List returnBusinessFiles = new ArrayList(); + String str = entity.getTicketAllJsonStr(); + + List ticketAllServiceEntities = null; + if (null == str || "".equals(str)) { + return returnBusinessFiles; + } else { + ticketAllServiceEntities = JSON.parseArray(str, String.class); + } + if (null == ticketAllServiceEntities || ticketAllServiceEntities.size() == 0) { + return returnBusinessFiles; + } else { + entity.setTicketAllServiceEntities(ticketAllServiceEntities); + returnBusinessFiles = businessfileDao.queryBusinessFileByServiceType(entity); + } + + return returnBusinessFiles; + } + + @Override + public BusinessFileEntity validateTicketFiles(BusinessFileEntity entity) { + Long ticket_id = entity.getTicket_id(); + + /** 根据单票的ID获取单票下的所有的附件*/ + BusinessFileEntity queryBusinessFileEntity = new BusinessFileEntity(); + queryBusinessFileEntity.setTicket_id(ticket_id); + List entityBusinessFileEntityList = businessfileDao.query(queryBusinessFileEntity); + if (entityBusinessFileEntityList.size() == 0) { + throw new BaseSystemException("单票ID:" + ticket_id + "未查询到可打包下载的附件!"); + } + entity.setBusinessFileEntityList(entityBusinessFileEntityList); + + return entity; + } + + @Override + public BusinessFileEntity saveBusinessFileToGuarantee(BusinessFileEntity entity) { + /** 获取当前登陆人*/ + /** 获取file转成的集合JSON字符串*/ + String fileInfo = entity.getFileInfo(); + /** 转成对象*/ + BusinessFileEntity businessFileEntity = JSON.parseObject(fileInfo, BusinessFileEntity.class); + /** 获取file集合*/ + List businessFileEntityList = businessFileEntity.getBusinessFileEntityList(); + if (null != businessFileEntityList && businessFileEntityList.size() > 0) { + for (BusinessFileEntity fileEntity : businessFileEntityList) { +// if (fileEntity.getId() == null) { +// fileEntity.setCreate_user_id(userEntity.getId()); +// fileEntity.setModify_user_id(userEntity.getId()); +// fileEntity.setOrg_id(userEntity.getOrg_id()); +// fileEntity.setCompany_org_id(userEntity.getCompany_org_id()); +// fileEntity.setBusiness_type(entity.getBusiness_type()); +// fileEntity.setBusiness_id(entity.getBusiness_id()); +// fileEntity.setUpload_user(userEntity.getView_name()); +// businessfileDao.saveOrUpdate(fileEntity); +// } + } + entity.setBusinessFileEntityList(businessFileEntityList); + } + + + return entity; + } +} diff --git a/service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/entity/IPaymentOrderService.xml b/service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/entity/IPaymentOrderService.xml new file mode 100644 index 00000000..967c5fbf --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/entity/IPaymentOrderService.xml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + tab_name, + column_name, + column_content, + column_value, + column_num_value, + up_id, + memo, + used_sts, + sorts, + org_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts + + + + + + + + + + + + + + + + + + + insert into sys_dictionaryshop_new( + + id, + tab_name, + column_name, + column_content, + column_value, + column_num_value, + up_id, + memo, + used_sts, + sorts, + org_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + + )values + ( + + #{id}, + #{tabName}, + #{columnName}, + #{columnContent}, + #{columnValue}, + #{columnNumValue}, + #{upId}, + #{memo}, + #{usedSts}, + #{sorts}, + #{orgId}, + #{createUserId}, + #{createTime}, + #{modifyUserId}, + #{modifyTime}, + #{sts}, + + ) + + + + + update sys_dictionaryshop_new set + + tab_name = #{tabName}, + column_name = #{columnName}, + column_content = #{columnContent}, + column_value = #{columnValue}, + column_num_value = #{columnNumValue}, + up_id = #{upId}, + memo = #{memo}, + used_sts = #{usedSts}, + sorts = #{sorts}, + org_id = #{orgId}, + create_user_id = #{createUserId}, + create_time = #{createTime}, + modify_user_id = #{modifyUserId}, + modify_time = #{modifyTime}, + sts = #{sts}, + + where id = #{id} + + + + + update sys_dictionaryshop_new set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} where + id = #{id} + + + + + update sys_dictionaryshop_new set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} + + id = #{id} + and tab_name = #{tabName} + and column_name = #{columnName} + and column_content = #{columnContent} + and column_value = #{columnValue} + and column_num_value = #{columnNumValue} + and up_id = #{upId} + and memo = #{memo} + and used_sts = #{usedSts} + and sorts = #{sorts} + and org_id = #{orgId} + and create_user_id = #{createUserId} + and create_time = #{createTime} + and modify_user_id = #{modifyUserId} + and modify_time = #{modifyTime} + and sts = #{sts} + + + + + + delete from sys_dictionaryshop_new where id =#{id} + + + + + + diff --git a/service/src/main/java/com/hzya/frame/sys/productVersion/entity/IPaymentOrderService.xml b/service/src/main/java/com/hzya/frame/sys/productVersion/entity/IPaymentOrderService.xml new file mode 100644 index 00000000..da40cb14 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/productVersion/entity/IPaymentOrderService.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID as id, + product_id as product_id, + version_number as version_number, + version_description as version_description, + sorts as sorts, + org_id as org_id, + sts as sts, + create_user_id as create_user_id, + create_time as create_time, + modify_time as modify_time, + modify_user_id as modify_user_id + + + + + + + + + + + + + + + + + + insert into sys_product_version( + + ID, + product_id, + version_number, + version_description, + sorts, + org_id, + sts, + create_user_id, + create_time, + modify_time, + modify_user_id, + + )values + ( + + #{id}, + #{productId}, + #{versionNumber}, + #{versionDescription}, + #{sorts}, + #{orgId}, + #{sts}, + #{createUserId}, + #{createTime}, + #{modifyTime}, + #{modifyUserId}, + + ) + + + + + update sys_product_version set + + ID = #{id}, + product_id = #{productId}, + version_number = #{versionNumber}, + version_description = #{versionDescription}, + sorts = #{sorts}, + org_id = #{orgId}, + sts = #{sts}, + create_user_id = #{createUserId}, + create_time = #{createTime}, + modify_time = #{modifyTime}, + modify_user_id = #{modifyUserId}, + + where id = #{id} + + + + + + + update sys_product_version set + sts='N',modify_time = #{modifyTime} ,modify_user_id = #{modifyUserId} + + and ID = #{id} + and product_id = #{productId} + and version_number = #{versionNumber} + and version_description = #{versionDescription} + and sorts = #{sorts} + and org_id = #{orgId} + and sts = #{sts} + and create_user_id = #{createUserId} + and create_time = #{createTime} + + + + + delete from sys_product_version where id =#{id} + + diff --git a/service/src/main/java/com/hzya/frame/sys/thirdparty/api/test/entity/IPaymentOrderService.xml b/service/src/main/java/com/hzya/frame/sys/thirdparty/api/test/entity/IPaymentOrderService.xml new file mode 100644 index 00000000..ec4d37e0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/thirdparty/api/test/entity/IPaymentOrderService.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, + thirdparty_api_id, + product_name, + use_case_name, + sorts, + org_id, + sts, + create_time, + create_user_id, + modify_time, + modify_user_id + + + + + + + + + + + + + + + + + + + insert into sys_thirdparty_api_test( + + id, + thirdparty_api_id, + product_name, + use_case_name, + sorts, + org_id, + sts, + create_time, + create_user_id, + modify_time, + modify_user_id, + + )values + ( + + #{id}, + #{thirdpartyApiId}, + #{productName}, + #{useCaseName}, + #{sorts}, + #{orgId}, + #{sts}, + #{createTime}, + #{createUserId}, + #{modifyTime}, + #{modifyUserId}, + + ) + + + + + update sys_thirdparty_api_test set + + thirdparty_api_id = #{thirdpartyApiId}, + product_name = #{productName}, + use_case_name = #{useCaseName}, + sorts = #{sorts}, + org_id = #{orgId}, + sts = #{sts}, + create_time = #{createTime}, + create_user_id = #{createUserId}, + modify_time = #{modifyTime}, + modify_user_id = #{modifyUserId}, + + where id = #{id} + + + + + update sys_thirdparty_api_test set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} where + id = #{id} + + + + + update sys_thirdparty_api_test set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} + + id = #{id} + and thirdparty_api_id = #{thirdpartyApiId} + and product_name = #{productName} + and use_case_name = #{useCaseName} + and sorts = #{sorts} + and org_id = #{orgId} + and sts = #{sts} + and create_time = #{createTime} + and create_user_id = #{createUserId} + + + + + + delete from sys_thirdparty_api_test where id =#{id} + + + + + update sys_thirdparty_api_test set + sts='N',modify_time = now() + WHERE thirdparty_api_id in + + #{ids} + + + diff --git a/service/src/main/java/com/hzya/frame/sys/userModule/entity/IPaymentOrderService.xml b/service/src/main/java/com/hzya/frame/sys/userModule/entity/IPaymentOrderService.xml new file mode 100644 index 00000000..51af7bf3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/userModule/entity/IPaymentOrderService.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, + module_id, + user_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + org_id + + + + + + + + + + + + + + + + + + + insert into sys_user_module( + + id, + module_id, + user_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + org_id, + + )values + ( + + #{id}, + #{moduleId}, + #{userId}, + #{createUserId}, + #{createTime}, + #{modifyUserId}, + #{modifyTime}, + #{sts}, + #{orgId}, + + ) + + + + + update sys_user_module set + + module_id = #{moduleId}, + user_id = #{userId}, + create_user_id = #{createUserId}, + create_time = #{createTime}, + modify_user_id = #{modifyUserId}, + modify_time = #{modifyTime}, + sts = #{sts}, + org_id = #{orgId}, + + where id = #{id} + + + + + update sys_user_module set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} where + id = #{id} + + + + + update sys_user_module set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} + + id = #{id} + and module_id = #{moduleId} + and user_id = #{userId} + and create_user_id = #{createUserId} + and create_time = #{createTime} + and sts = #{sts} + and org_id = #{orgId} + + + + + + delete from sys_user_module where id =#{id} + + diff --git a/service/src/main/java/com/hzya/frame/sys/userRole/entity/IPaymentOrderService.xml b/service/src/main/java/com/hzya/frame/sys/userRole/entity/IPaymentOrderService.xml new file mode 100644 index 00000000..98afc280 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sys/userRole/entity/IPaymentOrderService.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, + user_id, + role_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + org_id + + + + + + + + + + + + + + + + + + + insert into sys_user_role( + + id, + user_id, + role_id, + create_user_id, + create_time, + modify_user_id, + modify_time, + sts, + org_id, + + )values + ( + + #{id}, + #{userId}, + #{roleId}, + #{createUserId}, + #{createTime}, + #{modifyUserId}, + #{modifyTime}, + #{sts}, + #{orgId}, + + ) + + + + + update sys_user_role set + + user_id = #{userId}, + role_id = #{roleId}, + create_user_id = #{createUserId}, + create_time = #{createTime}, + modify_user_id = #{modifyUserId}, + modify_time = #{modifyTime}, + sts = #{sts}, + org_id = #{orgId}, + + where id = #{id} + + + + + update sys_user_role set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} where + id = #{id} + + + + + update sys_user_role set + sts='N',modify_time = now(),modify_user_id = #{modifyUserId} + + id = #{id} + and user_id = #{userId} + and role_id = #{roleId} + and create_user_id = #{createUserId} + and create_time = #{createTime} + and sts = #{sts} + and org_id = #{orgId} + + + + + + delete from sys_user_role where id =#{id} + +