fix:十二分制-移动端接口;PC端接口补充
This commit is contained in:
@@ -326,6 +326,10 @@ public enum ErrorCodeEnum {
|
||||
TP_APPLY_AUDIT_COMPLETED(1810005, "该申请单已审批", null),
|
||||
TP_EXISTS_PENDING_APPLY(1810006, "存在待审批的申请单", null),
|
||||
TP_PENALTY_APPLY_APPEAL_COMPLETED(1810007, "该处罚单已完成复议", null),
|
||||
TP_PENALTY_APPLY_EFFECTIVE(1810008, "该处罚单已生效", null),
|
||||
TP_PENALTY_APPLY_UNABLE_ACCEPT(1810009, "该处罚单无法认缴", null),
|
||||
TP_PENALTY_APPLY_INEFFECTIVE(1810010, "该处罚单未生效无法完成缴费", null),
|
||||
TP_PENALTY_APPLY_NO_NEED_PAY(1810011, "该处罚单无需缴费", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.cool.store.dao.tp;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||
import com.cool.store.mapper.tp.TpApplyFormMapper;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -11,10 +13,7 @@ import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -129,14 +128,47 @@ public class TpApplyFormDAO {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据处罚单id查询申请单
|
||||
* 根据处罚单id查询复议申请单
|
||||
* @param penaltyId 处罚单id
|
||||
* @return 申请单
|
||||
*/
|
||||
public TpApplyFormDO getByPenaltyId(Long penaltyId) {
|
||||
public TpApplyFormDO getAppealByPenaltyId(Long penaltyId) {
|
||||
return tpApplyFormMapper.selectOne(TpApplyFormDO.builder().penaltyId(penaltyId).deleted(0).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据处罚单id列表查询申请单
|
||||
* @param penaltyIds 处罚单id列表
|
||||
* @return 申请单列表
|
||||
*/
|
||||
public List<TpApplyFormDO> getByPenaltyIds(List<Long> penaltyIds) {
|
||||
if (CollectionUtils.isEmpty(penaltyIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andIn("penaltyId", penaltyIds).andEqualTo("deleted", 0);
|
||||
return tpApplyFormMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤存在正在复议的申请单
|
||||
* @param penaltyIds 处罚单id列表
|
||||
* @return 存在复议的处罚单id列表
|
||||
*/
|
||||
public Set<Long> filterExistAppeal(List<Long> penaltyIds) {
|
||||
if (CollectionUtils.isEmpty(penaltyIds)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andIn("penaltyId", penaltyIds)
|
||||
.andEqualTo("type", TpFormTypeEnum.APPEAL.getType())
|
||||
.andEqualTo("status", TpFormStatusEnum.PENDING.getStatus())
|
||||
.andEqualTo("deleted", 0);
|
||||
example.selectProperties("penaltyId");
|
||||
List<TpApplyFormDO> list = tpApplyFormMapper.selectByExample(example);
|
||||
return CollStreamUtil.toSet(list, TpApplyFormDO::getPenaltyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id列表查询
|
||||
*/
|
||||
@@ -150,12 +182,41 @@ public class TpApplyFormDAO {
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请单作废
|
||||
* @param applyId 申请单id
|
||||
* 修改申请单状态
|
||||
*/
|
||||
public void cancelApply(Long applyId) {
|
||||
public void updateStatus(Long applyId, TpFormStatusEnum status) {
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andEqualTo("id", applyId).andEqualTo("deleted", 0);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(TpFormStatusEnum.CANCEL.getStatus()).build(), example);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(status.getStatus()).build(), example);
|
||||
}
|
||||
|
||||
public void updateStatusBatch(List<Long> applyIds, TpFormStatusEnum status) {
|
||||
if (CollectionUtils.isEmpty(applyIds)) {
|
||||
return ;
|
||||
}
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andIn("id", applyIds).andEqualTo("deleted", 0);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().status(status.getStatus()).build(), example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改缴费状态
|
||||
*/
|
||||
public void updatePayStatus(Long applyId, TpPayStatusEnum payStatus) {
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andEqualTo("id", applyId).andEqualTo("deleted", 0);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().payStatus(payStatus.getStatus()).build(), example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
*/
|
||||
public void deleteByIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
Example example = new Example(TpApplyFormDO.class);
|
||||
example.createCriteria().andIn("id", ids).andEqualTo("deleted", 0);
|
||||
tpApplyFormMapper.updateByExampleSelective(TpApplyFormDO.builder().deleted(1).build(), example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.cool.store.dao.tp;
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.tp.TpAuditRecordDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.OperationLogAuditEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.tp.TpAuditRecordMapper;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -25,10 +29,11 @@ public class TpAuditRecordDAO {
|
||||
|
||||
/**
|
||||
* 新增提交记录
|
||||
* @param applyId 申请单id
|
||||
*
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
* @param userId 申请人id
|
||||
* @param userName 申请人名称
|
||||
* @param userId 申请人id
|
||||
* @param userName 申请人名称
|
||||
*/
|
||||
public void addSubmitRecord(Long applyId, Integer applyType, String userId, String userName) {
|
||||
Date now = new Date();
|
||||
@@ -47,7 +52,8 @@ public class TpAuditRecordDAO {
|
||||
|
||||
/**
|
||||
* 新增审批记录
|
||||
* @param applyId 申请单id
|
||||
*
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
*/
|
||||
public void addApproveRecord(Long applyId, Integer applyType) {
|
||||
@@ -65,10 +71,11 @@ public class TpAuditRecordDAO {
|
||||
|
||||
/**
|
||||
* 首次发起流程
|
||||
* @param applyId 申请单id
|
||||
*
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
* @param userId 申请人id
|
||||
* @param userName 申请人名称
|
||||
* @param userId 申请人id
|
||||
* @param userName 申请人名称
|
||||
*/
|
||||
public void addRecord(Long applyId, Integer applyType, String userId, String userName) {
|
||||
addSubmitRecord(applyId, applyType, userId, userName);
|
||||
@@ -77,7 +84,8 @@ public class TpAuditRecordDAO {
|
||||
|
||||
/**
|
||||
* 根据申请单id查询待审批记录
|
||||
* @param applyId 申请单id
|
||||
*
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
* @return 审批记录
|
||||
*/
|
||||
@@ -92,13 +100,14 @@ public class TpAuditRecordDAO {
|
||||
|
||||
/**
|
||||
* 根据申请单id审批待处理的审批记录
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
* @param userId 审批人id
|
||||
* @param userName 审批人名称
|
||||
*
|
||||
* @param applyId 申请单id
|
||||
* @param applyType 单据类型,0加分单 1警告书 2处罚书
|
||||
* @param userId 审批人id
|
||||
* @param userName 审批人名称
|
||||
* @param auditStatus 审批状态
|
||||
* @param remark 备注
|
||||
* @param auditTime 审批时间
|
||||
* @param remark 备注
|
||||
* @param auditTime 审批时间
|
||||
*/
|
||||
public void auditPendingRecordByApplyId(Long applyId, Integer applyType, String userId, String userName, Integer auditStatus, String remark, Date auditTime) {
|
||||
TpAuditRecordDO auditRecordDO = getPendingRecordByApplyId(applyId, applyType);
|
||||
@@ -119,4 +128,64 @@ public class TpAuditRecordDAO {
|
||||
public void updateKeySelective(TpAuditRecordDO recordDO) {
|
||||
tpAuditRecordMapper.updateByPrimaryKeySelective(recordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批记录
|
||||
* @param applyId 申请单id
|
||||
* @return 审批记录列表
|
||||
*/
|
||||
public List<AuditInfoResponse> getAuditRecordList(Long applyId) {
|
||||
Example example = new Example(TpAuditRecordDO.class);
|
||||
example.createCriteria()
|
||||
.andEqualTo("applyId", applyId)
|
||||
.andEqualTo("deleted", 0);
|
||||
example.setOrderByClause("createTime ASC");
|
||||
List<TpAuditRecordDO> recordList = tpAuditRecordMapper.selectByExample(example);
|
||||
List<AuditInfoResponse> result = new ArrayList<>();
|
||||
for (TpAuditRecordDO auditRecordDO : recordList) {
|
||||
AuditInfoResponse response = AuditInfoResponse.builder()
|
||||
.type(getAuditInfoType(auditRecordDO))
|
||||
.execute(auditRecordDO.getRecordType() - 1)
|
||||
.status(CommonConstants.INDEX_ZERO.equals(auditRecordDO.getAuditStatus()) ? 0 : 1)
|
||||
.createTime(auditRecordDO.getReceiveTaskTime())
|
||||
.remark(auditRecordDO.getRemark())
|
||||
.actualUserId(auditRecordDO.getHandlerUserId())
|
||||
.build();
|
||||
List<AuditInfoResponse.AuditUserInfoVO> auditUserList = Collections.singletonList(
|
||||
new AuditInfoResponse.AuditUserInfoVO(auditRecordDO.getHandlerUserId(), auditRecordDO.getHandlerUserName(), null)
|
||||
);
|
||||
response.setList(auditUserList);
|
||||
result.add(response);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Integer getAuditInfoType(TpAuditRecordDO auditRecordDO) {
|
||||
if (CommonConstants.INDEX_ONE.equals(auditRecordDO.getRecordType())) {
|
||||
return OperationLogAuditEnum.SUBMIT_AUDIT.getCode();
|
||||
} else {
|
||||
switch (auditRecordDO.getAuditStatus()) {
|
||||
case 0:
|
||||
return OperationLogAuditEnum.WAIT_AUDIT.getCode();
|
||||
case 1:
|
||||
return OperationLogAuditEnum.PASS.getCode();
|
||||
case 2:
|
||||
return OperationLogAuditEnum.REFUSE.getCode();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据申请单id删除
|
||||
*/
|
||||
public void deleteByApplyIds(List<Long> applyIds) {
|
||||
if (CollectionUtils.isEmpty(applyIds)) {
|
||||
return;
|
||||
}
|
||||
Example example = new Example(TpAuditRecordDO.class);
|
||||
example.createCriteria().andIn("applyId", applyIds).andEqualTo("deleted", 0);
|
||||
tpAuditRecordMapper.updateByExampleSelective(TpAuditRecordDO.builder().deleted(1).build(), example);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,11 @@
|
||||
<if test="ruleId != null and ruleId != ''">
|
||||
AND a.rule_id = #{ruleId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND a.status = #{status}
|
||||
<if test="statusList != null and !statusList.isEmpty()">
|
||||
AND a.status IN
|
||||
<foreach collection="statusList" item="status" separator="," open="(" close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND a.type = #{type}
|
||||
@@ -83,6 +86,9 @@
|
||||
<if test="appealReason != null and appealReason != ''">
|
||||
AND b.appeal_reason LIKE CONCAT('%', #{appealReason}, '%')
|
||||
</if>
|
||||
<if test="isDraft != null">
|
||||
AND b.is_draft = #{isDraft}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.cool.store.request.tp;
|
||||
|
||||
import com.cool.store.common.PageBasicInfo;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -28,9 +33,12 @@ public class TpApplyQueryRequest extends PageBasicInfo {
|
||||
@ApiModelProperty("规则id")
|
||||
private String ruleId;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
@ApiModelProperty("状态,可多选逗号隔开")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "状态列表", hidden = true)
|
||||
private List<String> statusList;
|
||||
|
||||
@ApiModelProperty(value = "单据类型,0加分单 1警告书 2处罚书")
|
||||
private Integer type;
|
||||
|
||||
@@ -45,4 +53,16 @@ public class TpApplyQueryRequest extends PageBasicInfo {
|
||||
|
||||
@ApiModelProperty("复议理由")
|
||||
private String appealReason;
|
||||
|
||||
@ApiModelProperty("是否为草稿")
|
||||
private Integer isDraft;
|
||||
|
||||
public List<String> getStatusList() {
|
||||
if (StringUtils.isNotBlank(this.status)) {
|
||||
return null;
|
||||
}
|
||||
return Arrays.stream(this.status.split(CommonConstants.COMMA))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ import java.util.List;
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class AuditInfoResponse {
|
||||
|
||||
@ApiModelProperty("操作人集合")
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.vo.tp.mini;
|
||||
|
||||
import com.cool.store.annotation.DictField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini复议信息VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class MiniTpAppealVO {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String applicantName;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("复议理由")
|
||||
private String appealReason;
|
||||
|
||||
@ApiModelProperty("复议理由名称")
|
||||
@DictField
|
||||
private String appealReasonName;
|
||||
|
||||
@ApiModelProperty("复议详细理由")
|
||||
private String appealDetailReason;
|
||||
|
||||
@ApiModelProperty("证明材料")
|
||||
private String proofUrls;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.cool.store.vo.tp.mini;
|
||||
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini申请单列表VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class MiniTpApplyListVO {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("单据类型,0加分单 1警告书 2处罚书")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("单据类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("状态名称")
|
||||
private String statusName;
|
||||
|
||||
@ApiModelProperty("是否为草稿")
|
||||
private Integer isDraft;
|
||||
|
||||
@ApiModelProperty("是否复议中")
|
||||
private Integer isAppeal;
|
||||
|
||||
public String getTypeName() {
|
||||
return TpFormTypeEnum.getMsgByType(this.type);
|
||||
}
|
||||
|
||||
public String getStatusName() {
|
||||
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.cool.store.vo.tp.mini;
|
||||
|
||||
import com.cool.store.annotation.DictField;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini惩处申请单详情VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class MiniTpPenaltyApplyVO {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("申请单号")
|
||||
private String applyNo;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目大类")
|
||||
private String projectCategory;
|
||||
|
||||
@ApiModelProperty("项目大类名称")
|
||||
@DictField
|
||||
private String projectCategoryName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("申请人名称")
|
||||
private String applyUserName;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("缴费状态")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty("缴费状态名称")
|
||||
private String payStatusName;
|
||||
|
||||
@ApiModelProperty("状态名称")
|
||||
private String statusName;
|
||||
|
||||
@ApiModelProperty("分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("复议截止日期")
|
||||
private LocalDate appealEndDate;
|
||||
|
||||
@ApiModelProperty("证明图片列表")
|
||||
private String proofUrls;
|
||||
|
||||
@ApiModelProperty("复议申请")
|
||||
private MiniTpAppealVO appeal;
|
||||
|
||||
public String getStatusName() {
|
||||
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||
}
|
||||
|
||||
public String getPayStatusName() {
|
||||
return TpPayStatusEnum.getMsgByStatus(this.payStatus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.cool.store.vo.tp.mini;
|
||||
|
||||
import com.cool.store.annotation.DictField;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini加分申请单详情VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Data
|
||||
public class MiniTpRewardApplyVO {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("申请单号")
|
||||
private String applyNo;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目大类")
|
||||
private String projectCategory;
|
||||
|
||||
@ApiModelProperty("项目大类名称")
|
||||
@DictField
|
||||
private String projectCategoryName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("状态名称")
|
||||
private String statusName;
|
||||
|
||||
@ApiModelProperty("分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("证明图片列表")
|
||||
private String proofUrls;
|
||||
|
||||
public String getStatusName() {
|
||||
return TpFormStatusEnum.getMsgByStatus(this.status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.cool.store.vo.tp.mini;
|
||||
|
||||
import com.cool.store.annotation.DictField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mini奖惩规则列表VO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/11
|
||||
*/
|
||||
@Data
|
||||
public class MiniTpRuleListVO {
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("问题分类")
|
||||
private String problemClassification;
|
||||
|
||||
@ApiModelProperty("问题分类名称")
|
||||
@DictField
|
||||
private String problemClassificationName;
|
||||
|
||||
@ApiModelProperty("项目大类")
|
||||
private String projectCategory;
|
||||
|
||||
@ApiModelProperty("项目大类名称")
|
||||
@DictField
|
||||
private String projectCategoryName;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("警告上限次数")
|
||||
private Integer warningLimit;
|
||||
|
||||
@ApiModelProperty("分值")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("是否加满,0否 1是")
|
||||
private Integer isFull;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("项目描述")
|
||||
private String remark;
|
||||
}
|
||||
@@ -28,7 +28,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class DictService {
|
||||
private final SysDictColumnDAO columnDAO;
|
||||
private final Map<Class<?>, List<Pair<Field, Field>>> dictFieldCache = new ConcurrentHashMap<>();
|
||||
private final Map<Class<?>, Field[]> fieldCache = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 填充字典字段
|
||||
*/
|
||||
public <T> void fillDictField(T obj) {
|
||||
fillDictField(Collections.singletonList(obj));
|
||||
}
|
||||
@@ -41,12 +45,20 @@ public class DictService {
|
||||
return;
|
||||
}
|
||||
Class<?> clazz = objs.get(0).getClass();
|
||||
fillDictField(objs, clazz, new HashSet<>());
|
||||
}
|
||||
|
||||
private <T> void fillDictField(List<T> objs, Class<?> clazz, Set<Object> processedObjects) {
|
||||
List<Pair<Field, Field>> dictFields = getDictField(clazz);
|
||||
if (CollectionUtils.isEmpty(dictFields)) {
|
||||
return;
|
||||
}
|
||||
Set<String> columnCodes = new HashSet<>();
|
||||
List<T> validObjs = new ArrayList<>();
|
||||
for (T obj : objs) {
|
||||
if (obj == null || processedObjects.contains(obj)) continue;
|
||||
processedObjects.add(obj);
|
||||
validObjs.add(obj);
|
||||
for (Pair<Field, Field> dictField : dictFields) {
|
||||
try {
|
||||
Object value = dictField.getValue().get(obj);
|
||||
@@ -58,19 +70,71 @@ public class DictService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (columnCodes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<String, String> nameMap = columnDAO.getNameMapByCodes(new ArrayList<>(columnCodes));
|
||||
for (T obj : objs) {
|
||||
for (Pair<Field, Field> dictField : dictFields) {
|
||||
try {
|
||||
dictField.getKey().set(obj, nameMap.get((String) dictField.getValue().get(obj)));
|
||||
} catch (IllegalAccessException e) {
|
||||
log.info("字典字段值填充失败", e);
|
||||
if (!columnCodes.isEmpty()) {
|
||||
Map<String, String> nameMap = columnDAO.getNameMapByCodes(new ArrayList<>(columnCodes));
|
||||
for (T obj : objs) {
|
||||
for (Pair<Field, Field> dictField : dictFields) {
|
||||
try {
|
||||
dictField.getKey().set(obj, nameMap.get((String) dictField.getValue().get(obj)));
|
||||
} catch (IllegalAccessException e) {
|
||||
log.info("字典字段值填充失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
processNestedObjects(validObjs, clazz, processedObjects);
|
||||
}
|
||||
|
||||
private <T> void processNestedObjects(List<T> objs, Class<?> clazz, Set<Object> processedObjects) {
|
||||
Field[] fields = getFieldCache(clazz);
|
||||
for (Field field : fields) {
|
||||
if (isComplexObjectField(field)) {
|
||||
field.setAccessible(true);
|
||||
|
||||
for (T obj : objs) {
|
||||
if (obj == null) continue;
|
||||
|
||||
try {
|
||||
Object fieldValue = field.get(obj);
|
||||
if (fieldValue != null) {
|
||||
if (fieldValue instanceof Collection) {
|
||||
// 处理集合类型字段
|
||||
Collection<?> collection = (Collection<?>) fieldValue;
|
||||
List<Object> nestedObjs = new ArrayList<>();
|
||||
for (Object item : collection) {
|
||||
if (item != null && isComplexObject(item.getClass())) {
|
||||
nestedObjs.add(item);
|
||||
}
|
||||
}
|
||||
if (!nestedObjs.isEmpty()) {
|
||||
fillDictField(nestedObjs, nestedObjs.get(0).getClass(), new HashSet<>(processedObjects));
|
||||
}
|
||||
} else if (isComplexObject(fieldValue.getClass())) {
|
||||
// 处理单一对象类型字段
|
||||
fillDictField(Collections.singletonList(fieldValue), fieldValue.getClass(), processedObjects);
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
log.info("嵌套对象字段获取失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isComplexObjectField(Field field) {
|
||||
Class<?> fieldType = field.getType();
|
||||
return isComplexObject(fieldType);
|
||||
}
|
||||
|
||||
private boolean isComplexObject(Class<?> clazz) {
|
||||
return !clazz.isPrimitive() &&
|
||||
!clazz.getName().startsWith("java") &&
|
||||
!clazz.equals(String.class);
|
||||
}
|
||||
|
||||
private Field[] getFieldCache(Class<?> clazz) {
|
||||
return fieldCache.computeIfAbsent(clazz, Class::getDeclaredFields);
|
||||
}
|
||||
|
||||
private <T> List<Pair<Field, Field>> getDictField(Class<T> clazz) {
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.cool.store.service.tp;
|
||||
|
||||
import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||
import com.cool.store.request.tp.TpApplyAuditRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.request.tp.TpApplyRequest;
|
||||
import com.cool.store.request.tp.*;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.vo.tp.*;
|
||||
import com.cool.store.vo.tp.mini.MiniTpApplyListVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpPenaltyApplyVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpRewardApplyVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpRuleListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制-申请单 服务类
|
||||
@@ -100,4 +104,60 @@ public interface TpApplyService {
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean appealAudit(TpApplyAuditRequest request);
|
||||
|
||||
/**
|
||||
* 批量删除申请单
|
||||
* @param applyIds 申请单id列表
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean deleteBatch(List<Long> applyIds);
|
||||
|
||||
/**
|
||||
* 获取审批列表
|
||||
* @param applyId 申请单id
|
||||
* @return 审批记录列表
|
||||
*/
|
||||
List<AuditInfoResponse> getAuditRecordList(Long applyId);
|
||||
|
||||
/**
|
||||
* Mini获取申请单列表
|
||||
* @param request 申请单查询Request
|
||||
* @return Mini申请单列表VO列表
|
||||
*/
|
||||
PageInfo<MiniTpApplyListVO> getMiniApplyList(TpApplyQueryRequest request);
|
||||
|
||||
/**
|
||||
* Mini获取加分申请单详情
|
||||
* @param applyId 申请单id
|
||||
* @return Mini加分申请单详情VO
|
||||
*/
|
||||
MiniTpRewardApplyVO getMiniRewardApplyDetail(Long applyId);
|
||||
|
||||
/**
|
||||
* Mini获取惩处申请单详情
|
||||
* @param applyId 申请单id
|
||||
* @return Mini惩处申请单详情VO
|
||||
*/
|
||||
MiniTpPenaltyApplyVO getMiniPenaltyApplyDetail(Long applyId);
|
||||
|
||||
/**
|
||||
* Mini规则分页查询
|
||||
* @param request 规则查询Request
|
||||
* @return Mini奖惩规则列表VO列表
|
||||
*/
|
||||
PageInfo<MiniTpRuleListVO> getMiniRulePage(TpRuleQueryRequest request);
|
||||
|
||||
/**
|
||||
* 认罚缴款
|
||||
* @param applyId 惩处申请单id
|
||||
* @return java.lang.Boolean
|
||||
*/
|
||||
Boolean acceptPenalty(Long applyId);
|
||||
|
||||
/**
|
||||
* 完成缴费
|
||||
* @param applyId 惩处申请单id
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean completePayment(Long applyId);
|
||||
}
|
||||
|
||||
@@ -16,15 +16,14 @@ import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
import com.cool.store.enums.tp.TpPayStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||
import com.cool.store.request.tp.TpApplyAuditRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.request.tp.TpApplyRequest;
|
||||
import com.cool.store.request.tp.*;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.service.dict.impl.DictService;
|
||||
import com.cool.store.service.tp.TpApplyService;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
import com.cool.store.utils.TpHelper;
|
||||
import com.cool.store.vo.tp.*;
|
||||
import com.cool.store.vo.tp.mini.*;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -198,20 +197,31 @@ public class TpApplyServiceImpl implements TpApplyService {
|
||||
public Boolean appealApplySubmit(TpAppealApplyRequest request) {
|
||||
TpApplyFormDO formDO = BeanUtil.toBean(request, TpApplyFormDO.class);
|
||||
boolean isDraft = CommonConstants.INDEX_ONE.equals(request.getIsDraft());
|
||||
TpApplyFormDO punishFormDO = tpApplyFormDAO.getByPenaltyId(request.getPenaltyId());
|
||||
if (Objects.nonNull(punishFormDO) && !isDraft) {
|
||||
if (TpFormStatusEnum.PENDING.getStatus().equals(punishFormDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_EXISTS_PENDING_APPLY);
|
||||
TpApplyFormDO penaltyFormDO = tpApplyFormDAO.getEffectiveById(request.getPenaltyId());
|
||||
if (Objects.isNull(penaltyFormDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||
}
|
||||
if (!isDraft) {
|
||||
TpApplyFormDO appealFormDO = tpApplyFormDAO.getAppealByPenaltyId(request.getPenaltyId());
|
||||
// 存在待审批或已审批的复议申请单
|
||||
if (Objects.nonNull(appealFormDO)) {
|
||||
if (TpFormStatusEnum.PENDING.getStatus().equals(appealFormDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_EXISTS_PENDING_APPLY);
|
||||
}
|
||||
if (TpFormStatusEnum.PASS.getStatus().equals(appealFormDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_APPEAL_COMPLETED);
|
||||
}
|
||||
}
|
||||
if (TpFormStatusEnum.PASS.getStatus().equals(punishFormDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_APPEAL_COMPLETED);
|
||||
// 已生效的无法复议
|
||||
if (TpFormStatusEnum.EFFECTIVE.getStatus().equals(penaltyFormDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_EFFECTIVE);
|
||||
}
|
||||
}
|
||||
boolean isInsert = Objects.isNull(request.getId());
|
||||
formDO.setApplyNo(isInsert ? TpHelper.generateAppealNo() : null);
|
||||
formDO.setRuleId(punishFormDO.getRuleId());
|
||||
formDO.setRuleId(penaltyFormDO.getRuleId());
|
||||
formDO.setType(TpFormTypeEnum.APPEAL.getType());
|
||||
formDO.setStoreId(punishFormDO.getStoreId());
|
||||
formDO.setStoreId(penaltyFormDO.getStoreId());
|
||||
fillRuleFields(formDO);
|
||||
tpApplyFormDAO.insertOrUpdate(formDO);
|
||||
// 第一次提交后添加审批记录
|
||||
@@ -267,6 +277,95 @@ public class TpApplyServiceImpl implements TpApplyService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean deleteBatch(List<Long> applyIds) {
|
||||
tpApplyFormDAO.deleteByIds(applyIds);
|
||||
// 删除审批记录
|
||||
tpAuditRecordDAO.deleteByApplyIds(applyIds);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuditInfoResponse> getAuditRecordList(Long applyId) {
|
||||
return tpAuditRecordDAO.getAuditRecordList(applyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MiniTpApplyListVO> getMiniApplyList(TpApplyQueryRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||
PageInfo<TpApplyFormDO> page = new PageInfo<>(list);
|
||||
PageInfo<MiniTpApplyListVO> newPage = BeanUtil.toPage(page, MiniTpApplyListVO.class);
|
||||
List<MiniTpApplyListVO> applyList = newPage.getList();
|
||||
if (Boolean.TRUE.equals(request.getIsPenalty()) && CollectionUtils.isNotEmpty(applyList)) {
|
||||
List<Long> applyIds = CollStreamUtil.toList(applyList, MiniTpApplyListVO::getId);
|
||||
Set<Long> existAppealSet = tpApplyFormDAO.filterExistAppeal(applyIds);
|
||||
applyList.forEach(v -> v.setIsAppeal(existAppealSet.contains(v.getId()) ? 1 : 0));
|
||||
}
|
||||
return newPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiniTpRewardApplyVO getMiniRewardApplyDetail(Long applyId) {
|
||||
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||
return BeanUtil.toBean(formDO, MiniTpRewardApplyVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MiniTpPenaltyApplyVO getMiniPenaltyApplyDetail(Long applyId) {
|
||||
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||
if (Objects.nonNull(formDO)) {
|
||||
MiniTpPenaltyApplyVO vo = BeanUtil.toBean(formDO, MiniTpPenaltyApplyVO.class);
|
||||
TpApplyFormDO appealForm = tpApplyFormDAO.getAppealByPenaltyId(formDO.getPenaltyId());
|
||||
vo.setAppeal(BeanUtil.toBean(appealForm, MiniTpAppealVO.class));
|
||||
dictService.fillDictField(vo);
|
||||
return vo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MiniTpRuleListVO> getMiniRulePage(TpRuleQueryRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<TpRuleDO> list = tpRuleDAO.getEffectiveList(request);
|
||||
PageInfo<TpRuleDO> page = new PageInfo<>(list);
|
||||
PageInfo<MiniTpRuleListVO> newPage = BeanUtil.toPage(page, MiniTpRuleListVO.class);
|
||||
dictService.fillDictField(newPage.getList());
|
||||
return newPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean acceptPenalty(Long applyId) {
|
||||
// 校验申请单状态是否为审批通过
|
||||
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||
if (Objects.isNull(formDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||
}
|
||||
if (!TpFormStatusEnum.PASS.getStatus().equals(formDO.getStatus())) {
|
||||
log.info("非审批通过状态无法认缴");
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_UNABLE_ACCEPT);
|
||||
}
|
||||
tpApplyFormDAO.updateStatus(applyId, TpFormStatusEnum.EFFECTIVE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean completePayment(Long applyId) {
|
||||
TpApplyFormDO formDO = tpApplyFormDAO.getEffectiveById(applyId);
|
||||
if (Objects.isNull(formDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_NOT_EXIST_APPLY_FORM);
|
||||
}
|
||||
if (!TpFormStatusEnum.EFFECTIVE.getStatus().equals(formDO.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_INEFFECTIVE);
|
||||
}
|
||||
if (TpPayStatusEnum.NO_NEED_PAY.getStatus().equals(formDO.getPayStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.TP_PENALTY_APPLY_NO_NEED_PAY);
|
||||
}
|
||||
tpApplyFormDAO.updatePayStatus(applyId, TpPayStatusEnum.PAID);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批通用方法
|
||||
*/
|
||||
@@ -293,7 +392,7 @@ public class TpApplyServiceImpl implements TpApplyService {
|
||||
private void appealPassResolve(TpApplyFormDO formDO) {
|
||||
if (TpFormStatusEnum.PASS.getStatus().equals(formDO.getStatus())) {
|
||||
// 申诉通过后,处罚单失效
|
||||
tpApplyFormDAO.cancelApply(formDO.getPenaltyId());
|
||||
tpApplyFormDAO.updateStatus(formDO.getPenaltyId(), TpFormStatusEnum.CANCEL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||
import com.cool.store.request.tp.TpApplyAuditRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.request.tp.TpApplyRequest;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.tp.TpApplyService;
|
||||
import com.cool.store.vo.tp.*;
|
||||
@@ -19,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -65,7 +67,6 @@ public class TpApplyController {
|
||||
return ResponseResult.success(tpApplyService.rewardAudit(request));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("惩处申请提交or保存")
|
||||
@PostMapping("/penaltyApplySubmit")
|
||||
public ResponseResult<Boolean> penaltyApplySubmit(@RequestBody @Validated TpApplyRequest request) {
|
||||
@@ -125,4 +126,24 @@ public class TpApplyController {
|
||||
public ResponseResult<Boolean> appealAudit(@RequestBody @Validated TpApplyAuditRequest request) {
|
||||
return ResponseResult.success(tpApplyService.appealAudit(request));
|
||||
}
|
||||
|
||||
@ApiOperation("根据申请单id批量删除")
|
||||
@PostMapping("/deleteBatch")
|
||||
public ResponseResult<Boolean> deleteBatch(@RequestBody List<Long> applyIds) {
|
||||
return ResponseResult.success(tpApplyService.deleteBatch(applyIds));
|
||||
}
|
||||
|
||||
@ApiOperation("审批记录列表")
|
||||
@GetMapping("/auditRecords")
|
||||
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<List<AuditInfoResponse>> auditRecords(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.getAuditRecordList(applyId));
|
||||
}
|
||||
|
||||
@ApiOperation("完成缴费")
|
||||
@PostMapping("/completePayment")
|
||||
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<Boolean> completePayment(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.completePayment(applyId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.cool.store.controller.webc;
|
||||
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.enums.tp.TpFormTypeEnum;
|
||||
import com.cool.store.request.tp.TpAppealApplyRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.request.tp.TpApplyRequest;
|
||||
import com.cool.store.request.tp.TpRuleQueryRequest;
|
||||
import com.cool.store.response.AuditInfoResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.tp.TpApplyService;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpApplyListVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpPenaltyApplyVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpRewardApplyVO;
|
||||
import com.cool.store.vo.tp.mini.MiniTpRuleListVO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 十二分制-申请单 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/11/10
|
||||
*/
|
||||
@Api(tags = "十二分制-申请单")
|
||||
@RestController
|
||||
@RequestMapping("/mini/tp/apply")
|
||||
@RequiredArgsConstructor
|
||||
public class MiniTpApplyController {
|
||||
private final TpApplyService tpApplyService;
|
||||
|
||||
@ApiOperation("加分申请提交or保存")
|
||||
@PostMapping("/rewardApplySubmit")
|
||||
public ResponseResult<Boolean> rewardApplySubmit(@RequestBody @Validated TpApplyRequest request) {
|
||||
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||
request.setSource(1);
|
||||
request.setApplyUserId(user.getPartnerId());
|
||||
request.setApplyUserName(user.getUsername());
|
||||
return ResponseResult.success(tpApplyService.rewardApplySubmit(request));
|
||||
}
|
||||
|
||||
@ApiOperation("加分申请单详情")
|
||||
@GetMapping("/rewardDetail")
|
||||
@ApiImplicitParam(name = "applyId", value = "加分申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<MiniTpRewardApplyVO> rewardDetail(@NotNull(message = "加分申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.getMiniRewardApplyDetail(applyId));
|
||||
}
|
||||
|
||||
@ApiOperation("加分申请单分页查询")
|
||||
@GetMapping("/rewardPage")
|
||||
public ResponseResult<PageInfo<MiniTpApplyListVO>> rewardPage(TpApplyQueryRequest request) {
|
||||
request.setType(TpFormTypeEnum.REWARD.getType());
|
||||
return ResponseResult.success(tpApplyService.getMiniApplyList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("惩处申请单详情")
|
||||
@GetMapping("/penaltyDetail")
|
||||
@ApiImplicitParam(name = "applyId", value = "惩处申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<MiniTpPenaltyApplyVO> penaltyDetail(@NotNull(message = "惩处申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.getMiniPenaltyApplyDetail(applyId));
|
||||
}
|
||||
|
||||
@ApiOperation("惩处申请单分页查询")
|
||||
@GetMapping("/penaltyPage")
|
||||
public ResponseResult<PageInfo<MiniTpApplyListVO>> penaltyPage(TpApplyQueryRequest request) {
|
||||
request.setIsPenalty(true);
|
||||
request.setIsDraft(0);
|
||||
return ResponseResult.success(tpApplyService.getMiniApplyList(request));
|
||||
}
|
||||
|
||||
@ApiOperation("复议申请提交or保存")
|
||||
@PostMapping("/appealApplySubmit")
|
||||
public ResponseResult<Boolean> appealApplySubmit(@RequestBody @Validated TpAppealApplyRequest request) {
|
||||
PartnerUserInfoVO user = PartnerUserHolder.getUser();
|
||||
request.setSource(1);
|
||||
request.setApplyUserId(user.getPartnerId());
|
||||
request.setApplyUserName(user.getUsername());
|
||||
return ResponseResult.success(tpApplyService.appealApplySubmit(request));
|
||||
}
|
||||
|
||||
@ApiOperation("审批记录列表")
|
||||
@GetMapping("/auditRecords")
|
||||
@ApiImplicitParam(name = "applyId", value = "申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<List<AuditInfoResponse>> auditRecords(@NotNull(message = "申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.getAuditRecordList(applyId));
|
||||
}
|
||||
|
||||
@ApiOperation("规则分页查询")
|
||||
@GetMapping("/rulePage")
|
||||
@ApiImplicitParam(name = "type", value = "规则类型,0惩处 1加分", required = true, dataType = "Integer", paramType = "query")
|
||||
public ResponseResult<PageInfo<MiniTpRuleListVO>> rewardRulePage(@NotNull(message = "规则类型不能为空") Integer type) {
|
||||
TpRuleQueryRequest request = new TpRuleQueryRequest();
|
||||
request.setType(type);
|
||||
request.setStatus(1);
|
||||
return ResponseResult.success(tpApplyService.getMiniRulePage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("认罚缴款")
|
||||
@PostMapping("/acceptPenalty")
|
||||
@ApiImplicitParam(name = "applyId", value = "惩处申请单id", required = true, dataType = "Long", paramType = "query")
|
||||
public ResponseResult<Boolean> acceptPenalty(@NotNull(message = "惩处申请单id不能为空") Long applyId) {
|
||||
return ResponseResult.success(tpApplyService.acceptPenalty(applyId));
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,16 @@
|
||||
package com.cool.store.job;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dao.tp.TpApplyFormDAO;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
import com.cool.store.dto.store.StoreOrderTimeDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.entity.tp.TpApplyFormDO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.enums.tp.TpFormStatusEnum;
|
||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.mapper.TrainingExperienceMapper;
|
||||
@@ -22,39 +18,28 @@ import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.request.bigdata.LatestOrderDateRequest;
|
||||
import com.cool.store.request.xfsgFirstOrderListRequest;
|
||||
import com.cool.store.request.tp.TpApplyQueryRequest;
|
||||
import com.cool.store.response.bigdata.LatestOrderDateResponse;
|
||||
import com.cool.store.response.xfsgFirstOderListResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.service.tp.TpApplyService;
|
||||
import com.cool.store.utils.MDCUtils;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.xxl.job.core.context.XxlJobHelper;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@@ -121,6 +106,10 @@ public class XxlJobHandler {
|
||||
StoreDao storeDao;
|
||||
@Resource
|
||||
ThirdBigDataService thirdBigDataService;
|
||||
@Resource
|
||||
TpApplyFormDAO tpApplyFormDAO;
|
||||
@Resource
|
||||
TpApplyService tpApplyService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -457,4 +446,36 @@ public class XxlJobHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 十二分制惩处申请单复议逾期
|
||||
*/
|
||||
@XxlJob("tpPenaltyAppealOverdue")
|
||||
public void tpPenaltyAppealOverdue() {
|
||||
MDCUtils.put(CommonConstants.REQUEST_ID, UUID.randomUUID().toString());
|
||||
log.info("------start tpPenaltyAppealOverdue------");
|
||||
boolean hasNext = true;
|
||||
int pageNum = 1;
|
||||
int pageSize = CommonConstants.BATCH_SIZE;
|
||||
TpApplyQueryRequest request = new TpApplyQueryRequest();
|
||||
request.setStatus(TpFormStatusEnum.PASS.getStatus());
|
||||
request.setIsPenalty(true);
|
||||
request.setIsDraft(0);
|
||||
while (hasNext) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<TpApplyFormDO> list = tpApplyFormDAO.getEffectiveList(request);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
break;
|
||||
}
|
||||
hasNext = list.size() >= pageSize;
|
||||
List<Long> applyIds = CollStreamUtil.toList(list, TpApplyFormDO::getId);
|
||||
try {
|
||||
tpApplyFormDAO.updateStatusBatch(applyIds, TpFormStatusEnum.EFFECTIVE);
|
||||
} catch (Exception e) {
|
||||
log.error("超过申诉期,更新申请单状态失败", e);
|
||||
}
|
||||
pageNum++;
|
||||
}
|
||||
log.info("------end tpPenaltyAppealOverdue------");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user