50 changed files with 1676 additions and 203 deletions
@ -0,0 +1,77 @@ |
|||
package org.jeecg.modules.huzhou.common; |
|||
|
|||
import com.alibaba.excel.EasyExcel; |
|||
import com.alibaba.excel.ExcelWriter; |
|||
import com.alibaba.excel.support.ExcelTypeEnum; |
|||
import com.alibaba.excel.write.metadata.WriteSheet; |
|||
import com.alibaba.excel.write.metadata.fill.FillWrapper; |
|||
import org.apache.poi.ss.formula.functions.T; |
|||
import org.apache.poi.ss.usermodel.Workbook; |
|||
import org.springframework.core.io.ClassPathResource; |
|||
|
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.io.OutputStream; |
|||
import java.net.URLEncoder; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 根据Excel模板导出可以采用该工具类 |
|||
*/ |
|||
public class TemplateExcelUtils { |
|||
/** |
|||
* 根据模板导出数据 |
|||
* @param fileName |
|||
* @param sourcePath resource/template文件夹下路径 |
|||
* @param list |
|||
* @param response |
|||
* @throws Exception |
|||
*/ |
|||
public static void downLoadExcel(String fileName, String sourcePath, List list, HttpServletResponse response) |
|||
throws Exception { |
|||
try{ |
|||
OutputStream os = getOutputStream(fileName,response); |
|||
//读取模板
|
|||
String path = "excelTemplate"+File.separator+sourcePath; |
|||
ClassPathResource classPathResource = new ClassPathResource(path); |
|||
InputStream is =classPathResource.getInputStream(); |
|||
ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName, response)).withTemplate(is).excelType(ExcelTypeEnum.XLSX).build(); |
|||
WriteSheet writeSheet = EasyExcel.writerSheet().build(); |
|||
// 这个 data 是官方约定就这么写, 传进去的 list 就是要遍历的表格数据,详见我定义的模板中图片位置右侧那部分
|
|||
excelWriter.fill(new FillWrapper("list", list), writeSheet); |
|||
excelWriter.finish(); |
|||
//向模板中写入内容
|
|||
//写入成功后转化为输出流
|
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
throw e; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 导出文件时为Writer生成OutputStream. |
|||
* @param fileName 文件名 |
|||
* @param response response |
|||
* @return "" |
|||
*/ |
|||
private static OutputStream getOutputStream(String fileName, |
|||
HttpServletResponse response) throws Exception { |
|||
try { |
|||
fileName = URLEncoder.encode(fileName, "UTF-8"); |
|||
response.setContentType("application/vnd.ms-excel"); |
|||
response.setCharacterEncoding("utf8"); |
|||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ".xlsx"); |
|||
response.setHeader("Pragma", "public"); |
|||
response.setHeader("Cache-Control", "no-store"); |
|||
response.addHeader("Cache-Control", "max-age=0"); |
|||
return response.getOutputStream(); |
|||
} catch (IOException e) { |
|||
throw new Exception("导出excel表格失败!", e); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package org.jeecg.modules.huzhou.controller; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouContractinfoService; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@RequestMapping("/huzhouContractinfo") |
|||
public class HuzhouContractinfoController { |
|||
@Autowired |
|||
private IHuzhouContractinfoService contractinfoService; |
|||
@GetMapping("/huzhouContractinfoPageList") |
|||
public Result<?> huzhouContractinfoPageList(HuzhouContractinfoOV contractinfo, |
|||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ |
|||
Page<HuzhouContractinfoOV> pageList = contractinfoService.getContractinfoPageList(contractinfo, pageNo, pageSize); |
|||
return Result.ok(pageList); |
|||
} |
|||
@GetMapping("/getContractinfoById") |
|||
public Result<?> getContractinfoById(String id){ |
|||
HuzhouContractinfo byId = contractinfoService.getById(id); |
|||
return Result.ok(byId); |
|||
} @GetMapping("/getContractinfoListById") |
|||
public Result<?> getContractinfoListById(String id){ |
|||
HuzhouContractinfo byId = contractinfoService.getById(id); |
|||
List<HuzhouContractinfo> list = new ArrayList<>(); |
|||
list.add(byId); |
|||
return Result.ok(list); |
|||
} |
|||
@GetMapping("/isExistContractinfo") |
|||
public Result<?> isExistContractinfo(String projectid){ |
|||
List<HuzhouContractinfo> list = contractinfoService.getContractinfoByprojectId(projectid); |
|||
if(list.size()>0){ |
|||
return Result.OK(true); |
|||
} |
|||
return Result.ok(false); |
|||
} |
|||
@PostMapping("/addContractinfo") |
|||
public Result<?> addContractinfo(@RequestParam(value = "file") MultipartFile file, HuzhouContractinfo contractinfo) throws IOException { |
|||
contractinfoService.addContractinfo(file,contractinfo); |
|||
return Result.ok("上传成功"); |
|||
} |
|||
@PostMapping("/modifyContractinfo") |
|||
public Result<?> modifyContractinfo(@RequestParam(value = "file",required = false) MultipartFile file, HuzhouContractinfo contractinfo) throws IOException { |
|||
Boolean aBoolean = contractinfoService.modifyContractinfo(file, contractinfo); |
|||
if(aBoolean){ |
|||
return Result.ok("修改成功"); |
|||
} |
|||
return Result.error("修改失败"); |
|||
} |
|||
@PostMapping("/deleteContractinfo") |
|||
public Result<?> deleteContractinfo(@RequestBody HuzhouContractinfo contractinfo) throws IOException { |
|||
Boolean aBoolean = contractinfoService.deleteContractinfo(contractinfo); |
|||
if(aBoolean){ |
|||
return Result.ok("删除成功"); |
|||
} |
|||
return Result.error("删除失败"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,152 @@ |
|||
package org.jeecg.modules.huzhou.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.shiro.SecurityUtils; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.common.system.vo.LoginUser; |
|||
import org.jeecg.modules.huzhou.entity.*; |
|||
import org.jeecg.modules.huzhou.service.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@RequestMapping("/huzhouPlaninfofile") |
|||
public class HuzhouPlaninfofileController { |
|||
@Autowired |
|||
private IHuzhouPlaninfofileService planinfofileService; |
|||
@Autowired |
|||
private IHuzhouPlaninfoService planinfoService; |
|||
@Autowired |
|||
private IWorkflowService workflowService; |
|||
@Autowired |
|||
private IHuzhouProcessinfoService processinfoService; |
|||
@Autowired |
|||
private IHuzhouProjectinfoService projectinfoService; |
|||
@PostMapping("/planUploadFile") |
|||
@Transactional() |
|||
public Result<?> planUploadFile(@RequestParam(value = "file") |
|||
MultipartFile[] files, @RequestParam(value = "planinfoid") String planinfoid) throws IOException { |
|||
//检查是否可提交
|
|||
HuzhouPlaninfo planinfo = planinfoService.getById(planinfoid); |
|||
String taskLevel = planinfo.getTaskLevel(); |
|||
List<HuzhouPlaninfo> childPlanList = planinfoService.queryChildPlan(planinfo.getProjectId(), planinfo.getTaskLevel(),"0,1"); |
|||
if(childPlanList.size()>0){ |
|||
return Result.error("存在未完成(审批中)的子项。当前阶段不允许提交文件"); |
|||
} |
|||
//获取当前时间
|
|||
planinfoService.saveOrModifyPlanUploadFile(files,planinfoid,"1"); |
|||
ArrayList<String> arrayList = new ArrayList<>(); |
|||
//设置下一个节点处理人
|
|||
//使用角色查询
|
|||
arrayList.add("1752893978598207490"); |
|||
WorkFlow workFlow = workflowService.createFlow("项目资料审批流程", arrayList); |
|||
String businessKey = workFlow.getBusinessKey(); |
|||
String processInstanceId = workFlow.getProcessInstanceId(); |
|||
HuzhouProcessinfo huzhouProcessinfo = new HuzhouProcessinfo(); |
|||
huzhouProcessinfo.setBusinesskey(businessKey); |
|||
huzhouProcessinfo.setStage("4");//项目资料审批
|
|||
huzhouProcessinfo.setProcessstatus("1"); |
|||
huzhouProcessinfo.setProcessinstanceid(processInstanceId); |
|||
huzhouProcessinfo.setProjectid(planinfoid); |
|||
processinfoService.save(huzhouProcessinfo); |
|||
return Result.OK("上传成功!!"); |
|||
} |
|||
@PostMapping("/planUploadModifyFile") |
|||
@Transactional() |
|||
public Result<?> planUploadModifyFile(@RequestParam(value = "file") |
|||
MultipartFile[] files,@RequestParam(value = "planinfoid") String planinfoid) throws IOException { |
|||
HuzhouPlaninfo planinfo = planinfoService.getById(planinfoid); |
|||
|
|||
|
|||
ArrayList<String> arrayList = new ArrayList<>(); |
|||
//设置下一个节点处理人
|
|||
//使用角色查询
|
|||
arrayList.add("1752893978598207490"); |
|||
WorkFlow workFlow = workflowService.createFlow("项目资料审批流程", arrayList); |
|||
String businessKey = workFlow.getBusinessKey(); |
|||
String processInstanceId = workFlow.getProcessInstanceId(); |
|||
HuzhouProcessinfo huzhouProcessinfo = new HuzhouProcessinfo(); |
|||
huzhouProcessinfo.setBusinesskey(businessKey); |
|||
huzhouProcessinfo.setStage("4");//项目资料审批
|
|||
huzhouProcessinfo.setProcessstatus("1"); |
|||
huzhouProcessinfo.setProcessinstanceid(processInstanceId); |
|||
huzhouProcessinfo.setProjectid(planinfoid); |
|||
processinfoService.save(huzhouProcessinfo); |
|||
planinfoService.saveOrModifyPlanUploadFile(files,planinfoid,"2"); |
|||
//修改项目状态
|
|||
projectinfoService.modifyStageById(planinfo.getProjectId(),"5"); |
|||
return Result.ok("修改成功"); |
|||
} |
|||
@GetMapping("/queryPlaninfoFilePageByid") |
|||
public Result<?> queryPlaninfoFilePageByid(String planinfoid,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ |
|||
LambdaQueryWrapper<HuzhouPlaninfofile> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|||
lambdaQueryWrapper.eq(HuzhouPlaninfofile::getPlaninfoid,planinfoid); |
|||
lambdaQueryWrapper.orderByDesc(BaseEntity::getCreatetime); |
|||
Page<HuzhouPlaninfofile> page = new Page<>(pageNo, pageSize); |
|||
Page<HuzhouPlaninfofile> planinfofilePage = planinfofileService.page(page, lambdaQueryWrapper); |
|||
return Result.ok(planinfofilePage); |
|||
} |
|||
@GetMapping("/planFilePageList") |
|||
public Result<?> planFilePageList(HuzhouPlaninfofile planinfofile,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ |
|||
Page<HuzhouPlaninfofile> planinfofilePage = planinfofileService.getplanFilePageList(planinfofile,pageNo,pageSize); |
|||
return Result.ok(planinfofilePage); |
|||
} |
|||
@PostMapping("/approvePlanFile") |
|||
public Result<?> approvePlanFile(@RequestParam(value = "file",required = false) MultipartFile[] files, |
|||
@RequestParam String taskId, |
|||
@RequestParam String flag, |
|||
@RequestParam String planinfoid, |
|||
@RequestParam String comment, |
|||
@RequestParam String stage) throws Exception { |
|||
WorkFlow workFlow = workflowService.approveProjectInfo(taskId, flag, comment, stage); |
|||
String userTaskName = workFlow.getUserTask(); |
|||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|||
if(files!=null&&"1".equals(flag)){ |
|||
planinfoService.saveOrModifyPlanUploadFile(files,planinfoid,"2"); |
|||
} |
|||
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo(); |
|||
huzhouPlaninfo.setId(planinfoid); |
|||
|
|||
if("3".equals(flag)){ |
|||
huzhouPlaninfo.setIsfinish("0"); |
|||
planinfoService.updateById(huzhouPlaninfo); |
|||
planinfofileService.modifyStatusByPlaninfoid("0",planinfoid); |
|||
processinfoService.modifyStatusByProjectId(planinfoid,"0","4"); |
|||
return Result.ok("作废成功!"); |
|||
} |
|||
if("管理人员".equals(userTaskName)&&"1".equals(flag)){ |
|||
huzhouPlaninfo.setIsfinish("2"); |
|||
planinfoService.updateById(huzhouPlaninfo); |
|||
processinfoService.modifyStatusByProjectId(planinfoid,"2","4"); |
|||
HuzhouPlaninfo planinfo = planinfoService.getById(planinfoid); |
|||
String projectId = planinfo.getProjectId(); |
|||
HuzhouPlaninfo nodePlan = planinfoService.getNodePlan(projectId, planinfo.getTaskLevel()); |
|||
//如果文件为空,检查子项是否全部完成,若以完成则为完成
|
|||
if(nodePlan.getTaskFile()==null){ |
|||
List<HuzhouPlaninfo> unfinishChildPlan = planinfoService.queryChildPlan(projectId, nodePlan.getTaskLevel(), "0,1"); |
|||
if(unfinishChildPlan.size()==0){ |
|||
HuzhouPlaninfo nodePlaninfo = new HuzhouPlaninfo(); |
|||
nodePlaninfo.setIsfinish("2"); |
|||
nodePlaninfo.setId(nodePlan.getId()); |
|||
planinfoService.updateById(nodePlaninfo); |
|||
} |
|||
} |
|||
|
|||
List<HuzhouPlaninfo> list = planinfoService.getUnFinishListByProjectId(projectId); |
|||
if(list.size()==0){ |
|||
projectinfoService.modifyStageById(projectId,"6"); |
|||
} |
|||
} |
|||
return Result.ok("审批成功"); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
package org.jeecg.modules.huzhou.controller; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouRegulationlabService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
|
|||
@RestController |
|||
@RequestMapping("/huzhouRegulationlab") |
|||
public class HuzhouRegulationlabController { |
|||
@Autowired |
|||
private IHuzhouRegulationlabService regulationlabService; |
|||
@GetMapping("/regulationlabPageList") |
|||
public Result<?> regulationlabPageList(HuzhouRegulationlab regulationlab, |
|||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ |
|||
|
|||
Page<HuzhouRegulationlab> pageList = regulationlabService.getRegulationlabPageList(regulationlab, pageNo, pageSize); |
|||
return Result.ok(pageList); |
|||
} |
|||
@GetMapping("/getregulationlabById") |
|||
public Result<?> getregulationlabById(String id){ |
|||
HuzhouRegulationlab byId = regulationlabService.getById(id); |
|||
return Result.ok(byId); |
|||
} |
|||
@PostMapping("/addRegulationlab") |
|||
public Result<?> addRegulationlab(@RequestParam(value = "file") MultipartFile file, HuzhouRegulationlab regulationlab) throws IOException { |
|||
regulationlabService.addRegulationlab(file,regulationlab); |
|||
return Result.ok("上传成功"); |
|||
} |
|||
@PostMapping("/modifyRegulationlab") |
|||
public Result<?> modifyRegulationlab(@RequestParam(value = "file",required = false) MultipartFile file, HuzhouRegulationlab regulationlab) throws IOException { |
|||
Boolean aBoolean = regulationlabService.modifyRegulationlab(file, regulationlab); |
|||
if(aBoolean){ |
|||
return Result.ok("修改成功"); |
|||
} |
|||
return Result.error("修改失败"); |
|||
} |
|||
@PostMapping("/deleteRegulationlab") |
|||
public Result<?> deleteRegulationlab(@RequestBody HuzhouRegulationlab regulationlab) throws IOException { |
|||
Boolean aBoolean = regulationlabService.deleteRegulationlab(regulationlab); |
|||
if(aBoolean){ |
|||
return Result.ok("删除成功"); |
|||
} |
|||
return Result.error("删除失败"); |
|||
} |
|||
@GetMapping("/batchdownloadRegulationlabFiles") |
|||
public void batchdownloadRegulationlabFiles(HuzhouRegulationlab regulationlab, HttpServletResponse response){ |
|||
regulationlabService.batchdownloadRegulationlabFiles(regulationlab,response); |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
package org.jeecg.modules.huzhou.controller; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouWorkreportService; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
|
|||
|
|||
@RestController |
|||
@RequestMapping("/huzhouWorkreport") |
|||
public class HuzhouWorkreportController { |
|||
@Autowired |
|||
private IHuzhouWorkreportService workreportService; |
|||
@GetMapping("/workreportPageList") |
|||
public Result<?> workreportPageList(HuzhouWorkreportOV workreportOV,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize){ |
|||
Page<HuzhouWorkreportOV> pageList = workreportService.getWorkreportPageList(workreportOV, pageNo, pageSize); |
|||
return Result.ok(pageList); |
|||
} |
|||
@GetMapping("/getWorkreportById") |
|||
public Result<?> getWorkreportById(String id){ |
|||
HuzhouWorkreport byId = workreportService.getById(id); |
|||
return Result.ok(byId); |
|||
} |
|||
@PostMapping("/addWorkreport") |
|||
public Result<?> addWorkreport(@RequestParam(value = "file") MultipartFile file, HuzhouWorkreport workreport) throws IOException { |
|||
workreportService.addWorkreport(file,workreport); |
|||
return Result.ok("上传成功"); |
|||
} |
|||
@PostMapping("/modifyWorkreport") |
|||
public Result<?> modifyContractinfo(@RequestParam(value = "file",required = false) MultipartFile file, HuzhouWorkreport workreport) throws IOException { |
|||
Boolean aBoolean = workreportService.modifyWorkreport(file, workreport); |
|||
if(aBoolean){ |
|||
return Result.ok("修改成功"); |
|||
} |
|||
return Result.error("修改失败"); |
|||
} |
|||
@PostMapping("/deleteWorkreport") |
|||
public Result<?> deleteContractinfo(@RequestBody HuzhouWorkreport workreport) throws IOException { |
|||
Boolean aBoolean = workreportService.deleteWorkreport(workreport); |
|||
if(aBoolean){ |
|||
return Result.ok("删除成功"); |
|||
} |
|||
return Result.error("删除失败"); |
|||
} |
|||
} |
@ -0,0 +1,89 @@ |
|||
package org.jeecg.modules.huzhou.entity; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.util.Date; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* (HuzhouContractinfo)实体类 |
|||
* |
|||
* @author makejava |
|||
* @since 2024-03-01 10:09:24 |
|||
*/ |
|||
@Data |
|||
public class HuzhouContractinfo extends BaseEntity implements Serializable { |
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 项目id |
|||
*/ |
|||
private String projectid; |
|||
/** |
|||
* 首发时间 |
|||
*/ |
|||
@JsonFormat(pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date downpaymentDate; |
|||
/** |
|||
* 首付比例 |
|||
*/ |
|||
private String downpaymentRatio; |
|||
/** |
|||
* 初验时间 |
|||
*/ |
|||
@JsonFormat(pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date initialDate; |
|||
/** |
|||
* 初验比例 |
|||
*/ |
|||
private String initialRatio; |
|||
/** |
|||
* 终验时间 |
|||
*/ |
|||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
|
|||
private Date finalDate; |
|||
/** |
|||
* 终验比例 |
|||
*/ |
|||
private String finalRatio; |
|||
/** |
|||
* 合同总金额 |
|||
*/ |
|||
private Double totalAmount; |
|||
/** |
|||
* 合同文件名称 |
|||
*/ |
|||
private String documentName; |
|||
/** |
|||
* 合同文件类型 |
|||
*/ |
|||
private String documentType; |
|||
/** |
|||
* 合同文件位置 |
|||
*/ |
|||
private String documentPath; |
|||
/** |
|||
* 文件尺寸 |
|||
*/ |
|||
private Long size; |
|||
/** |
|||
* 文件状态 |
|||
*/ |
|||
private String status; |
|||
|
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,53 @@ |
|||
package org.jeecg.modules.huzhou.entity; |
|||
|
|||
import com.fasterxml.jackson.databind.ser.Serializers; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* (HuzhouRegulationlab)实体类 |
|||
* |
|||
* @author makejava |
|||
* @since 2024-02-29 11:03:40 |
|||
*/ |
|||
@Data |
|||
public class HuzhouRegulationlab extends BaseEntity implements Serializable { |
|||
private static final long serialVersionUID = -50005828024123796L; |
|||
/** |
|||
* 法规资料名称 |
|||
*/ |
|||
private String regulationlabName; |
|||
/** |
|||
* 法规资料描述 |
|||
*/ |
|||
private String regulationlabDescribe; |
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 文件名称 |
|||
*/ |
|||
private String documentName; |
|||
/** |
|||
* 文件类型 |
|||
*/ |
|||
private String documentType; |
|||
/** |
|||
* 文件位置 |
|||
*/ |
|||
private String documentPath; |
|||
/** |
|||
* 文件尺寸 |
|||
*/ |
|||
private Long size; |
|||
/** |
|||
* 文件状态 |
|||
*/ |
|||
private String status; |
|||
|
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,70 @@ |
|||
package org.jeecg.modules.huzhou.entity; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.util.Date; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* (HuzhouWorkreport)实体类 |
|||
* |
|||
* @author makejava |
|||
* @since 2024-03-01 15:58:21 |
|||
*/ |
|||
@Data |
|||
public class HuzhouWorkreport extends BaseEntity implements Serializable { |
|||
private static final long serialVersionUID = -21931703968060883L; |
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date startDate; |
|||
/** |
|||
* 结束时间 |
|||
*/ |
|||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
private Date endDate; |
|||
/** |
|||
* 类型 1周报,2月报 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 文件名称 |
|||
*/ |
|||
private String documentName; |
|||
/** |
|||
* 文件类型 |
|||
*/ |
|||
private String documentType; |
|||
/** |
|||
* 文件地址 |
|||
*/ |
|||
private String documentPath; |
|||
/** |
|||
* 文件大小 |
|||
*/ |
|||
private Long size; |
|||
/** |
|||
* 是否有效 |
|||
*/ |
|||
private String status; |
|||
/** |
|||
* 项目id |
|||
*/ |
|||
private String projectid; |
|||
|
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package org.jeecg.modules.huzhou.entity; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
@Data |
|||
|
|||
public class WorkflowBaseInfo { |
|||
private String projectName; |
|||
private String taskName; |
|||
private String taskId; |
|||
private String projectId; |
|||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") |
|||
@JSONField(format="yyyy-MM-dd") |
|||
private Date createtime; |
|||
private String processStatus; |
|||
private String currentTaskName; |
|||
private String processName; |
|||
private String processInstanceId; |
|||
} |
@ -0,0 +1,12 @@ |
|||
package org.jeecg.modules.huzhou.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV; |
|||
|
|||
@Mapper |
|||
public interface HuzhouContractinfoMapper extends BaseMapper<HuzhouContractinfo> { |
|||
Page<HuzhouContractinfoOV> getContractinfoPageList(Page page, HuzhouContractinfoOV info); |
|||
} |
@ -0,0 +1,9 @@ |
|||
package org.jeecg.modules.huzhou.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
|
|||
@Mapper |
|||
public interface HuzhouRegulationlabMapper extends BaseMapper<HuzhouRegulationlab> { |
|||
} |
@ -0,0 +1,14 @@ |
|||
package org.jeecg.modules.huzhou.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
|
|||
import org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV; |
|||
|
|||
@Mapper |
|||
public interface HuzhouWorkreportMapper extends BaseMapper<HuzhouWorkreport> { |
|||
Page<HuzhouWorkreportOV> getWorkreportPageList(Page page, HuzhouWorkreportOV info); |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.jeecg.modules.huzhou.mapper.HuzhouContractinfoMapper"> |
|||
<select id="getContractinfoPageList" resultType="org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV" parameterType="org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV"> |
|||
select a.*,b.project_name,b.id pid from huzhou_projectinfo b LEFT JOIN huzhou_contractinfo a on a.projectid =b.id |
|||
<where> |
|||
b.stage > 2 |
|||
<if test="info.documentName!=null and info.documentName!=''"> |
|||
<bind name="tempStr" value="'%' + info.documentName + '%'" /> |
|||
and a.document_name like #{tempStr} |
|||
</if> |
|||
<if test="info.projectName!=null and info.projectName!=''"> |
|||
<bind name="tempStr" value="'%' + info.projectName + '%'" /> |
|||
and b.project_name like #{tempStr} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.jeecg.modules.huzhou.mapper.HuzhouWorkreportMapper"> |
|||
<select id="getWorkreportPageList" resultType="org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV" parameterType="org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV"> |
|||
select a.*,b.project_name from huzhou_workreport a LEFT JOIN huzhou_projectinfo b on a.projectid =b.id |
|||
<where> |
|||
b.stage > 2 |
|||
<if test="info.documentName!=null and info.documentName!=''"> |
|||
<bind name="tempStr" value="'%' + info.documentName + '%'" /> |
|||
and a.document_name like #{tempStr} |
|||
</if> |
|||
<if test="info.projectName!=null and info.projectName!=''"> |
|||
<bind name="tempStr" value="'%' + info.projectName + '%'" /> |
|||
and b.project_name like #{tempStr} |
|||
</if> |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,24 @@ |
|||
package org.jeecg.modules.huzhou.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
import java.util.List; |
|||
|
|||
public interface IHuzhouContractinfoService extends IService<HuzhouContractinfo>{ |
|||
Page<HuzhouContractinfoOV> getContractinfoPageList(HuzhouContractinfoOV contractinfo, Integer pageNo, |
|||
Integer pageSize); |
|||
void addContractinfo(MultipartFile file, HuzhouContractinfo contractinfo) throws IOException; |
|||
Boolean modifyContractinfo(MultipartFile file, HuzhouContractinfo contractinfo) throws IOException; |
|||
|
|||
Boolean deleteContractinfo(HuzhouContractinfo contractinfo); |
|||
|
|||
List<HuzhouContractinfo> getContractinfoByprojectId(String projectid); |
|||
|
|||
} |
@ -1,7 +1,10 @@ |
|||
package org.jeecg.modules.huzhou.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouPlaninfofile; |
|||
|
|||
public interface IHuzhouPlaninfofileService extends IService<HuzhouPlaninfofile> { |
|||
Page<HuzhouPlaninfofile> getplanFilePageList(HuzhouPlaninfofile planinfofile, Integer pageNo, Integer pageSize); |
|||
void modifyStatusByPlaninfoid(String status,String planinfo); |
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
package org.jeecg.modules.huzhou.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
|
|||
public interface IHuzhouRegulationlabService extends IService<HuzhouRegulationlab> { |
|||
Page<HuzhouRegulationlab> getRegulationlabPageList(HuzhouRegulationlab regulationlab,Integer pageNo, |
|||
Integer pageSize); |
|||
void addRegulationlab(MultipartFile file,HuzhouRegulationlab regulationlab) throws IOException; |
|||
Boolean modifyRegulationlab(MultipartFile file, HuzhouRegulationlab regulationlab) throws IOException; |
|||
|
|||
Boolean deleteRegulationlab(HuzhouRegulationlab regulationlab); |
|||
|
|||
void batchdownloadRegulationlabFiles(HuzhouRegulationlab regulationlab,HttpServletResponse response); |
|||
} |
@ -0,0 +1,20 @@ |
|||
package org.jeecg.modules.huzhou.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
|
|||
public interface IHuzhouWorkreportService extends IService<HuzhouWorkreport> { |
|||
Page<HuzhouWorkreportOV> getWorkreportPageList(HuzhouWorkreportOV Workreport, Integer pageNo, |
|||
Integer pageSize); |
|||
void addWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; |
|||
Boolean modifyWorkreport(MultipartFile file, HuzhouWorkreport Workreport) throws IOException; |
|||
|
|||
Boolean deleteWorkreport(HuzhouWorkreport Workreport); |
|||
|
|||
} |
@ -0,0 +1,111 @@ |
|||
package org.jeecg.modules.huzhou.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.jeecg.common.constant.SymbolConstant; |
|||
import org.jeecg.common.util.CommonUtils; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
import org.jeecg.modules.huzhou.mapper.HuzhouContractinfoMapper; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouContractinfoService; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouContractinfoOV; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.FileCopyUtils; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Service |
|||
|
|||
public class HuzhouContractinfoServiceImpl extends ServiceImpl<HuzhouContractinfoMapper, HuzhouContractinfo> implements IHuzhouContractinfoService { |
|||
@Value(value = "${jeecg.path.upload}") |
|||
private String uploadpath; |
|||
@Autowired |
|||
private HuzhouContractinfoMapper contractinfoMapper; |
|||
@Override |
|||
public Page<HuzhouContractinfoOV> getContractinfoPageList(HuzhouContractinfoOV contractinfo, Integer pageNo, Integer pageSize) { |
|||
Page<HuzhouContractinfo> page = new Page<>(pageNo, pageSize); |
|||
Page<HuzhouContractinfoOV> contractinfoPageList = contractinfoMapper.getContractinfoPageList(page, contractinfo); |
|||
return contractinfoPageList; |
|||
} |
|||
|
|||
@Override |
|||
public void addContractinfo(MultipartFile file, HuzhouContractinfo contractinfo) throws IOException { |
|||
addContractFile(file,contractinfo); |
|||
save(contractinfo); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Boolean modifyContractinfo(MultipartFile file, HuzhouContractinfo contractinfo) throws IOException { |
|||
HuzhouContractinfo huzhouContractinfo = getById(contractinfo.getId()); |
|||
String documentPath = huzhouContractinfo.getDocumentPath(); |
|||
File contractfile = new File(documentPath); |
|||
if(file==null){ |
|||
updateById(contractinfo); |
|||
return true; |
|||
} |
|||
if(contractfile.delete()){ |
|||
addContractFile(file,contractinfo); |
|||
updateById(contractinfo); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean deleteContractinfo(HuzhouContractinfo contractinfo) { |
|||
String id = contractinfo.getId(); |
|||
HuzhouContractinfo huzhouContractinfo = getById(id); |
|||
String documentPath = huzhouContractinfo.getDocumentPath(); |
|||
File contractfile = new File(documentPath); |
|||
if(contractfile.delete()){ |
|||
removeById(id); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
public List<HuzhouContractinfo> getContractinfoByprojectId(String projectid) { |
|||
LambdaQueryWrapper<HuzhouContractinfo> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(HuzhouContractinfo::getProjectid, projectid); |
|||
List<HuzhouContractinfo> list = list(queryWrapper); |
|||
return list; |
|||
} |
|||
|
|||
private void addContractFile(MultipartFile file, HuzhouContractinfo contractinfo) throws IOException { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
|||
String currentDay = dateFormat.format(new Date()); |
|||
File filePath = new File(uploadpath +File.separator+"contract"+ File.separator + currentDay + File.separator); |
|||
//文件夹不存在则创建
|
|||
if (!filePath.exists()) { |
|||
// 创建文件根目录
|
|||
filePath.mkdirs(); |
|||
} |
|||
String fileName =null; |
|||
String originalFilename = file.getOriginalFilename(); |
|||
originalFilename = CommonUtils.getFileName(originalFilename); |
|||
if(originalFilename.indexOf(SymbolConstant.SPOT)!=-1){ |
|||
fileName = originalFilename.substring(0, originalFilename.lastIndexOf(".")) + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf(".")); |
|||
}else{ |
|||
fileName = originalFilename+ "_" + System.currentTimeMillis(); |
|||
} |
|||
String savePath = filePath.getPath() + File.separator + fileName; |
|||
File savefile = new File(savePath); |
|||
FileCopyUtils.copy(file.getBytes(), savefile);//保存文件
|
|||
contractinfo.setDocumentName(originalFilename);//未加工过的文件名称
|
|||
contractinfo.setDocumentType(file.getContentType()); |
|||
contractinfo.setDocumentPath(savePath); |
|||
contractinfo.setSize(file.getSize()); |
|||
contractinfo.setStatus("1"); |
|||
} |
|||
|
|||
} |
@ -1,11 +1,35 @@ |
|||
package org.jeecg.modules.huzhou.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.checkerframework.checker.units.qual.A; |
|||
import org.jeecg.modules.huzhou.entity.BaseEntity; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouPlaninfofile; |
|||
import org.jeecg.modules.huzhou.mapper.HuzhouPlaninfofileMapper; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouPlaninfofileService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class HuzhouPlaninfofileServiceImpl extends ServiceImpl<HuzhouPlaninfofileMapper, HuzhouPlaninfofile> implements IHuzhouPlaninfofileService { |
|||
|
|||
@Override |
|||
public Page<HuzhouPlaninfofile> getplanFilePageList(HuzhouPlaninfofile planinfofile,Integer pageNo, Integer pageSize) { |
|||
Page<HuzhouPlaninfofile> page = new Page<>(pageNo,pageSize); |
|||
LambdaQueryWrapper<HuzhouPlaninfofile> queryWrapper = new LambdaQueryWrapper<>(); |
|||
queryWrapper.eq(HuzhouPlaninfofile::getPlaninfoid,planinfofile.getPlaninfoid()); |
|||
queryWrapper.orderByDesc(BaseEntity::getCreatetime); |
|||
Page<HuzhouPlaninfofile> planinfofilePage = this.page(page, queryWrapper); |
|||
return planinfofilePage; |
|||
} |
|||
|
|||
@Override |
|||
public void modifyStatusByPlaninfoid(String status, String planinfoid) { |
|||
LambdaUpdateWrapper<HuzhouPlaninfofile> updateWrapper = new LambdaUpdateWrapper<>(); |
|||
updateWrapper.eq(HuzhouPlaninfofile::getPlaninfoid,planinfoid); |
|||
updateWrapper.set(HuzhouPlaninfofile::getStatus,status); |
|||
this.update(updateWrapper); |
|||
} |
|||
} |
|||
|
@ -0,0 +1,139 @@ |
|||
package org.jeecg.modules.huzhou.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.jeecg.common.api.vo.Result; |
|||
import org.jeecg.common.constant.SymbolConstant; |
|||
import org.jeecg.common.util.CommonUtils; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouPlaninfofile; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouRegulationlab; |
|||
import org.jeecg.modules.huzhou.mapper.HuzhouRegulationlabMapper; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouRegulationlabService; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.FileCopyUtils; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.File; |
|||
import java.io.FileInputStream; |
|||
import java.io.IOException; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
import java.util.zip.ZipEntry; |
|||
import java.util.zip.ZipOutputStream; |
|||
|
|||
@Service |
|||
public class HuzhouRegulationlabServiceImpl extends ServiceImpl<HuzhouRegulationlabMapper, HuzhouRegulationlab> implements IHuzhouRegulationlabService { |
|||
@Value(value = "${jeecg.path.upload}") |
|||
private String uploadpath; |
|||
@Override |
|||
public Page<HuzhouRegulationlab> getRegulationlabPageList(HuzhouRegulationlab regulationlab, |
|||
Integer pageNo, |
|||
Integer pageSize) { |
|||
LambdaQueryWrapper<HuzhouRegulationlab> queryWrapper = new LambdaQueryWrapper<>(); |
|||
Page<HuzhouRegulationlab> huzhouRegulationlabPage = new Page<>(pageNo, pageSize); |
|||
String regulationlabName = regulationlab.getRegulationlabName(); |
|||
String documentName = regulationlab.getDocumentName(); |
|||
queryWrapper.like(StringUtils.isNotBlank(regulationlabName),HuzhouRegulationlab::getRegulationlabName,regulationlabName); |
|||
queryWrapper.like(StringUtils.isNotBlank(documentName),HuzhouRegulationlab::getDocumentName,documentName); |
|||
Page<HuzhouRegulationlab> page = this.page(huzhouRegulationlabPage, queryWrapper); |
|||
return page; |
|||
} |
|||
|
|||
@Override |
|||
public void addRegulationlab(MultipartFile file, HuzhouRegulationlab regulationlab) throws IOException { |
|||
addFile(file,regulationlab); |
|||
this.save(regulationlab); |
|||
} |
|||
|
|||
@Override |
|||
public Boolean modifyRegulationlab(MultipartFile file,HuzhouRegulationlab regulationlab) throws IOException { |
|||
String documentPath = this.getById(regulationlab.getId()).getDocumentPath(); |
|||
File regulationlabFile = new File(documentPath); |
|||
if(file==null){ |
|||
this.updateById(regulationlab); |
|||
return true; |
|||
} |
|||
if(regulationlabFile.delete()){ |
|||
addFile(file,regulationlab); |
|||
this.updateById(regulationlab); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean deleteRegulationlab(HuzhouRegulationlab regulationlab) { |
|||
String id = regulationlab.getId(); |
|||
regulationlab = this.getById(id); |
|||
File file = new File(regulationlab.getDocumentPath()); |
|||
if(file.delete()){ |
|||
this.removeById(id); |
|||
return Boolean.TRUE; |
|||
} |
|||
return Boolean.FALSE; |
|||
} |
|||
|
|||
@Override |
|||
public void batchdownloadRegulationlabFiles(HuzhouRegulationlab regulationlab, HttpServletResponse response) { |
|||
LambdaQueryWrapper<HuzhouRegulationlab> queryWrapper = new LambdaQueryWrapper<>(); |
|||
String regulationlabName = regulationlab.getRegulationlabName(); |
|||
String documentName = regulationlab.getDocumentName(); |
|||
queryWrapper.like(StringUtils.isNotBlank(regulationlabName),HuzhouRegulationlab::getRegulationlabName,regulationlabName); |
|||
queryWrapper.like(StringUtils.isNotBlank(documentName),HuzhouRegulationlab::getDocumentName,documentName); |
|||
List<HuzhouRegulationlab> list = this.list(queryWrapper); |
|||
List<String> pathList = list.stream().map(HuzhouRegulationlab::getDocumentPath).collect(Collectors.toList()); |
|||
response.addHeader("Content-Type", "application/zip"); |
|||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream()); ) { |
|||
for (String fileName : pathList) { //循环往zip中放入文件
|
|||
File file = new File(fileName); |
|||
FileInputStream fileIn = new FileInputStream(file); |
|||
ZipEntry zipEntry = new ZipEntry(file.getName()); |
|||
zipOut.putNextEntry(zipEntry); |
|||
byte[] buffer = new byte[1024]; |
|||
int len; |
|||
while ((len = fileIn.read(buffer)) > 0) { |
|||
zipOut.write(buffer, 0, len); |
|||
} |
|||
fileIn.close(); |
|||
zipOut.closeEntry(); |
|||
} |
|||
zipOut.finish(); |
|||
} catch (Exception e) { |
|||
throw new RuntimeException("文件批量下载有误.", e); |
|||
} |
|||
} |
|||
|
|||
private void addFile(MultipartFile file,HuzhouRegulationlab regulationlab) throws IOException { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
|||
String currentDay = dateFormat.format(new Date()); |
|||
File filePath = new File(uploadpath +File.separator+"regulationlab"+ File.separator + currentDay + File.separator); |
|||
//文件夹不存在则创建
|
|||
if (!filePath.exists()) { |
|||
// 创建文件根目录
|
|||
filePath.mkdirs(); |
|||
} |
|||
String fileName =null; |
|||
String originalFilename = file.getOriginalFilename(); |
|||
originalFilename = CommonUtils.getFileName(originalFilename); |
|||
if(originalFilename.indexOf(SymbolConstant.SPOT)!=-1){ |
|||
fileName = originalFilename.substring(0, originalFilename.lastIndexOf(".")) + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf(".")); |
|||
}else{ |
|||
fileName = originalFilename+ "_" + System.currentTimeMillis(); |
|||
} |
|||
String savePath = filePath.getPath() + File.separator + fileName; |
|||
File savefile = new File(savePath); |
|||
FileCopyUtils.copy(file.getBytes(), savefile);//保存文件
|
|||
regulationlab.setDocumentName(originalFilename);//未加工过的文件名称
|
|||
regulationlab.setDocumentType(file.getContentType()); |
|||
regulationlab.setDocumentPath(savePath); |
|||
regulationlab.setSize(file.getSize()); |
|||
regulationlab.setStatus("1"); |
|||
} |
|||
} |
@ -0,0 +1,96 @@ |
|||
package org.jeecg.modules.huzhou.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.jeecg.common.constant.SymbolConstant; |
|||
import org.jeecg.common.util.CommonUtils; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
import org.jeecg.modules.huzhou.mapper.HuzhouWorkreportMapper; |
|||
import org.jeecg.modules.huzhou.service.IHuzhouWorkreportService; |
|||
import org.jeecg.modules.huzhou.vo.HuzhouWorkreportOV; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.FileCopyUtils; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
|
|||
@Service |
|||
public class HuzhouWorkreportServiceImpl extends ServiceImpl<HuzhouWorkreportMapper,HuzhouWorkreport> implements IHuzhouWorkreportService { |
|||
@Autowired |
|||
private HuzhouWorkreportMapper workreportMapper; |
|||
@Value(value = "${jeecg.path.upload}") |
|||
private String uploadpath; |
|||
@Override |
|||
public Page<HuzhouWorkreportOV> getWorkreportPageList(HuzhouWorkreportOV workreport, Integer pageNo, Integer pageSize) { |
|||
Page<HuzhouWorkreportOV> page = new Page<>(pageNo, pageSize); |
|||
Page<HuzhouWorkreportOV> pageList = workreportMapper.getWorkreportPageList(page, workreport); |
|||
return pageList; |
|||
} |
|||
|
|||
@Override |
|||
public void addWorkreport(MultipartFile file, HuzhouWorkreport workreport) throws IOException { |
|||
addContractFile(file,workreport); |
|||
save(workreport); |
|||
} |
|||
|
|||
@Override |
|||
public Boolean modifyWorkreport(MultipartFile file, HuzhouWorkreport workreport) throws IOException { |
|||
String path = getById(workreport.getId()).getDocumentPath(); |
|||
File contractfile = new File(path); |
|||
if(file==null){ |
|||
updateById(workreport); |
|||
return true; |
|||
} |
|||
if(contractfile.delete()){ |
|||
addContractFile(file,workreport); |
|||
updateById(workreport); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
public Boolean deleteWorkreport(HuzhouWorkreport workreport) { |
|||
String id = workreport.getId(); |
|||
HuzhouWorkreport byId = getById(id); |
|||
String documentPath = byId.getDocumentPath(); |
|||
File contractfile = new File(documentPath); |
|||
if(contractfile.delete()){ |
|||
removeById(id); |
|||
return true; |
|||
} |
|||
return false; |
|||
} |
|||
private void addContractFile(MultipartFile file, HuzhouWorkreport workreport) throws IOException { |
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
|||
String currentDay = dateFormat.format(new Date()); |
|||
File filePath = new File(uploadpath +File.separator+"workreport"+ File.separator + currentDay + File.separator); |
|||
//文件夹不存在则创建
|
|||
if (!filePath.exists()) { |
|||
// 创建文件根目录
|
|||
filePath.mkdirs(); |
|||
} |
|||
String fileName =null; |
|||
String originalFilename = file.getOriginalFilename(); |
|||
originalFilename = CommonUtils.getFileName(originalFilename); |
|||
if(originalFilename.indexOf(SymbolConstant.SPOT)!=-1){ |
|||
fileName = originalFilename.substring(0, originalFilename.lastIndexOf(".")) + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf(".")); |
|||
}else{ |
|||
fileName = originalFilename+ "_" + System.currentTimeMillis(); |
|||
} |
|||
String savePath = filePath.getPath() + File.separator + fileName; |
|||
File savefile = new File(savePath); |
|||
FileCopyUtils.copy(file.getBytes(), savefile);//保存文件
|
|||
workreport.setDocumentName(originalFilename);//未加工过的文件名称
|
|||
workreport.setDocumentType(file.getContentType()); |
|||
workreport.setDocumentPath(savePath); |
|||
workreport.setSize(file.getSize()); |
|||
workreport.setStatus("1"); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
package org.jeecg.modules.huzhou.vo; |
|||
|
|||
import lombok.Data; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouContractinfo; |
|||
|
|||
@Data |
|||
public class HuzhouContractinfoOV extends HuzhouContractinfo { |
|||
private String projectName; |
|||
/** |
|||
* 项目id |
|||
*/ |
|||
private String pid; |
|||
} |
@ -0,0 +1,9 @@ |
|||
package org.jeecg.modules.huzhou.vo; |
|||
|
|||
import lombok.Data; |
|||
import org.jeecg.modules.huzhou.entity.HuzhouWorkreport; |
|||
|
|||
@Data |
|||
public class HuzhouWorkreportOV extends HuzhouWorkreport { |
|||
private String projectName; |
|||
} |
Binary file not shown.
@ -0,0 +1,54 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef"> |
|||
<process id="项目归档审批流程" name="项目归档审批流程" isExecutable="true"> |
|||
<startEvent id="sid-443e9ab1-ec75-47fe-b981-22d5aadb9388"/> |
|||
<userTask id="sid-3bfddcf4-f10c-4a70-870f-dbda691a6f34" name="发起人" activiti:assignee="${start}"/> |
|||
<userTask id="sid-280392b1-3204-47ce-a399-fac405d907cd" name="归档人" activiti:candidateUsers="${users}"> |
|||
<documentation/> |
|||
</userTask> |
|||
<endEvent id="sid-bc2f60e6-b03a-42ad-9ee0-325a736fa91d"/> |
|||
<sequenceFlow id="sid-e993d913-7d50-44d2-8d93-ff5ecd618f3e" sourceRef="sid-443e9ab1-ec75-47fe-b981-22d5aadb9388" targetRef="sid-3bfddcf4-f10c-4a70-870f-dbda691a6f34"/> |
|||
<sequenceFlow id="sid-8759faef-27a6-47ff-bf8b-e386584149a8" sourceRef="sid-3bfddcf4-f10c-4a70-870f-dbda691a6f34" targetRef="sid-280392b1-3204-47ce-a399-fac405d907cd"/> |
|||
<sequenceFlow id="sid-f47ffb94-0774-458f-89cd-00f90599669a" sourceRef="sid-280392b1-3204-47ce-a399-fac405d907cd" targetRef="sid-3bfddcf4-f10c-4a70-870f-dbda691a6f34"> |
|||
<extensionElements> |
|||
<activiti:executionListener class="Class 1"/> |
|||
</extensionElements> |
|||
<conditionExpression>${type==0}</conditionExpression> |
|||
</sequenceFlow> |
|||
<sequenceFlow id="sid-893cd2bb-5200-472f-8baa-80d8b2081135" sourceRef="sid-280392b1-3204-47ce-a399-fac405d907cd" targetRef="sid-bc2f60e6-b03a-42ad-9ee0-325a736fa91d"> |
|||
<conditionExpression>${type==1}</conditionExpression> |
|||
</sequenceFlow> |
|||
</process> |
|||
<bpmndi:BPMNDiagram id="BPMNDiagram_项目归档审批流程"> |
|||
<bpmndi:BPMNPlane bpmnElement="项目归档审批流程" id="BPMNPlane_项目归档审批流程"> |
|||
<bpmndi:BPMNShape id="shape-9769317a-3016-4089-b61e-4fc3238509ac" bpmnElement="sid-443e9ab1-ec75-47fe-b981-22d5aadb9388"> |
|||
<omgdc:Bounds x="45.0" y="-30.0" width="30.0" height="30.0"/> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape id="shape-577adbd6-fc6a-494c-93fe-a425019c7ae2" bpmnElement="sid-3bfddcf4-f10c-4a70-870f-dbda691a6f34"> |
|||
<omgdc:Bounds x="105.0" y="-45.0" width="100.0" height="80.0"/> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape id="shape-bf9fa704-43ed-47b8-82f3-bc30ec5d95d3" bpmnElement="sid-280392b1-3204-47ce-a399-fac405d907cd"> |
|||
<omgdc:Bounds x="235.0" y="-50.0" width="100.0" height="80.0"/> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNShape id="shape-29443b72-45de-4df4-a195-e4a604a2c893" bpmnElement="sid-bc2f60e6-b03a-42ad-9ee0-325a736fa91d"> |
|||
<omgdc:Bounds x="370.0" y="-20.0" width="30.0" height="30.0"/> |
|||
</bpmndi:BPMNShape> |
|||
<bpmndi:BPMNEdge id="edge-e69d9cb4-c774-4b89-bfa4-0c4ae00720d7" bpmnElement="sid-e993d913-7d50-44d2-8d93-ff5ecd618f3e"> |
|||
<omgdi:waypoint x="75.0" y="-22.5"/> |
|||
<omgdi:waypoint x="105.0" y="-25.0"/> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge id="edge-58617930-43ff-4cd7-a1aa-599fb9e86069" bpmnElement="sid-8759faef-27a6-47ff-bf8b-e386584149a8"> |
|||
<omgdi:waypoint x="205.0" y="-5.0"/> |
|||
<omgdi:waypoint x="235.0" y="-10.0"/> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge id="edge-125b40a9-ded9-4136-ac78-82448b9522ee" bpmnElement="sid-f47ffb94-0774-458f-89cd-00f90599669a"> |
|||
<omgdi:waypoint x="235.0" y="-30.0"/> |
|||
<omgdi:waypoint x="205.0" y="-25.0"/> |
|||
</bpmndi:BPMNEdge> |
|||
<bpmndi:BPMNEdge id="edge-4df2918a-49a0-4dbf-b2b6-b45a5d7d1542" bpmnElement="sid-893cd2bb-5200-472f-8baa-80d8b2081135"> |
|||
<omgdi:waypoint x="335.0" y="-10.0"/> |
|||
<omgdi:waypoint x="370.0" y="-12.5"/> |
|||
</bpmndi:BPMNEdge> |
|||
</bpmndi:BPMNPlane> |
|||
</bpmndi:BPMNDiagram> |
|||
</definitions> |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 7.4 KiB |
Loading…
Reference in new issue