Commit 4f997c00 authored by chenyuxi's avatar chenyuxi

feat: 移代码到薪资服务里

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