代码提交 快递
This commit is contained in:
parent
bfc4f25155
commit
a350308e04
@ -32,7 +32,7 @@ import java.util.List;
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/customerInfo")
|
||||
@RequestMapping("/manage/customerInfo")
|
||||
public class LxCustomerInfoController extends BaseController {
|
||||
|
||||
private final ILxCustomerInfoService lxCustomerInfoService;
|
||||
@ -40,7 +40,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:list")
|
||||
@SaCheckPermission("manage:customerInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<LxCustomerInfoVo> list(LxCustomerInfoBo bo, PageQuery pageQuery) {
|
||||
return lxCustomerInfoService.queryPageList(bo, pageQuery);
|
||||
@ -49,7 +49,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
/**
|
||||
* 导出客户信息列表
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:export")
|
||||
@SaCheckPermission("manage:customerInfo:export")
|
||||
@Log(title = "客户信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(LxCustomerInfoBo bo, HttpServletResponse response) {
|
||||
@ -62,7 +62,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:query")
|
||||
@SaCheckPermission("manage:customerInfo:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<LxCustomerInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@ -72,7 +72,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
/**
|
||||
* 新增客户信息
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:add")
|
||||
@SaCheckPermission("manage:customerInfo:add")
|
||||
@Log(title = "客户信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@ -83,7 +83,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
/**
|
||||
* 修改客户信息
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:edit")
|
||||
@SaCheckPermission("manage:customerInfo:edit")
|
||||
@Log(title = "客户信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@ -96,7 +96,7 @@ public class LxCustomerInfoController extends BaseController {
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("system:customerInfo:remove")
|
||||
@SaCheckPermission("manage:customerInfo:remove")
|
||||
@Log(title = "客户信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
|
@ -49,6 +49,16 @@ public class LxContractInfo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 重要性
|
||||
*/
|
||||
private Integer contractLevel;
|
||||
|
||||
/**
|
||||
* 合同负责人
|
||||
*/
|
||||
private Long contractManagerId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -35,6 +35,11 @@ public class LxContractInfoBo extends BaseEntity {
|
||||
*/
|
||||
private String contractType;
|
||||
|
||||
/**
|
||||
* 重要性
|
||||
*/
|
||||
private Integer contractLevel;
|
||||
|
||||
/**
|
||||
* 合同编码
|
||||
*/
|
||||
@ -45,5 +50,10 @@ public class LxContractInfoBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 合同负责人
|
||||
*/
|
||||
private Long contractManagerId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -48,11 +48,29 @@ public class LxContractInfoVo implements Serializable {
|
||||
@ExcelProperty(value = "合同编码")
|
||||
private String contractCode;
|
||||
|
||||
/**
|
||||
* 重要性
|
||||
*/
|
||||
@ExcelProperty(value = "重要性")
|
||||
private Integer contractLevel;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 合同负责人id
|
||||
*/
|
||||
@ExcelProperty(value = "合同负责人id")
|
||||
private String contractManagerId;
|
||||
|
||||
/**
|
||||
* 合同负责人id
|
||||
*/
|
||||
@ExcelProperty(value = "合同负责人")
|
||||
private String contractManager;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
package org.dromara.lx.manage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.lx.manage.domain.LxContractInfo;
|
||||
import org.dromara.lx.manage.domain.vo.LxContractInfoVo;
|
||||
@ -13,4 +17,7 @@ import org.dromara.lx.manage.domain.vo.LxContractInfoVo;
|
||||
*/
|
||||
public interface LxContractInfoMapper extends BaseMapperPlus<LxContractInfo, LxContractInfoVo> {
|
||||
|
||||
Page<LxContractInfoVo> queryContractPageList(@Param("page") Page<LxContractInfoVo> page, @Param(Constants.WRAPPER) Wrapper<LxContractInfo> queryWrapper);
|
||||
|
||||
LxContractInfoVo selectContractInfoVoById(@Param("id") Long id);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class LxContractInfoServiceImpl implements ILxContractInfoService {
|
||||
*/
|
||||
@Override
|
||||
public LxContractInfoVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
return baseMapper.selectContractInfoVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ public class LxContractInfoServiceImpl implements ILxContractInfoService {
|
||||
@Override
|
||||
public TableDataInfo<LxContractInfoVo> queryPageList(LxContractInfoBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<LxContractInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<LxContractInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<LxContractInfoVo> result = baseMapper.queryContractPageList(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -4,4 +4,16 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.lx.manage.mapper.LxContractInfoMapper">
|
||||
|
||||
<select id="queryContractPageList" resultType="org.dromara.lx.manage.domain.vo.LxContractInfoVo">
|
||||
select contract.*, su.employee_name as contract_manager
|
||||
from lx_contract_info contract
|
||||
left join sys_user su on contract.contract_manager_id = su.user_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
<select id="selectContractInfoVoById" resultType="org.dromara.lx.manage.domain.vo.LxContractInfoVo">
|
||||
select contract.*, su.employee_name as contract_manager
|
||||
from lx_contract_info contract
|
||||
left join sys_user su on contract.contract_manager_id = su.user_id
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,108 @@
|
||||
package org.dromara.workflow.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.domain.bo.LxOaSealBo;
|
||||
import org.dromara.workflow.domain.vo.LxOaSealVVo;
|
||||
import org.dromara.workflow.service.ILxOaSealService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用章
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
@ConditionalOnEnable
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/workflow/express")
|
||||
public class OAExpressController extends BaseController {
|
||||
|
||||
private final ILxOaSealService lxOaSealService;
|
||||
|
||||
/**
|
||||
* 查询用章列表
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<LxOaSealVVo> list(LxOaSealBo bo, PageQuery pageQuery) {
|
||||
return lxOaSealService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用章列表
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:export")
|
||||
@Log(title = "用章", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(LxOaSealBo bo, HttpServletResponse response) {
|
||||
List<LxOaSealVVo> list = lxOaSealService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "用章", LxOaSealVVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用章详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<LxOaSealVVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(lxOaSealService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用章
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:add")
|
||||
@Log(title = "用章", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<LxOaSealVVo> add(@Validated(AddGroup.class) @RequestBody LxOaSealBo bo) {
|
||||
return R.ok(lxOaSealService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用章
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:edit")
|
||||
@Log(title = "用章", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<LxOaSealVVo> edit(@Validated(EditGroup.class) @RequestBody LxOaSealBo bo) {
|
||||
return R.ok(lxOaSealService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用章
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("workflow:seal:remove")
|
||||
@Log(title = "用章", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(lxOaSealService.deleteWithValidByIds(List.of(ids)));
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package org.dromara.workflow.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递申请对象 lx_oa_express
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-05-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("lx_oa_express")
|
||||
public class LxOaExpress extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 用章时间
|
||||
*/
|
||||
private Date sealDate;
|
||||
|
||||
/**
|
||||
* 是否外带
|
||||
*/
|
||||
private Integer takeOutFlag;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal sealMoney;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 公章id
|
||||
*/
|
||||
private Long sealId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件编号
|
||||
*/
|
||||
private String fileCode;
|
||||
|
||||
/**
|
||||
* 外带开始时间
|
||||
*/
|
||||
private Date takeOutStartDate;
|
||||
|
||||
/**
|
||||
* 外带结束时间
|
||||
*/
|
||||
private Date takeOutEndDate;
|
||||
|
||||
/**
|
||||
* 文件份数
|
||||
*/
|
||||
private Integer fileCount;
|
||||
|
||||
/**
|
||||
* 发起人类别
|
||||
*/
|
||||
private Integer initiatorType;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* 外带地址
|
||||
*/
|
||||
private String takeOutAddress;
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package org.dromara.workflow.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.workflow.domain.LxOaExpress;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递业务对象 lx_oa_express
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = LxOaExpress.class, reverseConvertGenerate = false)
|
||||
public class LxOaExpressBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 请假类型
|
||||
*/
|
||||
@NotBlank(message = "请假类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String leaveType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 请假天数
|
||||
*/
|
||||
private Integer leaveDays;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Integer startLeaveDays;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Integer endLeaveDays;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 在办项目
|
||||
*/
|
||||
private String currentProjects;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String dept;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package org.dromara.workflow.domain.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.workflow.domain.LxOaExpress;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 快递视图对象 lx_oa_express
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = LxOaExpress.class)
|
||||
public class LxOaExpressVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ExcelProperty(value = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 请假类型
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型")
|
||||
private String leaveType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 请假天数
|
||||
*/
|
||||
@ExcelProperty(value = "请假天数")
|
||||
private Integer leaveDays;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@ExcelProperty(value = "请假原因")
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 在办项目
|
||||
*/
|
||||
@ExcelProperty(value = "在办项目")
|
||||
private String currentProjects;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ExcelProperty(value = "附件")
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.dromara.workflow.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.workflow.domain.LxOaExpress;
|
||||
import org.dromara.workflow.domain.vo.LxOaExpressVo;
|
||||
|
||||
/**
|
||||
* 快递Mapper接口
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
public interface LxOaExpressMapper extends BaseMapperPlus<LxOaExpress, LxOaExpressVo> {
|
||||
|
||||
|
||||
Page<LxOaExpressVo> queryPageOaSealVoList(@Param("page") Page<LxOaExpressVo> page, @Param(Constants.WRAPPER) Wrapper<LxOaExpress> queryWrapper);
|
||||
|
||||
LxOaExpressVo queryPageOaSealVoInfo(@Param("id") Long id);
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package org.dromara.workflow.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.workflow.domain.bo.LxOaExpressBo;
|
||||
import org.dromara.workflow.domain.vo.LxOaExpressVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递Service接口
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
public interface ILxOaExpressService {
|
||||
|
||||
/**
|
||||
* 查询快递
|
||||
*/
|
||||
LxOaExpressVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询快递列表
|
||||
*/
|
||||
TableDataInfo<LxOaExpressVo> queryPageList(LxOaExpressBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询快递列表
|
||||
*/
|
||||
List<LxOaExpressVo> queryList(LxOaExpressBo bo);
|
||||
|
||||
/**
|
||||
* 新增快递
|
||||
*/
|
||||
LxOaExpressVo insertByBo(LxOaExpressBo bo);
|
||||
|
||||
/**
|
||||
* 修改快递
|
||||
*/
|
||||
LxOaExpressVo updateByBo(LxOaExpressBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除快递信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(List<Long> ids);
|
||||
}
|
@ -0,0 +1,209 @@
|
||||
package org.dromara.workflow.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.event.ProcessCreateTaskEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.service.WorkflowService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.domain.LxOaExpress;
|
||||
import org.dromara.workflow.domain.bo.LxOaExpressBo;
|
||||
import org.dromara.workflow.domain.vo.LxOaExpressVo;
|
||||
import org.dromara.workflow.mapper.LxOaExpressMapper;
|
||||
import org.dromara.workflow.service.ILxOaExpressService;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 快递Service业务层处理
|
||||
*
|
||||
* @author may
|
||||
* @date 2023-07-21
|
||||
*/
|
||||
@ConditionalOnEnable
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LxOaExpressServiceImpl implements ILxOaExpressService {
|
||||
|
||||
private final LxOaExpressMapper baseMapper;
|
||||
private final WorkflowService workflowService;
|
||||
|
||||
/**
|
||||
* spel条件表达:判断小于2
|
||||
*
|
||||
* @param leaveDays 待判断的变量(可不传自行返回true或false)
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean eval(Integer leaveDays) {
|
||||
if (leaveDays <= 2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递
|
||||
*/
|
||||
@Override
|
||||
public LxOaExpressVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<LxOaExpressVo> queryPageList(LxOaExpressBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<LxOaExpress> lqw = buildQueryWrapper(bo);
|
||||
Page<LxOaExpressVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递列表
|
||||
*/
|
||||
@Override
|
||||
public List<LxOaExpressVo> queryList(LxOaExpressBo bo) {
|
||||
LambdaQueryWrapper<LxOaExpress> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<LxOaExpress> buildQueryWrapper(LxOaExpressBo bo) {
|
||||
LambdaQueryWrapper<LxOaExpress> lqw = Wrappers.lambdaQuery();
|
||||
// lqw.eq(StringUtils.isNotBlank(bo.getExpressType()), LxOaExpress::getExpressType, bo.getExpressType());
|
||||
// lqw.ge(bo.getStartExpressDays() != null, LxOaExpress::getExpressDays, bo.getStartExpressDays());
|
||||
// lqw.le(bo.getEndExpressDays() != null, LxOaExpress::getExpressDays, bo.getEndExpressDays());
|
||||
// lqw.orderByDesc(BaseEntity::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递
|
||||
*/
|
||||
@Override
|
||||
public LxOaExpressVo insertByBo(LxOaExpressBo bo) {
|
||||
long day = DateUtil.between(bo.getStartDate(), bo.getEndDate(), DateUnit.DAY);
|
||||
// 截止日期也算一天
|
||||
// bo.setExpressDays((int) day + 1);
|
||||
LxOaExpress add = MapstructUtils.convert(bo, LxOaExpress.class);
|
||||
if (StringUtils.isBlank(add.getStatus())) {
|
||||
add.setStatus(BusinessStatusEnum.DRAFT.getStatus());
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
// 流程变量
|
||||
Map<String, Object> variable = new HashMap<>();
|
||||
// variable.put("testExpress", testExpress);
|
||||
// variable.put("flag", String.valueOf(testExpress.getDay()));
|
||||
// flowParams.variable(variable);
|
||||
// Instance instance = insService.start(id, flowParams);
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return MapstructUtils.convert(add, LxOaExpressVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递
|
||||
*/
|
||||
@Override
|
||||
public LxOaExpressVo updateByBo(LxOaExpressBo bo) {
|
||||
LxOaExpress update = MapstructUtils.convert(bo, LxOaExpress.class);
|
||||
baseMapper.updateById(update);
|
||||
return MapstructUtils.convert(update, LxOaExpressVo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除快递
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(List<Long> ids) {
|
||||
workflowService.deleteInstance(ids);
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processEvent.flowCode=='leave1'")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("当前任务执行了{}", processEvent.toString());
|
||||
LxOaExpress lxOaExpress = baseMapper.selectById(Long.valueOf(processEvent.getBusinessId()));
|
||||
lxOaExpress.setStatus(processEvent.getStatus());
|
||||
// 用于例如审批附件 审批意见等 存储到业务表内 自行根据业务实现存储流程
|
||||
Map<String, Object> params = processEvent.getParams();
|
||||
if (MapUtil.isNotEmpty(params)) {
|
||||
// 历史任务扩展(通常为附件)
|
||||
String hisTaskExt = Convert.toStr(params.get("hisTaskExt"));
|
||||
// 办理人
|
||||
String handler = Convert.toStr(params.get("handler"));
|
||||
// 办理意见
|
||||
String message = Convert.toStr(params.get("message"));
|
||||
}
|
||||
// if (processEvent.isSubmit()) {
|
||||
// lxOaExpress.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
//
|
||||
// }
|
||||
baseMapper.updateById(lxOaExpress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processCreateTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processCreateTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processCreateTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processCreateTaskEvent.flowCode=='leave1'")
|
||||
public void processCreateTaskHandler(ProcessCreateTaskEvent processCreateTaskEvent) {
|
||||
log.info("当前任务创建了{}", processCreateTaskEvent.toString());
|
||||
LxOaExpress lxOaExpress = baseMapper.selectById(Long.valueOf(processCreateTaskEvent.getBusinessId()));
|
||||
lxOaExpress.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
baseMapper.updateById(lxOaExpress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode=='leave1'")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,当前任务执行了{}", processDeleteEvent.toString());
|
||||
LxOaExpress lxOaExpress = baseMapper.selectById(Long.valueOf(processDeleteEvent.getBusinessId()));
|
||||
if (ObjectUtil.isNull(lxOaExpress)) {
|
||||
return;
|
||||
}
|
||||
baseMapper.deleteById(lxOaExpress.getId());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
<?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.dromara.workflow.mapper.LxOaExpressMapper">
|
||||
<resultMap id="sealUsageWithSealsResultMap" type="org.dromara.workflow.domain.vo.LxOaSealVVo">
|
||||
<id property="id" column="id"/>
|
||||
<result property="businessType" column="business_type"/>
|
||||
<result property="businessType" column="business_type"/>
|
||||
<result property="sealDate" column="seal_date"/>
|
||||
<result property="takeOutFlag" column="take_out_flag"/>
|
||||
<result property="sealMoney" column="seal_money"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="fileCode" column="file_code"/>
|
||||
<result property="sealMoney" column="file_code"/>
|
||||
<result property="takeOutStartDate" column="take_out_start_date"/>
|
||||
<result property="takeOutEndDate" column="take_out_end_date"/>
|
||||
<result property="fileCount" column="file_count"/>
|
||||
<result property="initiatorType" column="initiator_type"/>
|
||||
<!-- 关联的公章列表 -->
|
||||
<collection property="sealInfos" ofType="org.dromara.workflow.domain.vo.LxOaSealVo">
|
||||
<id property="sealId" column="seal_id"/>
|
||||
<result property="sealName" column="seal_name"/>
|
||||
<result property="sealType" column="seal_type"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="queryPageOaSealVoList" resultMap="sealUsageWithSealsResultMap">
|
||||
select oa.id,
|
||||
oa.tenant_id,
|
||||
oa.business_type,
|
||||
oa.seal_date,
|
||||
oa.take_out_flag,
|
||||
oa.seal_money,
|
||||
oa.remark,
|
||||
oa.status,
|
||||
oa.create_dept,
|
||||
oa.create_by,
|
||||
oa.create_time,
|
||||
oa.update_by,
|
||||
oa.update_time,
|
||||
oa.attachment,
|
||||
oa.seal_id,
|
||||
oa.file_name,
|
||||
oa.file_code,
|
||||
oa.take_out_start_date,
|
||||
oa.take_out_end_date,
|
||||
oa.file_count,
|
||||
oa.initiator_type,
|
||||
m_seal.seal_type,
|
||||
m_seal.seal_name
|
||||
from lx_oa_seal oa
|
||||
left join lx_oa_seal_relation rel on oa.id = rel.oa_seal_id
|
||||
left join lx_material_seal m_seal
|
||||
on m_seal.id = rel.seal_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
<select id="queryPageOaSealVoInfo" resultMap="sealUsageWithSealsResultMap">
|
||||
select oa.id,
|
||||
oa.tenant_id,
|
||||
oa.business_type,
|
||||
oa.seal_date,
|
||||
oa.take_out_flag,
|
||||
oa.seal_money,
|
||||
oa.remark,
|
||||
oa.status,
|
||||
oa.create_dept,
|
||||
oa.create_by,
|
||||
oa.create_time,
|
||||
oa.update_by,
|
||||
oa.update_time,
|
||||
oa.attachment,
|
||||
oa.seal_id,
|
||||
oa.file_name,
|
||||
oa.file_code,
|
||||
oa.take_out_start_date,
|
||||
oa.take_out_end_date,
|
||||
oa.file_count,
|
||||
oa.initiator_type,
|
||||
m_seal.id,
|
||||
m_seal.seal_type,
|
||||
m_seal.seal_name
|
||||
from lx_oa_seal oa
|
||||
left join lx_oa_seal_relation rel on oa.id = rel.oa_seal_id
|
||||
left join lx_material_seal m_seal
|
||||
on m_seal.id = rel.seal_id
|
||||
where oa.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user