diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 51edad53..25faaac2 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -179,6 +179,8 @@ public class SysUserController extends BaseController { list.add(deptUserEntity); } deptUserService.insertBatch(list); + } else { + } Map res = new HashMap<>(); @@ -221,13 +223,11 @@ public class SysUserController extends BaseController { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } // 修改角色 - if (authAdminSaveRequest.getRoles() != null && authAdminSaveRequest.getRoles().size() > 0) { - userService.insertUserAuth(authAdmin.getId(), authAdminSaveRequest.getRoles()); - } + userService.insertUserAuth(authAdmin.getId(), authAdminSaveRequest.getRoles()); //修改所属部门 + deptUserService.deleteByUser(authAdminSaveRequest.getId()); if (CollUtil.isNotEmpty(authAdminSaveRequest.getDepts())) { - deptUserService.deleteByUser(authAdminSaveRequest.getId()); List list = new ArrayList<>(); for (int i = 0; i < authAdminSaveRequest.getDepts().size(); i++) { DeptUserEntity deptUserEntity = new DeptUserEntity(); diff --git a/src/main/java/com/glxp/api/controller/system/SystemPDFModuleController.java b/src/main/java/com/glxp/api/controller/system/SystemPDFModuleController.java new file mode 100644 index 00000000..2b643198 --- /dev/null +++ b/src/main/java/com/glxp/api/controller/system/SystemPDFModuleController.java @@ -0,0 +1,180 @@ +package com.glxp.api.controller.system; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.system.SystemPDFModuleEntity; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; +import com.glxp.api.req.system.SystemPDFModuleRequest; +import com.glxp.api.req.system.SystemPDFModuleSaveRequest; +import com.glxp.api.req.system.SystemPDFTemplateRelevanceRequest; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.res.system.SystemPDFModuleResponse; +import com.glxp.api.res.system.SystemPDFModuleSelectResponse; +import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse; +import com.glxp.api.service.system.SystemPDFModuleService; +import com.glxp.api.service.system.SystemPDFTemplateRelevanceService; +import com.glxp.api.service.system.SystemPDFTemplateService; +import org.springframework.beans.BeanUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@RestController +public class SystemPDFModuleController { + + @Resource + private SystemPDFModuleService systemPDFModuleService; + @Resource + private SystemPDFTemplateRelevanceService systemPDFTemplateRelevanceService; + @Resource + private SystemPDFTemplateService systemPDFTemplateService; +// @Resource +// BussinessLocalTypeService bussinessLocalTypeService; + + @AuthRuleAnnotation("system/pdf/module/list") + @GetMapping("/system/pdf/module/list") + public BaseResponse list(@Valid SystemPDFModuleRequest systemPDFModuleRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + List systemPDFModuleEntityList = systemPDFModuleService.queryPage(systemPDFModuleRequest); + List systemPDFModuleResponseList = systemPDFModuleEntityList.stream().map(item -> { + SystemPDFModuleResponse systemPDFModuleResponse = new SystemPDFModuleResponse(); + BeanUtils.copyProperties(item, systemPDFModuleResponse); + if (item.getTemplateId() != 0) { + SystemPDFTemplateEntity systemPDFTemplateEntity = + systemPDFTemplateService.selectById(String.valueOf(item.getTemplateId())); + if (systemPDFTemplateEntity != null) { + systemPDFModuleResponse.setTemplateName(systemPDFTemplateEntity.getName()); + } + } + return systemPDFModuleResponse; + }).collect(Collectors.toList()); + + PageInfo pageInfo = new PageInfo<>(systemPDFModuleEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(systemPDFModuleResponseList); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @AuthRuleAnnotation("system/pdf/module/detail") + @GetMapping("/system/pdf/module/detail") + public BaseResponse moduleDetail(@Valid SystemPDFTemplateRelevanceRequest systemPDFModuleRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + //todo 单据类型未迁移完, +// if (systemPDFModuleRequest.getTemplateType() != null && systemPDFModuleRequest.getTemplateType() == 2) { +// BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest(); +// List bussinessLocalTypeEntities = bussinessLocalTypeService.filterJoin(bussinessLocalTypeFilterRequest); +// for (BussinessLocalTypeEntity bussinessLocalTypeEntity : bussinessLocalTypeEntities) { +// SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity = new SystemPDFTemplateRelevanceEntity(); +// systemPDFTemplateRelevanceEntity.setLocalAction(bussinessLocalTypeEntity.getLocalAction()); +// systemPDFTemplateRelevanceEntity.setModuleId(systemPDFModuleRequest.getModuleId()); +// systemPDFTemplateRelevanceService.insert(systemPDFTemplateRelevanceEntity); +// } +// +// List systemPDFTemplateRelevanceEntityList = +// systemPDFTemplateRelevanceService.filterList(systemPDFModuleRequest); +// PageInfo pageInfo = new PageInfo<>(systemPDFTemplateRelevanceEntityList); +// PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); +// pageSimpleResponse.setList(pageInfo.getList()); +// pageSimpleResponse.setTotal(pageInfo.getTotal()); +// return ResultVOUtils.success(pageSimpleResponse); +// } + return ResultVOUtils.success(null); + + + } + + @AuthRuleAnnotation("system/pdf/module/updateRl") + @PostMapping("/system/pdf/module/updateRl") + public BaseResponse updateRl(@RequestBody SystemPDFTemplateRelevanceEntity systemPDFModuleSaveRequest) { + systemPDFTemplateRelevanceService.udpateRl(systemPDFModuleSaveRequest); + return ResultVOUtils.success("修改成功"); + } + + + @AuthRuleAnnotation("system/pdf/module/list") + @GetMapping("/system/pdf/module/pdfModules") + public BaseResponse pdfModules(@RequestParam(value = "page", defaultValue = "1") Integer page, + @RequestParam(value = "limit", defaultValue = "100") Integer limit) { + + List systemPDFModuleEntityList = systemPDFModuleService.listPDFModules(page, limit); + PageInfo pageInfo = new PageInfo<>(systemPDFModuleEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + List systemPDFModuleSelectResponses = systemPDFModuleEntityList.stream().map(e -> { + SystemPDFModuleSelectResponse systemPDFModuleSelectResponse = new SystemPDFModuleSelectResponse(); + BeanUtils.copyProperties(e, systemPDFModuleSelectResponse); + systemPDFModuleSelectResponse.setIdStr(String.valueOf(e.getId())); + return systemPDFModuleSelectResponse; + }).collect(Collectors.toList()); + pageSimpleResponse.setList(systemPDFModuleSelectResponses); + + return ResultVOUtils.success(pageSimpleResponse); + } + + + @AuthRuleAnnotation("system/pdf/module/save") + @PostMapping("/system/pdf/module/save") + public BaseResponse save(@RequestBody @Valid SystemPDFModuleSaveRequest systemPDFModuleSaveRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + SystemPDFModuleEntity systemPDFModuleEntity = new SystemPDFModuleEntity(); + BeanUtils.copyProperties(systemPDFModuleSaveRequest, systemPDFModuleEntity); + + systemPDFModuleEntity.setCreate_time(new Date()); + systemPDFModuleEntity.setUpdate_time(new Date()); + + boolean b = systemPDFModuleService.insert(systemPDFModuleEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + + return ResultVOUtils.success(); + } + + @AuthRuleAnnotation("system/pdf/module/update") + @PostMapping("/system/pdf/module/update") + public BaseResponse update(@RequestBody SystemPDFModuleSaveRequest systemPDFModuleSaveRequest) { + systemPDFModuleSaveRequest.setUpdate_time(new Date()); + systemPDFModuleService.updateById(systemPDFModuleSaveRequest); + + return ResultVOUtils.success("修改成功"); + } + + @AuthRuleAnnotation("system/pdf/module/delete") + @GetMapping("/system/pdf/module/delete") + public BaseResponse deleteById(@RequestParam("id") Integer id) { + + + boolean b = systemPDFModuleService.deleteById(id); + if (b) + return ResultVOUtils.success("删除成功"); + else { + return ResultVOUtils.error(500, "删除失败"); + } + } +} diff --git a/src/main/java/com/glxp/api/controller/system/SystemPDFTemplateController.java b/src/main/java/com/glxp/api/controller/system/SystemPDFTemplateController.java new file mode 100644 index 00000000..ae7fd8ec --- /dev/null +++ b/src/main/java/com/glxp/api/controller/system/SystemPDFTemplateController.java @@ -0,0 +1,150 @@ +package com.glxp.api.controller.system; + +import com.github.pagehelper.PageInfo; +import com.glxp.api.annotation.AuthRuleAnnotation; +import com.glxp.api.common.enums.ResultEnum; +import com.glxp.api.common.res.BaseResponse; +import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.system.SystemPDFTemplateRequest; +import com.glxp.api.req.system.SystemPDFTemplateSaveRequest; +import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.res.system.SystemPDFTemplateResponse; +import com.glxp.api.res.system.SystemPDFTemplateSelectResponse; +import com.glxp.api.service.system.SystemPDFTemplateService; +import com.glxp.api.util.JasperUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.File; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@RestController +public class SystemPDFTemplateController { + + @Resource + private SystemPDFTemplateService systemPDFTemplateService; + + @AuthRuleAnnotation("system/pdf/template/list") + @GetMapping("/system/pdf/template/list") + public BaseResponse list(@Valid SystemPDFTemplateRequest systemPDFTemplateRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } +// systemPDFTemplateRequest.setType(2); + List systemPDFTemplateEntityList = systemPDFTemplateService.queryPage(systemPDFTemplateRequest); + List systemPDFTemplateResponseList = systemPDFTemplateEntityList.stream().map(item -> { + SystemPDFTemplateResponse systemPDFTemplateResponse = new SystemPDFTemplateResponse(); + BeanUtils.copyProperties(item, systemPDFTemplateResponse); + return systemPDFTemplateResponse; + }).collect(Collectors.toList()); + + PageInfo pageInfo = new PageInfo<>(systemPDFTemplateEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(systemPDFTemplateResponseList); + return ResultVOUtils.success(pageSimpleResponse); + } + + + @AuthRuleAnnotation("") + @PostMapping("/system/pdf/template/demoPrint") + public void demoPrint( + @RequestBody SystemPDFTemplateRequest systemPDFTemplateRequest, + HttpServletRequest request, HttpServletResponse response) throws Exception { + + SystemPDFTemplateEntity systemPDFTemplateEntity = + systemPDFTemplateService.selectById(String.valueOf(systemPDFTemplateRequest.getId())); + String data = ""; + if (systemPDFTemplateEntity.getModule() == 2) { + data = + "{\"data\":[{\"batchNo\":\"2020\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"1\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\"},{\"batchNo\":\"2023\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"2\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\"},{\"batchNo\":\"2021\",\"billNo\":\"2022040811589\",\"billType\":\"ST39730635520\",\"billdate\":\"2022-04-08\",\"corpId\":\"39864007581\",\"corpName\":\"漳州**有限公司\",\"count\":\"4\",\"customerId\":\"39864007581\",\"expireDate\":\"251020\",\"id\":\"10\",\"index\":\"3\",\"locInv\":\"总库\",\"orderIdFk\":\"SM412208685600\",\"printStatus\":\"102\",\"productDate\":\"201020\",\"productId\":\"169\",\"productName\":\"一次性使用开环式微创肛肠吻合器\",\"sourceType\":\"1\",\"spec\":\"TST33-T80——2993规格\",\"status\":\"5\",\"sweepCount\":\"0\",\"title\":\"漳州**医院\",\"type\":\"2\",\"unitIdFk\":\"39864007581\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"苏械注准2022000000\",\"price\":\"10.00\"}]}"; + } else if (systemPDFTemplateEntity.getModule() == 0) { + data = + "{\"data\":[{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"},{\"batchNo\":\"2021\",\"corpName\":\"漳州***医院\",\"count\":10,\"cpmctymc\":\"髋关节假体\",\"expireDate\":\"230606\",\"ggxh\":\"DTUCS Ⅱ 3#\",\"id\":4,\"nameCode\":\"06902139302144\",\"produceDate\":\"210606\",\"udiCode\":\"#06902139302144#210606#230606#2021###\",\"ylqxzcrbarmc\":\"漳州**有限公司\",\"zczbhhzbapzbh\":\"国械注准201000000000\"}]}"; + } + JasperUtils.jasperReport(request, response, data, systemPDFTemplateEntity.getPath(), "pdf"); + + } + + @AuthRuleAnnotation("system/pdf/template/list") + @GetMapping("/system/pdf/template/pdfTemplates") + public BaseResponse pdfTemplates(@RequestParam(value = "page", defaultValue = "1") Integer page, + @RequestParam(value = "limit", defaultValue = "100") Integer limit) { + + List systemPDFTemplateEntityList = systemPDFTemplateService.listPDFTemplates(page, limit); + PageInfo pageInfo = new PageInfo<>(systemPDFTemplateEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + List systemPDFTemplateSelectResponses = systemPDFTemplateEntityList.stream().map(e -> { + SystemPDFTemplateSelectResponse systemPDFTemplateSelectResponse = new SystemPDFTemplateSelectResponse(); + BeanUtils.copyProperties(e, systemPDFTemplateSelectResponse); + systemPDFTemplateSelectResponse.setIdStr(String.valueOf(e.getId())); + return systemPDFTemplateSelectResponse; + }).collect(Collectors.toList()); + pageSimpleResponse.setList(systemPDFTemplateSelectResponses); + + return ResultVOUtils.success(pageSimpleResponse); + } + + @AuthRuleAnnotation("system/pdf/template/save") + @PostMapping("/system/pdf/template/save") + public BaseResponse save(@RequestBody @Valid SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + SystemPDFTemplateEntity systemPDFTemplateEntity = new SystemPDFTemplateEntity(); + BeanUtils.copyProperties(systemPDFTemplateSaveRequest, systemPDFTemplateEntity); + + systemPDFTemplateEntity.setCreate_time(new Date()); + systemPDFTemplateEntity.setUpdate_time(new Date()); + + boolean b = systemPDFTemplateService.insert(systemPDFTemplateEntity); + if (!b) { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK); + } + + return ResultVOUtils.success(); + } + + @AuthRuleAnnotation("system/pdf/template/update") + @PostMapping("/system/pdf/template/update") + public BaseResponse update(@RequestBody SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest) { +// systemPDFTemplateSaveRequest.setId(1); + systemPDFTemplateSaveRequest.setUpdate_time(new Date()); + systemPDFTemplateService.updateById(systemPDFTemplateSaveRequest); + + return ResultVOUtils.success("修改成功"); + } + + @AuthRuleAnnotation("system/pdf/template/delete") + @GetMapping("/system/pdf/template/delete") + public BaseResponse deleteById(@RequestParam("id") Integer id, + @RequestParam("path") String path) { + + if (StringUtils.isNotBlank(path)) {//删除文件 + File file = new File(path); + file.delete(); + } + + boolean b = systemPDFTemplateService.deleteById(id); + if (b) + return ResultVOUtils.success("删除成功"); + else { + return ResultVOUtils.error(500, "删除失败"); + } + } +} diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFModuleDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFModuleDao.java new file mode 100644 index 00000000..c68bb19c --- /dev/null +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFModuleDao.java @@ -0,0 +1,26 @@ +package com.glxp.api.dao.system; + +import com.glxp.api.entity.system.SystemPDFModuleEntity; +import com.glxp.api.req.system.SystemPDFModuleRequest; +import com.glxp.api.req.system.SystemPDFModuleSaveRequest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface SystemPDFModuleDao { + + List queryPage(SystemPDFModuleRequest systemPDFModuleRequest); + + List listPDFModules(); + + SystemPDFModuleEntity findSystemPDFModule(SystemPDFModuleRequest systemPDFModuleRequest); + + SystemPDFModuleEntity selectById(String id); + + boolean updateById(SystemPDFModuleSaveRequest systemPDFModuleSaveRequest); + + boolean insert(SystemPDFModuleEntity systemPDFModuleEntity); + + boolean deleteById(Integer id); +} diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java new file mode 100644 index 00000000..b5c6dafc --- /dev/null +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java @@ -0,0 +1,26 @@ +package com.glxp.api.dao.system; + +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.system.SystemPDFTemplateRequest; +import com.glxp.api.req.system.SystemPDFTemplateSaveRequest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface SystemPDFTemplateDao { + + List queryPage(SystemPDFTemplateRequest systemPDFTemplateRequest); + + List listPDFTemplates(); + + SystemPDFTemplateEntity findSystemPDFTemplate(SystemPDFTemplateRequest systemPDFTemplateRequest); + + SystemPDFTemplateEntity selectById(String id); + + boolean updateById(SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest); + + boolean insert(SystemPDFTemplateEntity systemPDFTemplateEntity); + + boolean deleteById(Integer id); +} diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java new file mode 100644 index 00000000..17e3de37 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateRelevanceDao.java @@ -0,0 +1,60 @@ +package com.glxp.api.dao.system; + +import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; +import com.glxp.api.req.system.SystemPDFTemplateRelevanceRequest; +import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + + +@Mapper +public interface SystemPDFTemplateRelevanceDao { + + + List filterList(SystemPDFTemplateRelevanceRequest systemPDFModuleRequest); + + /** + * 根据 customerId 查询 + * + * @param customerId 传入的 customerId + * @return + */ + List listByCustomerId(Long customerId); + + /** + * 根据 多个 customerId 查询 + * + * @param customerIds 传入的 customerIds + * @return + */ + List listByCustomerIdIn(List customerIds); + + /** + * 根据 template_id 查询 customer_id + * + * @param templateId 传入的 templateId + * @return + */ + List listByTemplateId(int templateId); + + /** + * 批量插入 + * + * @param systemPDFTemplateRelevanceEntityList + * @return + */ + int insertSystemPDFTemplateRelevanceAll(List systemPDFTemplateRelevanceEntityList); + + boolean insert(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity); + + + /** + * 根据 customerId 删除 + * + * @return + */ + boolean deleteById(Integer id); + + boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity); +} diff --git a/src/main/java/com/glxp/api/req/system/SystemPDFModuleRequest.java b/src/main/java/com/glxp/api/req/system/SystemPDFModuleRequest.java new file mode 100644 index 00000000..4dca7cf8 --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SystemPDFModuleRequest.java @@ -0,0 +1,22 @@ +package com.glxp.api.req.system; + +import com.glxp.api.req.ListPageRequest; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@EqualsAndHashCode(callSuper = true) +@Data +public class SystemPDFModuleRequest extends ListPageRequest { + + private int id; + private String name; + private String param; + private String fieldExplain; + private int templateId; + private String remark; + private Date create_time; + private Integer templateType; + private Date update_time; +} diff --git a/src/main/java/com/glxp/api/req/system/SystemPDFModuleSaveRequest.java b/src/main/java/com/glxp/api/req/system/SystemPDFModuleSaveRequest.java new file mode 100644 index 00000000..95d5f64a --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SystemPDFModuleSaveRequest.java @@ -0,0 +1,24 @@ +package com.glxp.api.req.system; + +import lombok.Data; + +import java.util.Date; + +@Data +public class SystemPDFModuleSaveRequest { + + private int id; + private String name; + private String param; + private String fieldExplain; + private int templateId; + private String remark; + private Date create_time; + private Date update_time; + private String templateDlUrl; + private Integer templateType; + + private String remark1; + private String remark2; + private String remark3; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRelevanceRequest.java b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRelevanceRequest.java new file mode 100644 index 00000000..c1b7ae6f --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRelevanceRequest.java @@ -0,0 +1,11 @@ +package com.glxp.api.req.system; + +import com.glxp.api.req.ListPageRequest; +import lombok.Data; + +@Data +public class SystemPDFTemplateRelevanceRequest extends ListPageRequest { + private Integer moduleId; + private Integer templateType; + private String localAction; +} diff --git a/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRequest.java b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRequest.java new file mode 100644 index 00000000..df9a9415 --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateRequest.java @@ -0,0 +1,25 @@ +package com.glxp.api.req.system; + +import com.glxp.api.req.ListPageRequest; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@EqualsAndHashCode(callSuper = true) +@Data +public class SystemPDFTemplateRequest extends ListPageRequest { + + private int id; + private String name; + private Integer type; + private Integer module; + private String param; + private String path; + private int rowCount; + private int qrcodeCount; + private String remark; + private Date create_time; + private Date update_time; + private String jrxmlPath; +} diff --git a/src/main/java/com/glxp/api/req/system/SystemPDFTemplateSaveRequest.java b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateSaveRequest.java new file mode 100644 index 00000000..5dfcce0a --- /dev/null +++ b/src/main/java/com/glxp/api/req/system/SystemPDFTemplateSaveRequest.java @@ -0,0 +1,22 @@ +package com.glxp.api.req.system; + +import lombok.Data; + +import java.util.Date; + +@Data +public class SystemPDFTemplateSaveRequest { + + private int id; + private String name; + private int type; + private int module; + private String param; + private String path; + private int rowCount; + private int qrcodeCount; + private String remark; + private Date create_time; + private Date update_time; + private String jrxmlPath; +} \ No newline at end of file diff --git a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java index 2bf8c959..143ea0da 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java @@ -1,5 +1,6 @@ package com.glxp.api.service.auth.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ArrayUtil; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.auth.AuthAdminDao; @@ -159,7 +160,8 @@ public class AuthAdminServiceImpl implements AuthAdminService { SysUserRoleRequest sysUserRoleRequest = new SysUserRoleRequest(); sysUserRoleRequest.setUserId(userId); sysUserRoleMapper.delete(sysUserRoleRequest); - insertUserRole(userId, roleIds); + if (CollUtil.isNotEmpty(roleIds)) + insertUserRole(userId, roleIds); } diff --git a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java index 015a4972..0580f647 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/SysRoleServiceImpl.java @@ -287,26 +287,6 @@ public class SysRoleServiceImpl implements ISysRoleService { return rows; } - /** - * 新增角色部门信息(数据权限) - * - * @param role 角色对象 - */ -// public int insertRoleDept(SysRole role) { -// int rows = 1; -// // 新增角色与部门(数据权限)管理 -// List list = new ArrayList(); -// for (Long deptId : role.getDeptIds()) { -// SysRoleDept rd = new SysRoleDept(); -// rd.setRoleId(role.getRoleId()); -// rd.setDeptId(deptId); -// list.add(rd); -// } -// if (list.size() > 0) { -// rows = roleDeptMapper.insertBatch(list) ? list.size() : 0; -// } -// return rows; -// } /** * 通过角色ID删除角色 @@ -343,8 +323,6 @@ public class SysRoleServiceImpl implements ISysRoleService { List ids = Arrays.asList(roleIds); // 删除角色与菜单关联 roleMenuMapper.deleteByList(ids); - // 删除角色与部门关联 -// roleDeptMapper.delete(new LambdaQueryWrapper().in(SysRoleDept::getRoleId, ids)); return sysRoleMapper.deleteBatchIds(ids); } @@ -357,12 +335,9 @@ public class SysRoleServiceImpl implements ISysRoleService { @Override public int deleteAuthUser(SysUserRole userRole) { SysUserRoleRequest sysUserRoleRequest = new SysUserRoleRequest(); - + sysUserRoleRequest.setUserId(userRole.getUserId()); return sysUserRoleMapper.delete(sysUserRoleRequest); -// return sysUserRoleMapper.delete(new LambdaQueryWrapper() -// .eq(SysUserRole::getRoleId, userRole.getRoleId()) -// .eq(SysUserRole::getUserId, userRole.getUserId())); } /** @@ -375,12 +350,18 @@ public class SysRoleServiceImpl implements ISysRoleService { @Override public int deleteAuthUsers(Long roleId, Long[] userIds) { - SysUserRoleRequest sysUserRoleRequest = new SysUserRoleRequest(); - return sysUserRoleMapper.delete(sysUserRoleRequest); -// return sysUserRoleMapper.delete(new LambdaQueryWrapper() -// .eq(SysUserRole::getRoleId, roleId) -// .in(SysUserRole::getUserId, Arrays.asList(userIds))); + if (roleId != null) { + sysUserRoleRequest.setRoleId(roleId); + } + if (userIds != null && userIds.length > 0) { + for (int i = 0; i < userIds.length; i++) { + sysUserRoleRequest.setUserId(userIds[i]); + sysUserRoleMapper.delete(sysUserRoleRequest); + } + return 1; + } else + return sysUserRoleMapper.delete(sysUserRoleRequest); } /** diff --git a/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java b/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java new file mode 100644 index 00000000..9de5da5a --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/SystemPDFModuleService.java @@ -0,0 +1,26 @@ +package com.glxp.api.service.system; + + +import com.glxp.api.entity.system.SystemPDFModuleEntity; +import com.glxp.api.req.system.SystemPDFModuleRequest; +import com.glxp.api.req.system.SystemPDFModuleSaveRequest; + +import java.util.List; + + +public interface SystemPDFModuleService { + + List queryPage(SystemPDFModuleRequest systemPDFModuleRequest); + + List listPDFModules(Integer page, Integer limit); + + SystemPDFModuleEntity findSystemPDFModule(SystemPDFModuleRequest systemPDFModuleRequest); + + SystemPDFModuleEntity selectById(String id); + + boolean updateById(SystemPDFModuleSaveRequest systemPDFModuleSaveRequest); + + boolean insert(SystemPDFModuleEntity systemPDFModuleEntity); + + boolean deleteById(Integer id); +} diff --git a/src/main/java/com/glxp/api/service/system/SystemPDFTemplateRelevanceService.java b/src/main/java/com/glxp/api/service/system/SystemPDFTemplateRelevanceService.java new file mode 100644 index 00000000..f23fba77 --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/SystemPDFTemplateRelevanceService.java @@ -0,0 +1,30 @@ +package com.glxp.api.service.system; + + +import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; +import com.glxp.api.req.system.SystemPDFTemplateRelevanceRequest; +import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse; + +import java.util.List; + +public interface SystemPDFTemplateRelevanceService { + + List filterList(SystemPDFTemplateRelevanceRequest systemPDFModuleRequest); + + List listByCustomerId(Long customerId); + + List listByCustomerIdIn(List customerIds); + + List listByTemplateId(int templateId); + + int insertSystemPDFTemplateRelevanceAll(List systemPDFTemplateRelevanceEntityList); + + boolean insert(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity); + + int insertRolesCustomerIdAll(List templates, Long customerId); + + boolean deleteByCustomerId(Integer customerId); + + boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity); + +} diff --git a/src/main/java/com/glxp/api/service/system/SystemPDFTemplateService.java b/src/main/java/com/glxp/api/service/system/SystemPDFTemplateService.java new file mode 100644 index 00000000..4ff412da --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/SystemPDFTemplateService.java @@ -0,0 +1,26 @@ +package com.glxp.api.service.system; + + +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.system.SystemPDFTemplateRequest; +import com.glxp.api.req.system.SystemPDFTemplateSaveRequest; + +import java.util.List; + + +public interface SystemPDFTemplateService { + + List queryPage(SystemPDFTemplateRequest systemPDFTemplateRequest); + + List listPDFTemplates(Integer page, Integer limit); + + SystemPDFTemplateEntity findSystemPDFTemplate(SystemPDFTemplateRequest systemPDFTemplateRequest); + + SystemPDFTemplateEntity selectById(String id); + + boolean updateById(SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest); + + boolean insert(SystemPDFTemplateEntity systemPDFTemplateEntity); + + boolean deleteById(Integer id); +} diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java new file mode 100644 index 00000000..125dd936 --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFModuleServiceImpl.java @@ -0,0 +1,62 @@ +package com.glxp.api.service.system.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.system.SystemPDFModuleDao; +import com.glxp.api.entity.system.SystemPDFModuleEntity; +import com.glxp.api.req.system.SystemPDFModuleRequest; +import com.glxp.api.req.system.SystemPDFModuleSaveRequest; +import com.glxp.api.service.system.SystemPDFModuleService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class SystemPDFModuleServiceImpl implements SystemPDFModuleService { + @Resource + SystemPDFModuleDao systemPDFModuleDao; + + @Override + public List queryPage(SystemPDFModuleRequest SystemPDFModuleRequest) { + int offset = (SystemPDFModuleRequest.getPage() - 1) * SystemPDFModuleRequest.getLimit(); + PageHelper.offsetPage(offset, SystemPDFModuleRequest.getLimit()); + List list = systemPDFModuleDao.queryPage(SystemPDFModuleRequest); + return list; + } + + @Override + public List listPDFModules(Integer page, Integer limit) { + page = page != null && page > 0 ? page : 1; + limit = limit != null && limit > 0 && limit < 100 ? limit : 100; + int offset = (page - 1) * limit; + PageHelper.offsetPage(offset, limit); + List list = systemPDFModuleDao.listPDFModules(); + return list; + } + + @Override + public SystemPDFModuleEntity findSystemPDFModule(SystemPDFModuleRequest systemPDFModuleRequest) { + return systemPDFModuleDao.findSystemPDFModule(systemPDFModuleRequest); + } + + @Override + public SystemPDFModuleEntity selectById(String id) { + return systemPDFModuleDao.selectById(id); + } + + @Override + public boolean updateById(SystemPDFModuleSaveRequest systemPDFModuleSaveRequest) { + + return systemPDFModuleDao.updateById(systemPDFModuleSaveRequest); + } + + @Override + public boolean insert(SystemPDFModuleEntity systemPDFModuleEntity) { + return systemPDFModuleDao.insert(systemPDFModuleEntity); + } + + @Override + public boolean deleteById(Integer id) { + return systemPDFModuleDao.deleteById(id); + } +} diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceServiceImpl.java new file mode 100644 index 00000000..f7516f6c --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateRelevanceServiceImpl.java @@ -0,0 +1,127 @@ +package com.glxp.api.service.system.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.system.SystemPDFTemplateRelevanceDao; +import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity; +import com.glxp.api.req.system.SystemPDFTemplateRelevanceRequest; +import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse; +import com.glxp.api.service.system.SystemPDFTemplateRelevanceService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class SystemPDFTemplateRelevanceServiceImpl implements SystemPDFTemplateRelevanceService { + + @Resource + private SystemPDFTemplateRelevanceDao systemPDFTemplateRelevanceDao; + + @Override + public List filterList(SystemPDFTemplateRelevanceRequest systemPDFModuleRequest) { + if (systemPDFModuleRequest.getPage() != null) { + int offset = (systemPDFModuleRequest.getPage() - 1) * systemPDFModuleRequest.getLimit(); + PageHelper.offsetPage(offset, systemPDFModuleRequest.getLimit()); + } + return systemPDFTemplateRelevanceDao.filterList(systemPDFModuleRequest); + } + + /** + * 根据 customerId 获取模板id + * + * @param customerId + * @return + */ + @Override + public List listByCustomerId(Long customerId) { + return systemPDFTemplateRelevanceDao.listByCustomerId(customerId); + } + + /** + * 根据多个 customerId 查询角色列表 + * + * @param customerIds + * @return + */ + @Override + public List listByCustomerIdIn(List customerIds) { + if (customerIds.isEmpty()) { + return Collections.emptyList(); + } + return systemPDFTemplateRelevanceDao.listByCustomerIdIn(customerIds); + } + + /** + * 根据 roleId 获取 customerId + * + * @param templateId + * @return + */ + @Override + public List listByTemplateId(int templateId) { + return systemPDFTemplateRelevanceDao.listByTemplateId(templateId); + } + + /** + * 批量插入 + * + * @param systemPDFTemplateRelevanceEntityList + * @return + */ + @Override + public int insertSystemPDFTemplateRelevanceAll(List systemPDFTemplateRelevanceEntityList) { + + if (systemPDFTemplateRelevanceEntityList == null || systemPDFTemplateRelevanceEntityList.isEmpty()) { + return 0; + } + + return systemPDFTemplateRelevanceDao.insertSystemPDFTemplateRelevanceAll(systemPDFTemplateRelevanceEntityList); + } + + @Override + public boolean insert(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity) { + return systemPDFTemplateRelevanceDao.insert(systemPDFTemplateRelevanceEntity); + } + + /** + * 根据 模板ids 和 customerId 批量插入 + * + * @param templates + * @param customerId + * @return + */ + @Override + public int insertRolesCustomerIdAll(List templates, Long customerId) { + + List systemPDFTemplateRelevanceEntityList = templates.stream().map(aLong -> { + SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity = new SystemPDFTemplateRelevanceEntity(); + systemPDFTemplateRelevanceEntity.setTemplateId(aLong); + systemPDFTemplateRelevanceEntity.setCustomerId(customerId); + return systemPDFTemplateRelevanceEntity; + }).collect(Collectors.toList()); + if (!systemPDFTemplateRelevanceEntityList.isEmpty()) { + return insertSystemPDFTemplateRelevanceAll(systemPDFTemplateRelevanceEntityList); + } + + return 0; + } + + /** + * 根据 customerId 删除对应的模板关联 + * + * @param customerId + * @return + */ + @Override + public boolean deleteByCustomerId(Integer customerId) { + + return systemPDFTemplateRelevanceDao.deleteById(customerId); + } + + @Override + public boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity) { + return systemPDFTemplateRelevanceDao.udpateRl(systemPDFTemplateRelevanceEntity); + } +} diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java new file mode 100644 index 00000000..e4024762 --- /dev/null +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java @@ -0,0 +1,62 @@ +package com.glxp.api.service.system.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.api.dao.system.SystemPDFTemplateDao; +import com.glxp.api.entity.system.SystemPDFTemplateEntity; +import com.glxp.api.req.system.SystemPDFTemplateRequest; +import com.glxp.api.req.system.SystemPDFTemplateSaveRequest; +import com.glxp.api.service.system.SystemPDFTemplateService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class SystemPDFTemplateServiceImpl implements SystemPDFTemplateService { + @Resource + SystemPDFTemplateDao systemPDFTemplateDao; + + @Override + public List queryPage(SystemPDFTemplateRequest SystemPDFTemplateRequest) { + int offset = (SystemPDFTemplateRequest.getPage() - 1) * SystemPDFTemplateRequest.getLimit(); + PageHelper.offsetPage(offset, SystemPDFTemplateRequest.getLimit()); + List list = systemPDFTemplateDao.queryPage(SystemPDFTemplateRequest); + return list; + } + + @Override + public List listPDFTemplates(Integer page, Integer limit) { + page = page != null && page > 0 ? page : 1; + limit = limit != null && limit > 0 && limit < 100 ? limit : 100; + int offset = (page - 1) * limit; + PageHelper.offsetPage(offset, limit); + List list = systemPDFTemplateDao.listPDFTemplates(); + return list; + } + + @Override + public SystemPDFTemplateEntity findSystemPDFTemplate(SystemPDFTemplateRequest systemPDFTemplateRequest) { + return systemPDFTemplateDao.findSystemPDFTemplate(systemPDFTemplateRequest); + } + + @Override + public SystemPDFTemplateEntity selectById(String id) { + return systemPDFTemplateDao.selectById(id); + } + + @Override + public boolean updateById(SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest) { + + return systemPDFTemplateDao.updateById(systemPDFTemplateSaveRequest); + } + + @Override + public boolean insert(SystemPDFTemplateEntity systemPDFTemplateEntity) { + return systemPDFTemplateDao.insert(systemPDFTemplateEntity); + } + + @Override + public boolean deleteById(Integer id) { + return systemPDFTemplateDao.deleteById(id); + } +} diff --git a/src/main/resources/mybatis/mapper/system/SystemPDFModuleDao.xml b/src/main/resources/mybatis/mapper/system/SystemPDFModuleDao.xml new file mode 100644 index 00000000..aeef19c0 --- /dev/null +++ b/src/main/resources/mybatis/mapper/system/SystemPDFModuleDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + UPDATE sys_pdf_module + + name=#{name}, + param=#{param}, + fieldExplain=#{fieldExplain}, + remark=#{remark}, + templateId=#{templateId}, + create_time=#{create_time}, + update_time=#{update_time}, + templateDlUrl=#{templateDlUrl}, + templateType=#{templateType}, + remark1=#{remark1}, + remark2=#{remark2}, + remark3=#{remark3}, + + + + WHERE id=#{id} + + + + insert INTO sys_pdf_module( name, param, fieldExplain, remark, templateId, create_time, update_time + , templateDlUrl, templateType + , remark1, remark2, remark3) + values (#{name}, + #{param}, + #{fieldExplain}, + #{templateId}, + #{remark}, + #{create_time}, + #{update_time}, #{templateDlUrl}, #{templateType}, #{remark1}, #{remark2}, #{remark3}) + + + + + + delete + from sys_pdf_module + where id = #{id} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/system/SystemPDFTemplateDao.xml b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateDao.xml new file mode 100644 index 00000000..2dee375e --- /dev/null +++ b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateDao.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + UPDATE sys_pdf_template + + name=#{name}, + type=#{type}, + module=#{module}, + param=#{param}, + path=#{path}, + rowCount=#{rowCount}, + qrcodeCount=#{qrcodeCount}, + remark=#{remark}, + create_time=#{create_time}, + update_time=#{update_time}, + jrxmlPath=#{jrxmlPath}, + + + WHERE id=#{id} + + + + insert INTO sys_pdf_template(name, + type, module, param, path, rowCount, qrcodeCount, remark, create_time, + update_time, jrxmlPath) + values (#{name}, + #{type}, + #{module}, + #{param}, + #{path}, + #{rowCount}, + #{qrcodeCount}, + #{remark}, + #{create_time}, + #{update_time}, #{jrxmlPath}) + + + + + + delete + from sys_pdf_template + where id = #{id} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml new file mode 100644 index 00000000..e07c43ea --- /dev/null +++ b/src/main/resources/mybatis/mapper/system/SystemPDFTemplateRelevanceDao.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + INSERT INTO sys_pdf_template_relevance + (templateId, customerId) + VALUES + + + (#{item.templateId}, #{item.customerId}) + + + + + + insert + ignore + INTO sys_pdf_template_relevance + (templateId, customerId, adminId, moduleId, localAction, remark1, remark2, remark3,printType) + values ( + #{templateId}, + #{customerId}, + #{adminId}, + #{moduleId}, + #{localAction}, + #{remark1}, + #{remark2}, + #{remark3}, + #{printType} + ) + + + UPDATE sys_pdf_template_relevance + + templateId = #{templateId}, + customerId = #{customerId}, + adminId = #{adminId}, + moduleId = #{moduleId}, + localAction=#{localAction}, + remark1=#{remark1}, + remark2=#{remark2}, + remark3=#{remark3}, + printType=#{printType}, + + WHERE id = #{id} + + + delete + from sys_pdf_template_relevance + where id = #{id} + + + \ No newline at end of file