Merge branch 'master' of https://gitea.chually.cn/chujinwang/chushangcloud
This commit is contained in:
commit
d3dcc6b5c2
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.chushang.inspection.project.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectContractExportVO implements java.io.Serializable{
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "项目名称", index = 0)
|
||||||
|
private String projectName;
|
||||||
|
@ExcelProperty(value = "所属部门", index = 1)
|
||||||
|
private String deptName;
|
||||||
|
@ExcelProperty(value = "项目负责人", index = 2)
|
||||||
|
private String projectConcat;
|
||||||
|
@ExcelProperty(value = "项目负责人电话", index = 3)
|
||||||
|
private String projectPhone;
|
||||||
|
@ExcelProperty(value = "项目审核状态", index = 4)
|
||||||
|
private String auditStatus;
|
||||||
|
@ExcelProperty(value = "项目合同时间", index = 5)
|
||||||
|
private String contractTimes;
|
||||||
|
@ExcelProperty(value = "创建时间", index = 6)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.chushang.inspection.project.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class ProjectExportVO implements java.io.Serializable{
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "项目名称", index = 0)
|
||||||
|
private String projectName;
|
||||||
|
@ExcelProperty(value = "所属部门", index = 1)
|
||||||
|
private String deptName;
|
||||||
|
@ExcelProperty(value = "项目负责人", index = 2)
|
||||||
|
private String projectConcat;
|
||||||
|
@ExcelProperty(value = "项目负责人电话", index = 3)
|
||||||
|
private String projectPhone;
|
||||||
|
@ExcelProperty(value = "项目状态", index = 4)
|
||||||
|
private String projectEffect;
|
||||||
|
@ExcelProperty(value = "创建时间", index = 5)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
import com.chushang.inspection.project.service.WrkProjectContractService;
|
import com.chushang.inspection.project.service.WrkProjectContractService;
|
||||||
import com.chushang.inspection.project.service.WrkProjectPaymentService;
|
import com.chushang.inspection.project.service.WrkProjectPaymentService;
|
||||||
import com.chushang.inspection.project.service.WrkProjectService;
|
import com.chushang.inspection.project.service.WrkProjectService;
|
||||||
|
import com.chushang.inspection.work.query.WrkInfoQuery;
|
||||||
import com.chushang.security.annotation.RequiresPermissions;
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
@ -25,6 +26,7 @@ import org.aspectj.weaver.loadtime.Aj;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -187,16 +189,53 @@ public class WrkProjectController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目数据导出
|
* 项目数据导出
|
||||||
* @param projectQuery 查询条件
|
* @param
|
||||||
*/
|
*/
|
||||||
|
// @SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
||||||
|
// @GetMapping(value = "/project/data/export")
|
||||||
|
//// @RequiresPermissions("inspection:project:export")
|
||||||
|
// public AjaxResult projectDataExport(ProjectQuery projectQuery)
|
||||||
|
// {
|
||||||
|
// return AjaxResult.success("项目数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
||||||
|
// }
|
||||||
|
|
||||||
@SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
@SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping(value = "/project/data/export")
|
@GetMapping("/project/data/export")
|
||||||
@RequiresPermissions("inspection:project:export")
|
@RequiresPermissions("inspection:project:export")
|
||||||
public AjaxResult projectDataExport(ProjectQuery projectQuery)
|
public void projectDataExport(HttpServletResponse response, ProjectQuery query) {
|
||||||
{
|
|
||||||
return AjaxResult.success("项目数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
|
||||||
|
try {
|
||||||
|
log.info("开始导出项目数据。查询参数: {}", query);
|
||||||
|
|
||||||
|
projectService.exportDispatchPage(response, query);
|
||||||
|
log.info("项目数据导出成功。");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出项目数据时发生错误", e);
|
||||||
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SysLog(value = "合同数据导出", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/contract/data/export")
|
||||||
|
@RequiresPermissions("inspection:contract:export")
|
||||||
|
public void projectContractDataExport(HttpServletResponse response, ProjectQuery query) {
|
||||||
|
try {
|
||||||
|
log.info("开始导出项目合同数据。查询参数: {}", query);
|
||||||
|
|
||||||
|
projectService.exportDispatchPage2(response, query);
|
||||||
|
log.info("项目合同数据导出成功。");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出项目合同数据时发生错误", e);
|
||||||
|
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人工数据
|
* 人工数据
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package com.chushang.inspection.project.mapper;
|
package com.chushang.inspection.project.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.chushang.inspection.project.po.WrkProject;
|
import com.chushang.inspection.project.po.WrkProject;
|
||||||
import com.chushang.inspection.project.po.WrkProjectContract;
|
import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
|
import com.chushang.inspection.project.vo.ProjectContractExportVO;
|
||||||
|
import com.chushang.inspection.project.vo.ProjectExportVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
|
|
@ -13,4 +15,7 @@ import org.apache.ibatis.annotations.Select;
|
||||||
*/
|
*/
|
||||||
public interface WrkProjectMapper extends BaseMapper<WrkProject> {
|
public interface WrkProjectMapper extends BaseMapper<WrkProject> {
|
||||||
|
|
||||||
|
List<ProjectExportVO> exportDispatchPage(@Param("query") ProjectQuery query);
|
||||||
|
|
||||||
|
List<ProjectContractExportVO> exportDispatchPage2(ProjectQuery query);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,15 @@ import com.chushang.inspection.project.dto.ContractDTO;
|
||||||
import com.chushang.inspection.project.dto.ProjectDTO;
|
import com.chushang.inspection.project.dto.ProjectDTO;
|
||||||
import com.chushang.inspection.project.po.WrkProjectContract;
|
import com.chushang.inspection.project.po.WrkProjectContract;
|
||||||
import com.chushang.inspection.project.query.ProjectQuery;
|
import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
import com.chushang.inspection.project.vo.CountVO;
|
import com.chushang.inspection.project.vo.*;
|
||||||
import com.chushang.inspection.project.vo.EmployeeVO;
|
|
||||||
import com.chushang.inspection.project.vo.ProjectVO;
|
|
||||||
import com.chushang.inspection.terminal.service.StoreService;
|
import com.chushang.inspection.terminal.service.StoreService;
|
||||||
import com.chushang.inspection.terminal.service.TerminalService;
|
import com.chushang.inspection.terminal.service.TerminalService;
|
||||||
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
||||||
import com.chushang.inspection.work.po.WrkInfo;
|
import com.chushang.inspection.work.po.WrkInfo;
|
||||||
|
import com.chushang.inspection.work.query.WrkInfoQuery;
|
||||||
import com.chushang.inspection.work.service.WrkInfoService;
|
import com.chushang.inspection.work.service.WrkInfoService;
|
||||||
import com.chushang.inspection.work.vo.WrkInfoDetailsVO;
|
import com.chushang.inspection.work.vo.WrkInfoDetailsVO;
|
||||||
|
import com.chushang.inspection.work.vo.WrkInfoExportVO;
|
||||||
import com.chushang.oss.entity.dto.UploadBytesDTO;
|
import com.chushang.oss.entity.dto.UploadBytesDTO;
|
||||||
import com.chushang.oss.entity.vo.FileSourceVo;
|
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||||
import com.chushang.oss.feign.RemoteOssService;
|
import com.chushang.oss.feign.RemoteOssService;
|
||||||
|
|
@ -47,6 +47,7 @@ import com.chushang.inspection.project.mapper.WrkProjectMapper;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -433,4 +434,31 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
|
||||||
.build(), SecurityConstants.INNER).getData();
|
.build(), SecurityConstants.INNER).getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void exportDispatchPage(HttpServletResponse response, ProjectQuery query) {
|
||||||
|
WrapperUtils.buildSql(query);
|
||||||
|
List<ProjectExportVO> records = baseMapper.exportDispatchPage(query);
|
||||||
|
for (ProjectExportVO record : records) {
|
||||||
|
if(record.getProjectEffect().equals("0")||record.getProjectEffect()=="0"){
|
||||||
|
record.setProjectEffect("到期");
|
||||||
|
}else if (record.getProjectEffect().equals("1")||record.getProjectEffect()=="1"){
|
||||||
|
record.setProjectEffect("正常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExcelUtils.exportList(response, ProjectExportVO.class, records, "导出");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void exportDispatchPage2(HttpServletResponse response, ProjectQuery query) {
|
||||||
|
WrapperUtils.buildSql(query);
|
||||||
|
List<ProjectContractExportVO> records = baseMapper.exportDispatchPage2(query);
|
||||||
|
for (ProjectContractExportVO record : records) {
|
||||||
|
if(record.getAuditStatus().equals("1")||record.getAuditStatus()=="1"){
|
||||||
|
record.setAuditStatus("待审核");
|
||||||
|
}else if (record.getAuditStatus().equals("2")||record.getAuditStatus()=="2"){
|
||||||
|
record.setAuditStatus("审核成功");
|
||||||
|
} else if (record.getAuditStatus().equals("3")||record.getAuditStatus()=="3") {
|
||||||
|
record.setAuditStatus("审核拒绝");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExcelUtils.exportList(response, ProjectContractExportVO.class, records, "导出");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public class StoreController {
|
||||||
*/
|
*/
|
||||||
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
@SysLog(value = "查询商户", businessType = BusinessType.QUERY)
|
||||||
@GetMapping("/info/{storeId}")
|
@GetMapping("/info/{storeId}")
|
||||||
@RequiresPermissions("ins:store:info")
|
//@RequiresPermissions("ins:store:info")
|
||||||
public AjaxResult info(@PathVariable Long storeId) {
|
public AjaxResult info(@PathVariable Long storeId) {
|
||||||
Store store = storeService.getById(storeId);
|
Store store = storeService.getById(storeId);
|
||||||
return AjaxResult.success(BeanUtil.copyProperties(store, StoreVO.class));
|
return AjaxResult.success(BeanUtil.copyProperties(store, StoreVO.class));
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class StoreImportController {
|
||||||
*/
|
*/
|
||||||
@SysLog(value = "下载模板", businessType = BusinessType.DOWNLOAD)
|
@SysLog(value = "下载模板", businessType = BusinessType.DOWNLOAD)
|
||||||
@PostMapping("/down/template")
|
@PostMapping("/down/template")
|
||||||
@RequiresPermissions("store:import:template")
|
//@RequiresPermissions("store:import:template")
|
||||||
public AjaxResult downTemplate(@RequestParam(defaultValue = "store_template") String templateAlias)
|
public AjaxResult downTemplate(@RequestParam(defaultValue = "store_template") String templateAlias)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(tbTemplateService.getByAlias(templateAlias, null));
|
return AjaxResult.success(tbTemplateService.getByAlias(templateAlias, null));
|
||||||
|
|
@ -65,7 +65,7 @@ public class StoreImportController {
|
||||||
|
|
||||||
@SysLog(value = "导入预读取", businessType = BusinessType.IMPORT)
|
@SysLog(value = "导入预读取", businessType = BusinessType.IMPORT)
|
||||||
@PostMapping("/read")
|
@PostMapping("/read")
|
||||||
@RequiresPermissions("store:import:read")
|
//@RequiresPermissions("store:import:read")
|
||||||
public AjaxResult importRead(@RequestParam(value = "file") MultipartFile file)
|
public AjaxResult importRead(@RequestParam(value = "file") MultipartFile file)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class WrkInfoController {
|
||||||
*/
|
*/
|
||||||
@SysLog(value = "派单/领取列表", businessType = BusinessType.QUERY)
|
@SysLog(value = "派单/领取列表", businessType = BusinessType.QUERY)
|
||||||
@GetMapping("/dispatch/page")
|
@GetMapping("/dispatch/page")
|
||||||
@RequiresPermissions("wrk:dispatch:page")
|
//@RequiresPermissions("wrk:dispatch:page")
|
||||||
public AjaxResult queryDispatchPage(@Validated WrkInfoQuery query) {
|
public AjaxResult queryDispatchPage(@Validated WrkInfoQuery query) {
|
||||||
// 派单领取列表, 就是 已经派出的工单以及领取的工单,
|
// 派单领取列表, 就是 已经派出的工单以及领取的工单,
|
||||||
return AjaxResult.success(wrkInfoService.queryDispatchPage(query));
|
return AjaxResult.success(wrkInfoService.queryDispatchPage(query));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?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.chushang.inspection.project.mapper.WrkProjectMapper">
|
||||||
|
|
||||||
|
<select id="exportDispatchPage" resultType="com.chushang.inspection.project.vo.ProjectExportVO">
|
||||||
|
select project_name,dept_name,project_concat,project_phone,create_time,project_effect from wrk_project where del_state = 0
|
||||||
|
</select>
|
||||||
|
<select id="exportDispatchPage2" resultType="com.chushang.inspection.project.vo.ProjectContractExportVO">
|
||||||
|
select
|
||||||
|
wp.project_name,
|
||||||
|
wp.dept_name,
|
||||||
|
wp.project_concat,
|
||||||
|
wp.project_phone,
|
||||||
|
wpc.audit_status,
|
||||||
|
CONCAT(contract_start_time,'-',contract_end_time) as contractTimes,
|
||||||
|
wp.create_time
|
||||||
|
from wrk_project wp
|
||||||
|
left join wrk_project_contract wpc on wp.project_id = wpc.project_id
|
||||||
|
where wp.del_state = 0
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -89,12 +89,12 @@ public class RoleController {
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
||||||
}
|
}
|
||||||
else if (roleService.checkRoleKeyUnique(role))
|
// else if (roleService.checkRoleKeyUnique(role))
|
||||||
{
|
// {
|
||||||
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
// return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||||
}
|
// }
|
||||||
role.setCreateBy(SecurityUtils.getUsername());
|
role.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
role.setRoleKey(role.getRoleName());
|
||||||
roleService.saveRole(role);
|
roleService.saveRole(role);
|
||||||
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue