Commit 4f997c00 authored by chenyuxi's avatar chenyuxi

feat: 移代码到薪资服务里

parent cade189a
......@@ -36,19 +36,4 @@ ekp:
LoginName: 'admin'
docSubject : '接口发起流程'
# spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
ignore: # 通用放行URL,服务个性化,请在对应配置文件覆盖
urls:
- /v3/api-docs
- /swagger-ui/**
- /tapprovalrecord/getAuditInfoByDomainIdAndAuditType
- /tinsuranceunpurchaseapply/getAuditPage
- /tinsuranceunpurchaseapply/getAuditCount
- /tinsuranceunpurchaseapply/commitOne
- /tinsuranceunpurchaseapply/audit
......@@ -59,12 +59,6 @@
<if test="tProcess.processIsUse != null and tProcess.processIsUse.trim() != ''">
AND a.process_is_use = #{tProcess.processIsUse}
</if>
<if test="tProcess.processIds != null and tProcess.processIds.size()>0">
AND a.ID IN
<foreach collection="tProcess.processIds" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</if>
</sql>
<!--tProcess简单分页查询-->
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -21,10 +21,10 @@ import java.time.LocalDateTime;
* @since 1.7.5
*/
@Data
@TableName("t_approval_record")
@TableName("t_audit_record")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "审批记录表")
public class TApprovalRecord extends BaseEntity {
public class TAuditRecord extends BaseEntity {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import lombok.Data;
import java.time.LocalDateTime;
......@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
* @date 2025-01-10 17:47:32
*/
@Data
public class TApprovalRecordSearchVo extends TApprovalRecord {
public class TAuditRecordSearchVo extends TAuditRecord {
/**
* 多选导出或删除等操作
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditCopyInfoService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditCopyInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditNodeProocessService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodeProocessService;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TAuditRecordSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -33,12 +24,11 @@ import java.util.Map;
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tapprovalrecord" )
@RequestMapping("/tauditrecord" )
@Tag(name = "审批记录表管理")
public class TApprovalRecordController {
private final TApprovalRecordService tApprovalRecordService;
public class TAuditRecordController {
private final TAuditRecordService tAuditRecordService;
/**
* 简单分页查询
......@@ -48,8 +38,8 @@ public class TApprovalRecordController {
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TApprovalRecord>> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord) {
return new R<>(tApprovalRecordService.getTApprovalRecordPage(page,tApprovalRecord));
public R<IPage<TAuditRecord>> getTApprovalRecordPage(Page<TAuditRecord> page, TAuditRecordSearchVo tApprovalRecord) {
return new R<>(tAuditRecordService.getTApprovalRecordPage(page,tApprovalRecord));
}
/**
......@@ -64,58 +54,7 @@ public class TApprovalRecordController {
if (Common.isEmpty(domainId) || Common.isEmpty(auditType)) {
return R.failed("实体id或审核类型不能为空");
}
return tApprovalRecordService.getAuditInfoByDomainIdAndAuditType(domainId, auditType);
return tAuditRecordService.getAuditInfoByDomainIdAndAuditType(domainId, auditType);
}
/**
* 通过id查询审批记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_tapprovalrecord_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_get')" )
public R<TApprovalRecord> getById(@PathVariable("id" ) String id) {
return R.ok(tApprovalRecordService.getById(id));
}
/**
* 新增审批记录表
* @param tApprovalRecord 审批记录表
* @return R
*/
@Operation(summary = "新增审批记录表", description = "新增审批记录表:hasPermission('insurances_tapprovalrecord_add')")
@SysLog("新增审批记录表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_add')" )
public R<Boolean> save(@RequestBody TApprovalRecord tApprovalRecord) {
return R.ok(tApprovalRecordService.save(tApprovalRecord));
}
/**
* 修改审批记录表
* @param tApprovalRecord 审批记录表
* @return R
*/
@Operation(summary = "修改审批记录表", description = "修改审批记录表:hasPermission('insurances_tapprovalrecord_edit')")
@SysLog("修改审批记录表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_edit')" )
public R<Boolean> updateById(@RequestBody TApprovalRecord tApprovalRecord) {
return R.ok(tApprovalRecordService.updateById(tApprovalRecord));
}
/**
* 通过id删除审批记录表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除审批记录表", description = "通过id删除审批记录表:hasPermission('insurances_tapprovalrecord_del')")
@SysLog("通过id删除审批记录表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_tapprovalrecord_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tApprovalRecordService.removeById(id));
}
}
......@@ -12,7 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchaseApply;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo;
......@@ -200,41 +200,41 @@ public class TInsuranceUnpurchaseApplyController {
/**
* 审核
* @param tApprovalRecord 审批信息
* @param tAuditRecord 审批信息
* @return R<String>
**/
@Operation(description = "审核")
@SysLog("审核")
@PostMapping("/audit")
public R<String> audit(@RequestBody TApprovalRecord tApprovalRecord) {
if (Common.isEmpty(tApprovalRecord.getApprovalResult())) {
public R<String> audit(@RequestBody TAuditRecord tAuditRecord) {
if (Common.isEmpty(tAuditRecord.getApprovalResult())) {
return R.failed("审核结果不能为空!");
}
if (Common.isNotNull(tApprovalRecord.getApprovalOpinion()) && tApprovalRecord.getApprovalOpinion().length()> 100) {
if (Common.isNotNull(tAuditRecord.getApprovalOpinion()) && tAuditRecord.getApprovalOpinion().length()> 100) {
return R.failed("审核意见不能超过100个字");
}
if (Common.isEmpty(tApprovalRecord.getDomainId())) {
if (Common.isEmpty(tAuditRecord.getDomainId())) {
return R.failed("id不能为空!");
}
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
TInsuranceUnpurchaseApply insuranceUnpurchaseApply = tInsuranceUnpurchaseApplyService.getById(tApprovalRecord.getDomainId());
TInsuranceUnpurchaseApply insuranceUnpurchaseApply = tInsuranceUnpurchaseApplyService.getById(tAuditRecord.getDomainId());
if (Common.isEmpty(insuranceUnpurchaseApply)){
return R.failed("该实体信息不存在!");
}
String requestId;
String redisKey = CacheConstants.INSURANCEUNPURCHASE_PROCESS_CACHE.concat(tApprovalRecord.getDomainId());
String redisKey = CacheConstants.INSURANCEUNPURCHASE_PROCESS_CACHE.concat(tAuditRecord.getDomainId());
try {
requestId = RedisDistributedLock.tryLockAndTime(redisKey, "10");
} catch (Exception e) {
return R.failed(ResultConstants.REQUEST_LOCK_FAIL);
}
if (Common.isNotKong(requestId)) {
return tInsuranceUnpurchaseApplyService.auditAndCommit(insuranceUnpurchaseApply, tApprovalRecord.getApprovalResult(),
tApprovalRecord.getApprovalOpinion(), user);
return tInsuranceUnpurchaseApplyService.auditAndCommit(insuranceUnpurchaseApply, tAuditRecord.getApprovalResult(),
tAuditRecord.getApprovalOpinion(), user);
}
return R.failed(ResultConstants.REQUEST_LOCK_FAIL);
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditCopyInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 审批抄送记录信息表
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 审批主流程记录表节点表
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -17,20 +17,20 @@ import java.util.List;
* @since 1.7.5
*/
@Mapper
public interface TApprovalRecordMapper extends BaseMapper<TApprovalRecord> {
public interface TAuditRecordMapper extends BaseMapper<TAuditRecord> {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @param tAuditRecord 审批记录表
* @return
*/
IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, @Param("tApprovalRecord") TApprovalRecord tApprovalRecord);
IPage<TAuditRecord> getTAuditRecordPage(Page<TAuditRecord> page, @Param("tAuditRecord") TAuditRecord tAuditRecord);
/**
* 通过实体id和审核类型查询所有的审核记录
*
* @param domainId 实体id
* @param auditType 审核类型 0不购买商险审核
* @return List<TApprovalRecord>
* @return List<TAuditRecord>
**/
List<TApprovalRecord> getApprovalRecordList(@Param("domainId") String domainId, @Param("auditType") String auditType);
List<TAuditRecord> getAuditRecordList(@Param("domainId") String domainId, @Param("auditType") String auditType);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditCopyInfo;
/**
* 审批抄送记录信息表
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
/**
* 审批主流程记录表节点表
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TAuditRecordSearchVo;
import java.util.Map;
/**
......@@ -20,13 +16,13 @@ import java.util.Map;
* @date 2025-01-10 17:47:32
* @since 1.7.5
*/
public interface TApprovalRecordService extends IService<TApprovalRecord> {
public interface TAuditRecordService extends IService<TAuditRecord> {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @return
*/
IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord);
IPage<TAuditRecord> getTApprovalRecordPage(Page<TAuditRecord> page, TAuditRecordSearchVo tApprovalRecord);
/**
* 通过实体id和审核类型查询所有的审核记录
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditCopyInfoMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditCopyInfoService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditCopyInfo;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditCopyInfoMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditCopyInfoService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditNodeProocessMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TAuditNodeProocessService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodeProocessMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditNodeProocessService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* 审批主流程记录表节点表
*
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TApprovalRecordMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditRecordMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TAuditRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TAuditRecordSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TApprovalRecordSearchVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -24,15 +24,15 @@ import java.util.Map;
*/
@Log4j2
@Service
public class TApprovalRecordServiceImpl extends ServiceImpl<TApprovalRecordMapper, TApprovalRecord> implements TApprovalRecordService {
public class TAuditRecordServiceImpl extends ServiceImpl<TAuditRecordMapper, TAuditRecord> implements TAuditRecordService {
/**
* 审批记录表简单分页查询
* @param tApprovalRecord 审批记录表
* @return
*/
@Override
public IPage<TApprovalRecord> getTApprovalRecordPage(Page<TApprovalRecord> page, TApprovalRecordSearchVo tApprovalRecord){
return baseMapper.getTApprovalRecordPage(page,tApprovalRecord);
public IPage<TAuditRecord> getTApprovalRecordPage(Page<TAuditRecord> page, TAuditRecordSearchVo tApprovalRecord){
return baseMapper.getTAuditRecordPage(page,tApprovalRecord);
}
/**
......@@ -46,7 +46,7 @@ public class TApprovalRecordServiceImpl extends ServiceImpl<TApprovalRecordMappe
public R<Map<String, Object>> getAuditInfoByDomainIdAndAuditType(String domainId, String auditType) {
Map<String, Object> resultMap = Maps.newHashMap();
// 获取审批列表
List<TApprovalRecord> auditInfoList = baseMapper.getApprovalRecordList(domainId, auditType);
List<TAuditRecord> auditInfoList = baseMapper.getAuditRecordList(domainId, auditType);
resultMap.put("auditInfo", auditInfoList);
return new R<>(resultMap);
......
......@@ -22,6 +22,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TInsuranceUnpurchasePerson;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TInsuranceUnpurchaseApplyMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchasePersonService;
import com.yifu.cloud.plus.v1.yifu.salary.service.impl.process.TInsuranceUnpurchaseApplyAuditProcess;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplySearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchaseApplyVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonAddVo;
......@@ -32,6 +33,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -64,10 +66,9 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
@Resource
private CacheManager cacheManager;
// @Resource
// @Lazy
// private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
@Resource
@Lazy
private TInsuranceUnpurchaseApplyAuditProcess tInsuranceUnpurchaseApplyAuditProcess;
/**
* 含风险项目不购买申请表简单分页查询
......@@ -80,6 +81,7 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
return baseMapper.getTInsuranceUnpurchaseApplyPage(page, tInsuranceUnpurchaseApply);
}
@Override
public R deleteById(String id) {
TInsuranceUnpurchaseApply apply = baseMapper.selectById(id);
if (Common.isNotNull(apply)) {
......@@ -394,8 +396,8 @@ public class TInsuranceUnpurchaseApplyServiceImpl extends ServiceImpl<TInsurance
/**
* 审核数量
*
* @param userId 登录用户id
* @return IPage
* @param userId 登录用户id
* @return Map<String, Integer>
*/
@Override
public Map<String, Integer> getAuditCount(String userId) {
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl.process;
package com.yifu.cloud.plus.v1.yifu.salary.service.impl.process;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
......@@ -8,9 +8,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl.AbastractAuditProcess;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess;
import com.yifu.cloud.plus.v1.yifu.salary.service.TInsuranceUnpurchaseApplyService;
import com.yifu.cloud.plus.v1.yifu.salary.service.impl.AbastractAuditProcess;
import com.yifu.cloud.plus.v1.yifu.process.constant.ProcessConstants;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodePrimission;
import com.yifu.cloud.plus.v1.yifu.process.entity.TNodeRoute;
......@@ -24,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -37,44 +39,45 @@ import java.util.Map;
@Component
public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess<TInsuranceUnpurchaseApply, TInsuranceUnpurchaseApplySearchVo> {
// @Resource
// private TInsuranceUnpurchaseApplyService tInsuranceUnpurchaseApplyService;
@Resource
private TInsuranceUnpurchaseApplyService tInsuranceUnpurchaseApplyService;
@Override
public R<String> auditSuccess(TInsuranceUnpurchaseApply entity, TApprovalRecord approvalRecord, YifuUser loginUser) {
public R<String> auditSuccess(TInsuranceUnpurchaseApply entity, TAuditRecord approvalRecord, YifuUser loginUser) {
// 改实体审核状态为审核通过
entity.setAuditFlag(CommonConstants.THREE_STRING);
// boolean res = tInsuranceUnpurchaseApplyService.updateById(entity);
// if (res) {
// // todo 删除当前实体所有的流程节点,数据量太大影响审批效率
// // 防止死锁,先查询再删除
// TAuditNodeProocess auditNodeProocessInfo = auditNodeProocessService.getOne(Wrappers.<TAuditNodeProocess>query().lambda()
// .eq(TAuditNodeProocess::getDomainId, entity.getId())
// .in(TAuditNodeProocess::getType, approvalRecord.getAuditType())
// .last(CommonConstants.SQL_LIMIT_ONE));
// if(Common.isNotKong(auditNodeProocessInfo)) {
// auditNodeProocessService.remove(Wrappers.<TAuditNodeProocess>query().lambda().eq(TAuditNodeProocess::getDomainId, entity.getId())
// .in(TAuditNodeProocess::getType, approvalRecord.getAuditType()));
// }
// //记录末尾节点审核
// //sysMessageInfoService.saveApprovalLastAgree(CrmConstants.OPPORTUNITY_MODUL_TYPE, approvalRecord);
//
// }
entity.setAuditUser("");
entity.setAuditUserId("");
boolean res = tInsuranceUnpurchaseApplyService.updateById(entity);
if (res) {
// todo 删除当前实体所有的流程节点,数据量太大影响审批效率
// 防止死锁,先查询再删除
TAuditNodeProocess auditNodeProocessInfo = auditNodeProocessService.getOne(Wrappers.<TAuditNodeProocess>query().lambda()
.eq(TAuditNodeProocess::getDomainId, entity.getId())
.in(TAuditNodeProocess::getType, approvalRecord.getAuditType())
.last(CommonConstants.SQL_LIMIT_ONE));
if(Common.isNotKong(auditNodeProocessInfo)) {
auditNodeProocessService.remove(Wrappers.<TAuditNodeProocess>query().lambda().eq(TAuditNodeProocess::getDomainId, entity.getId())
.in(TAuditNodeProocess::getType, approvalRecord.getAuditType()));
}
}
return R.ok("审核通过");
}
@Override
public R<String> auditSuccessAndNex(TInsuranceUnpurchaseApply entity, List<SysUser> remoteSysUserList, TApprovalRecord approvalRecord) {
public R<String> auditSuccessAndNex(TInsuranceUnpurchaseApply entity, List<SysUser> remoteSysUserList, TAuditRecord approvalRecord) {
return R.ok("审核通过");
}
@Override
public R<String> auditFail(TInsuranceUnpurchaseApply entity, TApprovalRecord approvalRecord) {
public R<String> auditFail(TInsuranceUnpurchaseApply entity, TAuditRecord approvalRecord) {
// 以后有抄送再加逻辑:参照crm-更改之前抄送记录状态为0
// 改实体审核状态为审核不通过
entity.setAuditFlag(CommonConstants.FOUR_STRING);
// tInsuranceUnpurchaseApplyService.updateById(entity);
entity.setAuditUser("");
entity.setAuditUserId("");
tInsuranceUnpurchaseApplyService.updateById(entity);
// todo 删除当前实体所有的流程节点,数据量太大影响审批效率
// 防止死锁,先查询再删除
......@@ -88,8 +91,6 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
.in(TAuditNodeProocess::getType, approvalRecord.getAuditType()));
}
//记录末尾节点审核
//sysMessageInfoService.saveApprovalRejectToSubmit(CrmConstants.OPPORTUNITY_MODUL_TYPE, approvalRecord);
return R.ok("审核成功");
}
......@@ -114,7 +115,7 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
}
@Override
public R<String> sendMessage(List<SysUser> users, TInsuranceUnpurchaseApply entity, String type, TApprovalRecord approvalRecord) {
public R<String> sendMessage(List<SysUser> users, TInsuranceUnpurchaseApply entity, String type, TAuditRecord approvalRecord) {
sendMessageToWx(users,entity,type, approvalRecord);
return R.ok(null, ResultConstants.SUCCESS_INFO);
}
......@@ -144,7 +145,7 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
* 功能描述: 企业微信发送通知
* @Param: [users, customerContract, type 发送提示类型 1审批 2抄送]
*/
private void sendMessageToWx(List<SysUser> users, TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String type, TApprovalRecord approvalRecord) {
private void sendMessageToWx(List<SysUser> users, TInsuranceUnpurchaseApply insuranceUnpurchaseApply, String type, TAuditRecord approvalRecord) {
StringBuilder sendUser = null;
for (SysUser user : users) {
......@@ -197,8 +198,7 @@ public class TInsuranceUnpurchaseApplyAuditProcess extends AbastractAuditProcess
contentItemMap = new HashMap<>();
contentItemMap.put("key", "不购买人数:");
// todo 等雨辰的字段
contentItemMap.put("value", insuranceUnpurchaseApply.getDeptNo());
contentItemMap.put("value", insuranceUnpurchaseApply.getUnbuyNum());
contentItemList.add(contentItemMap);
textcard.put("content_item", contentItemList);
......
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditCopyInfoMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditCopyInfoMapper">
<resultMap id="tAuditCopyInfoMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditCopyInfo">
<resultMap id="tAuditCopyInfoMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditCopyInfo">
<id property="id" column="id"/>
<result property="auditUserId" column="audit_user_id"/>
<result property="auditUser" column="audit_user"/>
......
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TAuditNodeProocessMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditNodeProocessMapper">
<resultMap id="tAuditNodeProocessMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TAuditNodeProocess">
<resultMap id="tAuditNodeProocessMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditNodeProocess">
<id property="id" column="id"/>
<result property="processId" column="process_id"/>
<result property="nodeId" column="node_id"/>
......
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TApprovalRecordMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.salary.mapper.TAuditRecordMapper">
<resultMap id="tApprovalRecordMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TApprovalRecord">
<resultMap id="tAuditRecordMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TAuditRecord">
<id property="id" column="id"/>
<result property="flowId" column="flow_id"/>
<result property="domainId" column="domain_id"/>
......@@ -53,92 +53,92 @@
a.back_node_id,
a.add_sign_node_id
</sql>
<sql id="tApprovalRecord_where">
<if test="tApprovalRecord != null">
<if test="tApprovalRecord.id != null and tApprovalRecord.id.trim() != ''">
AND a.id = #{tApprovalRecord.id}
<sql id="tAuditRecord_where">
<if test="tAuditRecord != null">
<if test="tAuditRecord.id != null and tAuditRecord.id.trim() != ''">
AND a.id = #{tAuditRecord.id}
</if>
<if test="tApprovalRecord.flowId != null and tApprovalRecord.flowId.trim() != ''">
AND a.flow_id = #{tApprovalRecord.flowId}
<if test="tAuditRecord.flowId != null and tAuditRecord.flowId.trim() != ''">
AND a.flow_id = #{tAuditRecord.flowId}
</if>
<if test="tApprovalRecord.domainId != null and tApprovalRecord.domainId.trim() != ''">
AND a.domain_id = #{tApprovalRecord.domainId}
<if test="tAuditRecord.domainId != null and tAuditRecord.domainId.trim() != ''">
AND a.domain_id = #{tAuditRecord.domainId}
</if>
<if test="tApprovalRecord.nodeId != null and tApprovalRecord.nodeId.trim() != ''">
AND a.node_id = #{tApprovalRecord.nodeId}
<if test="tAuditRecord.nodeId != null and tAuditRecord.nodeId.trim() != ''">
AND a.node_id = #{tAuditRecord.nodeId}
</if>
<if test="tApprovalRecord.approvalMan != null and tApprovalRecord.approvalMan.trim() != ''">
AND a.approval_man = #{tApprovalRecord.approvalMan}
<if test="tAuditRecord.approvalMan != null and tAuditRecord.approvalMan.trim() != ''">
AND a.approval_man = #{tAuditRecord.approvalMan}
</if>
<if test="tApprovalRecord.approvalManName != null and tApprovalRecord.approvalManName.trim() != ''">
AND a.approval_man_name = #{tApprovalRecord.approvalManName}
<if test="tAuditRecord.approvalManName != null and tAuditRecord.approvalManName.trim() != ''">
AND a.approval_man_name = #{tAuditRecord.approvalManName}
</if>
<if test="tApprovalRecord.approvalTime != null">
AND a.approval_time = #{tApprovalRecord.approvalTime}
<if test="tAuditRecord.approvalTime != null">
AND a.approval_time = #{tAuditRecord.approvalTime}
</if>
<if test="tApprovalRecord.approvalResult != null and tApprovalRecord.approvalResult.trim() != ''">
AND a.approval_result = #{tApprovalRecord.approvalResult}
<if test="tAuditRecord.approvalResult != null and tAuditRecord.approvalResult.trim() != ''">
AND a.approval_result = #{tAuditRecord.approvalResult}
</if>
<if test="tApprovalRecord.approvalOpinion != null and tApprovalRecord.approvalOpinion.trim() != ''">
AND a.approval_opinion = #{tApprovalRecord.approvalOpinion}
<if test="tAuditRecord.approvalOpinion != null and tAuditRecord.approvalOpinion.trim() != ''">
AND a.approval_opinion = #{tAuditRecord.approvalOpinion}
</if>
<if test="tApprovalRecord.deleteFlag != null and tApprovalRecord.deleteFlag.trim() != ''">
AND a.delete_flag = #{tApprovalRecord.deleteFlag}
<if test="tAuditRecord.deleteFlag != null and tAuditRecord.deleteFlag.trim() != ''">
AND a.delete_flag = #{tAuditRecord.deleteFlag}
</if>
<if test="tApprovalRecord.preFlag != null and tApprovalRecord.preFlag.trim() != ''">
AND a.pre_flag = #{tApprovalRecord.preFlag}
<if test="tAuditRecord.preFlag != null and tAuditRecord.preFlag.trim() != ''">
AND a.pre_flag = #{tAuditRecord.preFlag}
</if>
<if test="tApprovalRecord.submitMan != null and tApprovalRecord.submitMan.trim() != ''">
AND a.submit_man = #{tApprovalRecord.submitMan}
<if test="tAuditRecord.submitMan != null and tAuditRecord.submitMan.trim() != ''">
AND a.submit_man = #{tAuditRecord.submitMan}
</if>
<if test="tApprovalRecord.submitManName != null and tApprovalRecord.submitManName.trim() != ''">
AND a.submit_man_name = #{tApprovalRecord.submitManName}
<if test="tAuditRecord.submitManName != null and tAuditRecord.submitManName.trim() != ''">
AND a.submit_man_name = #{tAuditRecord.submitManName}
</if>
<if test="tApprovalRecord.reason != null and tApprovalRecord.reason.trim() != ''">
AND a.reason = #{tApprovalRecord.reason}
<if test="tAuditRecord.reason != null and tAuditRecord.reason.trim() != ''">
AND a.reason = #{tAuditRecord.reason}
</if>
<if test="tApprovalRecord.auditType != null and tApprovalRecord.auditType.trim() != ''">
AND a.audit_type = #{tApprovalRecord.auditType}
<if test="tAuditRecord.auditType != null and tAuditRecord.auditType.trim() != ''">
AND a.audit_type = #{tAuditRecord.auditType}
</if>
<if test="tApprovalRecord.createTime != null">
AND a.create_time = #{tApprovalRecord.createTime}
<if test="tAuditRecord.createTime != null">
AND a.create_time = #{tAuditRecord.createTime}
</if>
<if test="tApprovalRecord.nodeName != null and tApprovalRecord.nodeName.trim() != ''">
AND a.node_name = #{tApprovalRecord.nodeName}
<if test="tAuditRecord.nodeName != null and tAuditRecord.nodeName.trim() != ''">
AND a.node_name = #{tAuditRecord.nodeName}
</if>
<if test="tApprovalRecord.entityName != null and tApprovalRecord.entityName.trim() != ''">
AND a.entity_name = #{tApprovalRecord.entityName}
<if test="tAuditRecord.entityName != null and tAuditRecord.entityName.trim() != ''">
AND a.entity_name = #{tAuditRecord.entityName}
</if>
<if test="tApprovalRecord.submitCreateTime != null">
AND a.submit_create_time = #{tApprovalRecord.submitCreateTime}
<if test="tAuditRecord.submitCreateTime != null">
AND a.submit_create_time = #{tAuditRecord.submitCreateTime}
</if>
<if test="tApprovalRecord.backFlag != null and tApprovalRecord.backFlag.trim() != ''">
AND a.back_flag = #{tApprovalRecord.backFlag}
<if test="tAuditRecord.backFlag != null and tAuditRecord.backFlag.trim() != ''">
AND a.back_flag = #{tAuditRecord.backFlag}
</if>
<if test="tApprovalRecord.backNodeName != null and tApprovalRecord.backNodeName.trim() != ''">
AND a.back_node_name = #{tApprovalRecord.backNodeName}
<if test="tAuditRecord.backNodeName != null and tAuditRecord.backNodeName.trim() != ''">
AND a.back_node_name = #{tAuditRecord.backNodeName}
</if>
<if test="tApprovalRecord.backNodeId != null and tApprovalRecord.backNodeId.trim() != ''">
AND a.back_node_id = #{tApprovalRecord.backNodeId}
<if test="tAuditRecord.backNodeId != null and tAuditRecord.backNodeId.trim() != ''">
AND a.back_node_id = #{tAuditRecord.backNodeId}
</if>
<if test="tApprovalRecord.addSignNodeId != null and tApprovalRecord.addSignNodeId.trim() != ''">
AND a.add_sign_node_id = #{tApprovalRecord.addSignNodeId}
<if test="tAuditRecord.addSignNodeId != null and tAuditRecord.addSignNodeId.trim() != ''">
AND a.add_sign_node_id = #{tAuditRecord.addSignNodeId}
</if>
</if>
</sql>
<!--tApprovalRecord简单分页查询-->
<select id="getTApprovalRecordPage" resultMap="tApprovalRecordMap">
<!--tAuditRecord简单分页查询-->
<select id="getTAuditRecordPage" resultMap="tAuditRecordMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_approval_record a
FROM t_audit_record a
<where>
1=1
<include refid="tApprovalRecord_where"/>
<include refid="tAuditRecord_where"/>
</where>
</select>
<!--查询审核记录数据-->
<select id="getApprovalRecordList" resultMap="tApprovalRecordMap">
<select id="getAuditRecordList" resultMap="tAuditRecordMap">
SELECT
a.id,
a.flow_id,
......@@ -156,7 +156,7 @@
a.node_name,
a.entity_name,
a.submit_create_time
FROM t_approval_record a
FROM t_audit_record a
<where>
a.domain_id = #{domainId} AND a.audit_type = #{auditType}
AND a.delete_flag = '0'
......
......@@ -142,7 +142,7 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
left join t_approval_record r on a.id=r.domain_id
left join t_audit_record r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId} and r.audit_type='0' and r.approval_result = '2' and r.delete_flag='0'
<include refid="tInsuranceUnpurchaseApply_where"/>
......@@ -155,7 +155,7 @@
<include refid="Base_Column_List"/>
FROM t_insurance_unpurchase_apply a
left join (
select min(approval_time) approval_time,domain_id,approval_man from t_approval_record
select min(approval_time) approval_time,domain_id,approval_man from t_audit_record
where approval_result in('0','1') and audit_type = '0' and delete_flag='0'
group by domain_id,approval_man
) r on a.id=r.domain_id
......@@ -163,12 +163,12 @@
a.DELETE_FLAG='0' and r.approval_man= #{userId}
<include refid="tInsuranceUnpurchaseApply_where"/>
</where>
order by r.approval_time desc
order by r.approval_time desc
</select>
<select id="getAuditCount" resultType="integer">
SELECT count(1) FROM t_insurance_unpurchase_apply a
left join t_approval_record r on a.id=r.domain_id
left join t_audit_record r on a.id=r.domain_id
<where>
a.DELETE_FLAG='0' and r.approval_man= #{userId} and r.audit_type='0' and r.approval_result = '2' and r.delete_flag='0'
</where>
......@@ -177,7 +177,7 @@
<select id="getHistoryHandleCount" resultType="integer">
SELECT count(1) FROM t_insurance_unpurchase_apply a
left join (
select min(approval_time) approval_time,domain_id,approval_man from t_approval_record
select min(approval_time) approval_time,domain_id,approval_man from t_audit_record
where approval_result in('0','1') and audit_type = '0' and delete_flag='0'
group by domain_id,approval_man
) r on a.id=r.domain_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment