Browse Source

添加核销重复提交拦截;添加批量导入实体类

v1.0
Yen 2 years ago
parent
commit
7a8753741c
  1. 127
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetBatch.java
  2. 14
      src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetBatchMapper.java
  3. 14
      src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetBatchService.java
  4. 22
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java
  5. 10
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java
  6. 1
      src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationController.java
  7. 9
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

127
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetBatch.java

@ -0,0 +1,127 @@
package com.qs.serve.modules.tbs.entity;
import java.time.LocalDate;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
/**
* 批量申请 实体类
* @author YenHex
* @since 2023-08-24
*/
@Data
@TableName("tbs_budget_batch")
public class TbsBudgetBatch implements Serializable {
private static final long serialVersionUID = 1L;
/** id */
@TableId(type = IdType.AUTO)
private Long id;
/** 批次标题 */
@NotBlank(message = "批次标题不能为空")
@Length(max = 255,message = "批次标题长度不能超过255字")
private String batchTitle;
/** 批次编码 */
@NotBlank(message = "批次编码不能为空")
@Length(max = 50,message = "批次编码长度不能超过50字")
private String batchCode;
/** 状态 */
@NotNull(message = "状态不能为空")
private Integer batchState;
/** 致远表单id */
@Length(max = 255,message = "致远表单id长度不能超过255字")
private String syFormId;
/** 用户id */
@Length(max = 255,message = "用户id长度不能超过255字")
private String userId;
/** 用户编码 */
@Length(max = 255,message = "用户编码长度不能超过255字")
private String userCode;
/** 用户 */
@Length(max = 255,message = "用户长度不能超过255字")
private String userName;
/** 提交审批时间 */
@Length(max = 0,message = "提交审批时间长度不能超过0字")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime submitTime;
/** 备注 */
@Length(max = 255,message = "备注长度不能超过255字")
private String remark;
/** 创建时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/** 最后更新时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@TableField(fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
/** 所属租户 */
@JsonIgnore
@JsonProperty
private String tenantId;
/** 创建人 */
@TableField(fill = FieldFill.INSERT)
private String createBy;
/** 更新人 */
@TableField(fill = FieldFill.UPDATE)
private String updateBy;
/** 逻辑删除标记(0:显示;1:隐藏) */
@JsonIgnore
@JsonProperty
private String delFlag;
public static TbsBudgetBatch toNewObject(TbsBudgetBatch source){
TbsBudgetBatch budgetBatch = new TbsBudgetBatch();
budgetBatch.setId(source.getId());
budgetBatch.setBatchTitle(source.getBatchTitle());
budgetBatch.setBatchCode(source.getBatchCode());
budgetBatch.setBatchState(source.getBatchState());
budgetBatch.setSyFormId(source.getSyFormId());
budgetBatch.setUserId(source.getUserId());
budgetBatch.setUserCode(source.getUserCode());
budgetBatch.setUserName(source.getUserName());
budgetBatch.setSubmitTime(source.getSubmitTime());
budgetBatch.setRemark(source.getRemark());
budgetBatch.setCreateTime(source.getCreateTime());
budgetBatch.setUpdateTime(source.getUpdateTime());
budgetBatch.setTenantId(source.getTenantId());
budgetBatch.setCreateBy(source.getCreateBy());
budgetBatch.setUpdateBy(source.getUpdateBy());
budgetBatch.setDelFlag(source.getDelFlag());
return budgetBatch;
}
}

14
src/main/java/com/qs/serve/modules/tbs/mapper/TbsBudgetBatchMapper.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.tbs.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.tbs.entity.TbsBudgetBatch;
/**
* 批量申请 Mapper
* @author YenHex
* @date 2023-08-24
*/
public interface TbsBudgetBatchMapper extends BaseMapper<TbsBudgetBatch> {
}

14
src/main/java/com/qs/serve/modules/tbs/service/TbsBudgetBatchService.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.tbs.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.serve.modules.tbs.entity.TbsBudgetBatch;
/**
* 批量申请 服务接口
* @author YenHex
* @date 2023-08-24
*/
public interface TbsBudgetBatchService extends IService<TbsBudgetBatch> {
}

22
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetBatchServiceImpl.java

@ -0,0 +1,22 @@
package com.qs.serve.modules.tbs.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.qs.serve.modules.tbs.entity.TbsBudgetBatch;
import com.qs.serve.modules.tbs.service.TbsBudgetBatchService;
import com.qs.serve.modules.tbs.mapper.TbsBudgetBatchMapper;
/**
* 批量申请 服务实现类
* @author YenHex
* @since 2023-08-24
*/
@Slf4j
@Service
@AllArgsConstructor
public class TbsBudgetBatchServiceImpl extends ServiceImpl<TbsBudgetBatchMapper,TbsBudgetBatch> implements TbsBudgetBatchService {
}

10
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java

@ -72,6 +72,16 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
public TbsBudgetChange commitApply(TbsBudgetUpdateAfterStartBo param) {
seeYonService.testConnection();
TbsBudget budget = tbsBudgetMapper.selectById(param.getId());
if(budget.getConditionFlag().equals(0)){
if(CollectionUtil.isNotEmpty(param.getBrandIds())||
CollectionUtil.isNotEmpty(param.getCategoryIds())||
CollectionUtil.isNotEmpty(param.getSeriesIds())||
CollectionUtil.isNotEmpty(param.getSpuIds())||
CollectionUtil.isNotEmpty(param.getSkuIds())
){
Assert.throwEx("不可添加品类条件");
}
}
if(param.getOrgChangeId()!=null){
TbsBudgetChange orgBudgetChange = this.getById(param.getOrgChangeId());
if(orgBudgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_3_setback)){

1
src/main/java/com/qs/serve/modules/vtb/controller/VtbVerificationController.java

@ -80,6 +80,7 @@ public class VtbVerificationController {
* @param param
* @return
*/
@LimitSubmit
@PostMapping("/createContactRecord")
public R<?> createContactRecord(@RequestBody VtbVerificationContactBo param){
vtbVerificationService.createContactRecord(param);

9
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

@ -551,6 +551,15 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
if(!costApply.getChargeState().equals(TbsCostApplyState.State_2_actioning.getCode())){
Assert.throwEx("当前费用状态不支持");
}
LambdaQueryWrapper<VtbVerification> vtbVerificationLQW = new LambdaQueryWrapper<>();
vtbVerificationLQW.eq(VtbVerification::getActivityId,verificationBo.getActivityId());
vtbVerificationLQW.eq(VtbVerification::getVerificationState,VtbVerificationState.Commiting);
Long count = this.count(vtbVerificationLQW);
if(count>0){
Assert.throwEx("该活动正在核销中");
}
VtbVerification orgData = null;
if(verificationBo.getOrgVerificationId()!=null){
orgData = this.getById(verificationBo.getOrgVerificationId());

Loading…
Cancel
Save