Merge remote-tracking branch 'origin/master'
commit
023651133f
@ -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<SystemPDFModuleEntity> systemPDFModuleEntityList = systemPDFModuleService.queryPage(systemPDFModuleRequest);
|
||||||
|
List<SystemPDFModuleResponse> 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<SystemPDFModuleEntity> pageInfo = new PageInfo<>(systemPDFModuleEntityList);
|
||||||
|
PageSimpleResponse<SystemPDFModuleResponse> 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<BussinessLocalTypeEntity> bussinessLocalTypeEntities = bussinessLocalTypeService.filterJoin(bussinessLocalTypeFilterRequest);
|
||||||
|
// for (BussinessLocalTypeEntity bussinessLocalTypeEntity : bussinessLocalTypeEntities) {
|
||||||
|
// SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity = new SystemPDFTemplateRelevanceEntity();
|
||||||
|
// systemPDFTemplateRelevanceEntity.setLocalAction(bussinessLocalTypeEntity.getLocalAction());
|
||||||
|
// systemPDFTemplateRelevanceEntity.setModuleId(systemPDFModuleRequest.getModuleId());
|
||||||
|
// systemPDFTemplateRelevanceService.insert(systemPDFTemplateRelevanceEntity);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<SystemPDFTemplateRelevanceResponse> systemPDFTemplateRelevanceEntityList =
|
||||||
|
// systemPDFTemplateRelevanceService.filterList(systemPDFModuleRequest);
|
||||||
|
// PageInfo<SystemPDFTemplateRelevanceResponse> pageInfo = new PageInfo<>(systemPDFTemplateRelevanceEntityList);
|
||||||
|
// PageSimpleResponse<SystemPDFTemplateRelevanceResponse> 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<SystemPDFModuleEntity> systemPDFModuleEntityList = systemPDFModuleService.listPDFModules(page, limit);
|
||||||
|
PageInfo<SystemPDFModuleEntity> pageInfo = new PageInfo<>(systemPDFModuleEntityList);
|
||||||
|
PageSimpleResponse<SystemPDFModuleSelectResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
List<SystemPDFModuleSelectResponse> 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, "删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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<SystemPDFTemplateEntity> systemPDFTemplateEntityList = systemPDFTemplateService.queryPage(systemPDFTemplateRequest);
|
||||||
|
List<SystemPDFTemplateResponse> systemPDFTemplateResponseList = systemPDFTemplateEntityList.stream().map(item -> {
|
||||||
|
SystemPDFTemplateResponse systemPDFTemplateResponse = new SystemPDFTemplateResponse();
|
||||||
|
BeanUtils.copyProperties(item, systemPDFTemplateResponse);
|
||||||
|
return systemPDFTemplateResponse;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
PageInfo<SystemPDFTemplateEntity> pageInfo = new PageInfo<>(systemPDFTemplateEntityList);
|
||||||
|
PageSimpleResponse<SystemPDFTemplateResponse> 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<SystemPDFTemplateEntity> systemPDFTemplateEntityList = systemPDFTemplateService.listPDFTemplates(page, limit);
|
||||||
|
PageInfo<SystemPDFTemplateEntity> pageInfo = new PageInfo<>(systemPDFTemplateEntityList);
|
||||||
|
PageSimpleResponse<SystemPDFTemplateSelectResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
List<SystemPDFTemplateSelectResponse> 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, "删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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<SystemPDFModuleEntity> queryPage(SystemPDFModuleRequest systemPDFModuleRequest);
|
||||||
|
|
||||||
|
List<SystemPDFModuleEntity> listPDFModules();
|
||||||
|
|
||||||
|
SystemPDFModuleEntity findSystemPDFModule(SystemPDFModuleRequest systemPDFModuleRequest);
|
||||||
|
|
||||||
|
SystemPDFModuleEntity selectById(String id);
|
||||||
|
|
||||||
|
boolean updateById(SystemPDFModuleSaveRequest systemPDFModuleSaveRequest);
|
||||||
|
|
||||||
|
boolean insert(SystemPDFModuleEntity systemPDFModuleEntity);
|
||||||
|
|
||||||
|
boolean deleteById(Integer id);
|
||||||
|
}
|
@ -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<SystemPDFTemplateEntity> queryPage(SystemPDFTemplateRequest systemPDFTemplateRequest);
|
||||||
|
|
||||||
|
List<SystemPDFTemplateEntity> listPDFTemplates();
|
||||||
|
|
||||||
|
SystemPDFTemplateEntity findSystemPDFTemplate(SystemPDFTemplateRequest systemPDFTemplateRequest);
|
||||||
|
|
||||||
|
SystemPDFTemplateEntity selectById(String id);
|
||||||
|
|
||||||
|
boolean updateById(SystemPDFTemplateSaveRequest systemPDFTemplateSaveRequest);
|
||||||
|
|
||||||
|
boolean insert(SystemPDFTemplateEntity systemPDFTemplateEntity);
|
||||||
|
|
||||||
|
boolean deleteById(Integer id);
|
||||||
|
}
|
@ -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<SystemPDFTemplateRelevanceResponse> filterList(SystemPDFTemplateRelevanceRequest systemPDFModuleRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 customerId 查询
|
||||||
|
*
|
||||||
|
* @param customerId 传入的 customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByCustomerId(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 多个 customerId 查询
|
||||||
|
*
|
||||||
|
* @param customerIds 传入的 customerIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByCustomerIdIn(List<Long> customerIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 template_id 查询 customer_id
|
||||||
|
*
|
||||||
|
* @param templateId 传入的 templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByTemplateId(int templateId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param systemPDFTemplateRelevanceEntityList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertSystemPDFTemplateRelevanceAll(List<SystemPDFTemplateRelevanceEntity> systemPDFTemplateRelevanceEntityList);
|
||||||
|
|
||||||
|
boolean insert(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 customerId 删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean deleteById(Integer id);
|
||||||
|
|
||||||
|
boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity);
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -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<SystemPDFModuleEntity> queryPage(SystemPDFModuleRequest systemPDFModuleRequest);
|
||||||
|
|
||||||
|
List<SystemPDFModuleEntity> 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);
|
||||||
|
}
|
@ -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<SystemPDFTemplateRelevanceResponse> filterList(SystemPDFTemplateRelevanceRequest systemPDFModuleRequest);
|
||||||
|
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByCustomerId(Long customerId);
|
||||||
|
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByCustomerIdIn(List<Long> customerIds);
|
||||||
|
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> listByTemplateId(int templateId);
|
||||||
|
|
||||||
|
int insertSystemPDFTemplateRelevanceAll(List<SystemPDFTemplateRelevanceEntity> systemPDFTemplateRelevanceEntityList);
|
||||||
|
|
||||||
|
boolean insert(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity);
|
||||||
|
|
||||||
|
int insertRolesCustomerIdAll(List<Integer> templates, Long customerId);
|
||||||
|
|
||||||
|
boolean deleteByCustomerId(Integer customerId);
|
||||||
|
|
||||||
|
boolean udpateRl(SystemPDFTemplateRelevanceEntity systemPDFTemplateRelevanceEntity);
|
||||||
|
|
||||||
|
}
|
@ -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<SystemPDFTemplateEntity> queryPage(SystemPDFTemplateRequest systemPDFTemplateRequest);
|
||||||
|
|
||||||
|
List<SystemPDFTemplateEntity> 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);
|
||||||
|
}
|
@ -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<SystemPDFModuleEntity> queryPage(SystemPDFModuleRequest SystemPDFModuleRequest) {
|
||||||
|
int offset = (SystemPDFModuleRequest.getPage() - 1) * SystemPDFModuleRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, SystemPDFModuleRequest.getLimit());
|
||||||
|
List<SystemPDFModuleEntity> list = systemPDFModuleDao.queryPage(SystemPDFModuleRequest);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SystemPDFModuleEntity> 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<SystemPDFModuleEntity> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -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<SystemPDFTemplateRelevanceResponse> 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<SystemPDFTemplateRelevanceEntity> listByCustomerId(Long customerId) {
|
||||||
|
return systemPDFTemplateRelevanceDao.listByCustomerId(customerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据多个 customerId 查询角色列表
|
||||||
|
*
|
||||||
|
* @param customerIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SystemPDFTemplateRelevanceEntity> listByCustomerIdIn(List<Long> customerIds) {
|
||||||
|
if (customerIds.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
return systemPDFTemplateRelevanceDao.listByCustomerIdIn(customerIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 roleId 获取 customerId
|
||||||
|
*
|
||||||
|
* @param templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SystemPDFTemplateRelevanceEntity> listByTemplateId(int templateId) {
|
||||||
|
return systemPDFTemplateRelevanceDao.listByTemplateId(templateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入
|
||||||
|
*
|
||||||
|
* @param systemPDFTemplateRelevanceEntityList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSystemPDFTemplateRelevanceAll(List<SystemPDFTemplateRelevanceEntity> 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<Integer> templates, Long customerId) {
|
||||||
|
|
||||||
|
List<SystemPDFTemplateRelevanceEntity> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -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<SystemPDFTemplateEntity> queryPage(SystemPDFTemplateRequest SystemPDFTemplateRequest) {
|
||||||
|
int offset = (SystemPDFTemplateRequest.getPage() - 1) * SystemPDFTemplateRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, SystemPDFTemplateRequest.getLimit());
|
||||||
|
List<SystemPDFTemplateEntity> list = systemPDFTemplateDao.queryPage(SystemPDFTemplateRequest);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SystemPDFTemplateEntity> 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<SystemPDFTemplateEntity> 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);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
|
||||||
|
<mapper namespace="com.glxp.api.dao.system.SystemPDFModuleDao">
|
||||||
|
|
||||||
|
<select id="queryPage" parameterType="com.glxp.api.req.system.SystemPDFModuleRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
SELECT id,name,param,fieldExplain,remark,templateId,create_time,update_time,templateDlUrl,templateType
|
||||||
|
,remark1,remark2,remark3
|
||||||
|
FROM sys_pdf_module
|
||||||
|
<where>
|
||||||
|
<if test="templateId != null and '' != templateId">
|
||||||
|
AND `templateId` LIKE CONCAT(#{templateId},'%')
|
||||||
|
</if>
|
||||||
|
<if test="name != null and '' != name">
|
||||||
|
AND `name` LIKE CONCAT('%',#{name},'%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findSystemPDFModule" parameterType="com.glxp.api.req.system.SystemPDFModuleRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_pdf_module
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="java.lang.String"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
select *
|
||||||
|
FROM sys_pdf_module
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateById" parameterType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
UPDATE sys_pdf_module
|
||||||
|
<set>
|
||||||
|
<if test="name != null">name=#{name},</if>
|
||||||
|
<if test="param != null">param=#{param},</if>
|
||||||
|
<if test="fieldExplain != null">fieldExplain=#{fieldExplain},</if>
|
||||||
|
<if test="remark != null">remark=#{remark},</if>
|
||||||
|
<if test="templateId != null">templateId=#{templateId},</if>
|
||||||
|
<if test="create_time != null">create_time=#{create_time},</if>
|
||||||
|
<if test="update_time != null">update_time=#{update_time},</if>
|
||||||
|
<if test="templateDlUrl != null">templateDlUrl=#{templateDlUrl},</if>
|
||||||
|
<if test="templateType != null">templateType=#{templateType},</if>
|
||||||
|
<if test="remark1 != null">remark1=#{remark1},</if>
|
||||||
|
<if test="remark2 != null">remark2=#{remark2},</if>
|
||||||
|
<if test="remark3 != null">remark3=#{remark3},</if>
|
||||||
|
|
||||||
|
|
||||||
|
</set>
|
||||||
|
WHERE id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
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})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="listPDFModules" parameterType="java.lang.Integer"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFModuleEntity">
|
||||||
|
SELECT id, name
|
||||||
|
FROM sys_pdf_module
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
||||||
|
delete
|
||||||
|
from sys_pdf_module
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
|
||||||
|
<mapper namespace="com.glxp.api.dao.system.SystemPDFTemplateDao">
|
||||||
|
|
||||||
|
<select id="queryPage" parameterType="com.glxp.api.req.system.SystemPDFTemplateRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
SELECT id,name,type,module,param,path,rowCount,qrcodeCount,remark,create_time,update_time,jrxmlPath
|
||||||
|
FROM sys_pdf_template
|
||||||
|
<where>
|
||||||
|
<if test="name != null and '' != name">
|
||||||
|
AND `name` LIKE CONCAT('%',#{name},'%')
|
||||||
|
</if>
|
||||||
|
<if test="module != null ">
|
||||||
|
AND `module` = #{module}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by update_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findSystemPDFTemplate" parameterType="com.glxp.api.req.system.SystemPDFTemplateRequest"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_pdf_template
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="java.lang.String"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
select *
|
||||||
|
FROM sys_pdf_template
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateById" parameterType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
UPDATE sys_pdf_template
|
||||||
|
<set>
|
||||||
|
<if test="name != null">name=#{name},</if>
|
||||||
|
<if test="type != null">type=#{type},</if>
|
||||||
|
<if test="module != null">module=#{module},</if>
|
||||||
|
<if test="param != null">param=#{param},</if>
|
||||||
|
<if test="path != null">path=#{path},</if>
|
||||||
|
<if test="rowCount != null">rowCount=#{rowCount},</if>
|
||||||
|
<if test="qrcodeCount != null">qrcodeCount=#{qrcodeCount},</if>
|
||||||
|
<if test="remark != null">remark=#{remark},</if>
|
||||||
|
<if test="create_time != null">create_time=#{create_time},</if>
|
||||||
|
<if test="update_time != null">update_time=#{update_time},</if>
|
||||||
|
<if test="jrxmlPath != null">jrxmlPath=#{jrxmlPath},</if>
|
||||||
|
|
||||||
|
</set>
|
||||||
|
WHERE id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
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})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="listPDFTemplates" parameterType="java.lang.Integer"
|
||||||
|
resultType="com.glxp.api.entity.system.SystemPDFTemplateEntity">
|
||||||
|
SELECT id, name
|
||||||
|
FROM sys_pdf_template
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
||||||
|
delete
|
||||||
|
from sys_pdf_template
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
|
||||||
|
<mapper namespace="com.glxp.api.dao.system.SystemPDFTemplateRelevanceDao">
|
||||||
|
|
||||||
|
<select id="listByCustomerId" resultType="com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity">
|
||||||
|
SELECT templateId
|
||||||
|
FROM sys_pdf_template_relevance
|
||||||
|
where customerId = #{customerId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="filterList" parameterType="com.glxp.api.req.system.SystemPDFTemplateRelevanceRequest"
|
||||||
|
resultType="com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse">
|
||||||
|
select basic_bustype_local.`name` localActionName,sys_pdf_template_relevance.id,
|
||||||
|
basic_bustype_local.action localAction,
|
||||||
|
templateId,
|
||||||
|
moduleId,
|
||||||
|
system_pdf_template.name
|
||||||
|
templateName,sys_pdf_template_relevance.remark1,sys_pdf_template_relevance.remark2,sys_pdf_template_relevance.remark3,
|
||||||
|
printType
|
||||||
|
from basic_bustype_local
|
||||||
|
LEFT JOIN sys_pdf_template_relevance
|
||||||
|
on basic_bustype_local.action = sys_pdf_template_relevance.localAction
|
||||||
|
LEFT JOIN system_pdf_template
|
||||||
|
on sys_pdf_template_relevance.templateId = system_pdf_template.id
|
||||||
|
inner join basic_bussiness_type
|
||||||
|
on basic_bustype_local.action = basic_bussiness_type.localAction
|
||||||
|
<where>
|
||||||
|
<if test="moduleId != null ">
|
||||||
|
AND `moduleId` = #{moduleId}
|
||||||
|
</if>
|
||||||
|
<if test="localAction != null ">
|
||||||
|
AND sys_pdf_template_relevance.`localAction` = #{localAction}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by basic_bustype_local.action
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listByCustomerIdIn" resultType="com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity">
|
||||||
|
SELECT *
|
||||||
|
FROM sys_pdf_template_relevance
|
||||||
|
where customerId in
|
||||||
|
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listByTemplateId" resultType="com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity">
|
||||||
|
SELECT customerId
|
||||||
|
FROM sys_pdf_template_relevance
|
||||||
|
where templateId = #{templateId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSystemPDFTemplateRelevanceAll">
|
||||||
|
INSERT INTO sys_pdf_template_relevance
|
||||||
|
(templateId, customerId)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
<if test="item.templateId != null and item.customerId != null">
|
||||||
|
(#{item.templateId}, #{item.customerId})
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity">
|
||||||
|
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}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<update id="udpateRl" parameterType="com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity">
|
||||||
|
UPDATE sys_pdf_template_relevance
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="templateId != null">templateId = #{templateId},</if>
|
||||||
|
<if test="customerId != null">customerId = #{customerId},</if>
|
||||||
|
<if test="adminId != null">adminId = #{adminId},</if>
|
||||||
|
<if test="moduleId != null">moduleId = #{moduleId},</if>
|
||||||
|
<if test="localAction != null">localAction=#{localAction},</if>
|
||||||
|
<if test="remark1 != null">remark1=#{remark1},</if>
|
||||||
|
<if test="remark2 != null">remark2=#{remark2},</if>
|
||||||
|
<if test="remark3 != null">remark3=#{remark3},</if>
|
||||||
|
<if test="printType != null">printType=#{printType},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
<delete id="deleteById" parameterType="java.lang.Integer">
|
||||||
|
delete
|
||||||
|
from sys_pdf_template_relevance
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue