Browse Source

Merge remote-tracking branch 'origin/v1.0' into v1.0

v1.0
15989082884@163.com 2 years ago
parent
commit
8b6fce0af5
  1. 1
      src/main/java/com/qs/serve/common/model/enums/SystemModule.java
  2. 21
      src/main/java/com/qs/serve/modules/exl/common/ExlConst.java
  3. 61
      src/main/java/com/qs/serve/modules/exl/common/QsSqlSessionUtil.java
  4. 44
      src/main/java/com/qs/serve/modules/exl/common/TableCreateSqlUtil.java
  5. 204
      src/main/java/com/qs/serve/modules/exl/controller/ExlTableConfController.java
  6. 121
      src/main/java/com/qs/serve/modules/exl/controller/ExlTableDataController.java
  7. 111
      src/main/java/com/qs/serve/modules/exl/entity/ExlColumnConf.java
  8. 105
      src/main/java/com/qs/serve/modules/exl/entity/ExlDsConf.java
  9. 115
      src/main/java/com/qs/serve/modules/exl/entity/ExlTableConf.java
  10. 18
      src/main/java/com/qs/serve/modules/exl/entity/dto/ExlConditionDto.java
  11. 24
      src/main/java/com/qs/serve/modules/exl/entity/dto/ExlQueryFieldDto.java
  12. 39
      src/main/java/com/qs/serve/modules/exl/entity/dto/ExlTableBo.java
  13. 14
      src/main/java/com/qs/serve/modules/exl/mapper/ExlColumnConfMapper.java
  14. 14
      src/main/java/com/qs/serve/modules/exl/mapper/ExlDsConfMapper.java
  15. 23
      src/main/java/com/qs/serve/modules/exl/mapper/ExlTableConfMapper.java
  16. 14
      src/main/java/com/qs/serve/modules/exl/service/ExlColumnConfService.java
  17. 22
      src/main/java/com/qs/serve/modules/exl/service/ExlTableConfService.java
  18. 22
      src/main/java/com/qs/serve/modules/exl/service/impl/ExlColumnConfServiceImpl.java
  19. 79
      src/main/java/com/qs/serve/modules/exl/service/impl/ExlTableConfServiceImpl.java
  20. 7
      src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java
  21. 3
      src/main/java/com/qs/serve/modules/tbs/common/TbsBudgetCheckState.java
  22. 2
      src/main/java/com/qs/serve/modules/tbs/common/util/CostSort2WrapperUtil.java
  23. 57
      src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java
  24. 10
      src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetCheckController.java
  25. 9
      src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java
  26. 1
      src/main/java/com/qs/serve/modules/tbs/controller/TbsScheduleItemBudgetController.java
  27. 23
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java
  28. 2
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChangeCondition.java
  29. 2
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetCondition.java
  30. 1
      src/main/java/com/qs/serve/modules/tbs/entity/TbsScheduleItemBudget.java
  31. 3
      src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetUpdateAfterStartBo.java
  32. 5
      src/main/java/com/qs/serve/modules/tbs/entity/so/TbsBudgetSo.java
  33. 6
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetApplyOperationServiceImpl.java
  34. 11
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeOperationServiceImpl.java
  35. 17
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java
  36. 15
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetServiceImpl.java
  37. 6
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationOperationServiceImpl.java
  38. 1
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java
  39. 5
      src/main/java/com/qs/serve/task/TbsTask.java
  40. 62
      src/main/resources/mapper/exl/ExlTableConfMapper.xml
  41. 2
      src/main/resources/mapper/tbs/TbsBudgetChangeMapper.xml
  42. 1
      src/main/resources/mapper/tbs/TbsBudgetMapper.xml
  43. 4
      src/main/resources/mapper/tbs/TbsBudgetMatchMapper.xml

1
src/main/java/com/qs/serve/common/model/enums/SystemModule.java

@ -23,6 +23,7 @@ public enum SystemModule {
SYSTEM("sys","系统"), SYSTEM("sys","系统"),
UMS("ums","手机用户"), UMS("ums","手机用户"),
DATA("data","数据"), DATA("data","数据"),
Excel("excel","excel数据"),
Tag("tag","标签"); Tag("tag","标签");
String code; String code;

21
src/main/java/com/qs/serve/modules/exl/common/ExlConst.java

@ -0,0 +1,21 @@
package com.qs.serve.modules.exl.common;
/**
* @author YenHex
* @since 2023/8/15
*/
public interface ExlConst {
String TABLE_NAME_PRE = "exd_";
String TABLE_COMMENT_PRE = "excel数据-";
String DATE_TYPE = "date";
String TYPE_INT = "int";
String TYPE_MONEY = "money";
String TYPE_STRING = "string";
String PRE_COLUMN_START = "START--";
String PRE_COLUMN_END = "END--";
}

61
src/main/java/com/qs/serve/modules/exl/common/QsSqlSessionUtil.java

@ -0,0 +1,61 @@
package com.qs.serve.modules.exl.common;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.SqlSessionUtils;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* @author YenHex
* @since 2023/8/14
*/
public class QsSqlSessionUtil {
/**
* 获取sqlSession
* @return
*/
public static SqlSession getSqlSession(SqlSessionTemplate sqlSessionTemplate){
return SqlSessionUtils.getSqlSession(sqlSessionTemplate.getSqlSessionFactory(),
sqlSessionTemplate.getExecutorType(), sqlSessionTemplate.getPersistenceExceptionTranslator());
}
/**
* 关闭sqlSession
* @param session
*/
public static void closeSqlSession(SqlSession session,SqlSessionTemplate sqlSessionTemplate) {
SqlSessionUtils.closeSqlSession(session, sqlSessionTemplate.getSqlSessionFactory());
}
/**
* 执行sql
* @param sql
* @param sqlSessionTemplate
* @return
*/
public static boolean executeSql(String sql,SqlSessionTemplate sqlSessionTemplate){
PreparedStatement pst = null;
SqlSession session = getSqlSession(sqlSessionTemplate);
try {
pst = session.getConnection().prepareStatement(sql);
pst.execute();
return true;
} catch (SQLException e) {
e.printStackTrace();
}finally {
if(pst!=null){
try {
pst.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
closeSqlSession(session,sqlSessionTemplate);
}
return false;
}
}

44
src/main/java/com/qs/serve/modules/exl/common/TableCreateSqlUtil.java

@ -0,0 +1,44 @@
package com.qs.serve.modules.exl.common;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author YenHex
* @since 2023/8/14
*/
public class TableCreateSqlUtil {
public static final Map<String,String> MYSQL_DATA_MAP = new HashMap<>();
static {
MYSQL_DATA_MAP.put("int","bigint");
MYSQL_DATA_MAP.put("string","varchar(300)");
MYSQL_DATA_MAP.put("date","date");
MYSQL_DATA_MAP.put("money","decimal(11, 2)");
MYSQL_DATA_MAP.put("datetime","datetime");
}
public static final String COLUMN_NULL = " null ";
public static final String COLUMN_NOT_NULL = " not null ";
public static final String COLUMN_COMMENT = "COMMENT";
public static String createMysqlTableSql(String tableName,String tableRemark, List<ExlColumnConf> columnList){
StringBuffer result = new StringBuffer("CREATE TABLE `"+tableName+"` (");
result.append(" `union_row_id` varchar(255) NOT NULL AUTO_INCREMENT COMMENT 'union_row_id',");
for (ExlColumnConf column : columnList) {
String columnType = MYSQL_DATA_MAP.get(column.getColumnType())==null?column.getColumnType():MYSQL_DATA_MAP.get(column.getColumnType());
String nullValue = column.getNotNullFlag().equals(1) ? COLUMN_NOT_NULL:COLUMN_NULL;
result.append("`"+column.getColumnName()+"` "+
columnType +
nullValue +
COLUMN_COMMENT + " '"+
column.getColumnHeader()+"',");
}
result.append(" PRIMARY KEY (`union_row_id`) USING BTREE ");
return result.append(") COMMENT = '"+tableRemark+"' ").toString();
}
}

204
src/main/java/com/qs/serve/modules/exl/controller/ExlTableConfController.java

@ -0,0 +1,204 @@
package com.qs.serve.modules.exl.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.StringUtils;
import com.qs.serve.common.util.WordUtil;
import com.qs.serve.modules.exl.common.ExlConst;
import com.qs.serve.modules.exl.common.QsSqlSessionUtil;
import com.qs.serve.modules.exl.common.TableCreateSqlUtil;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
import com.qs.serve.modules.exl.entity.dto.ExlQueryFieldDto;
import com.qs.serve.modules.exl.entity.dto.ExlTableBo;
import com.qs.serve.modules.exl.service.ExlColumnConfService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.SqlSessionUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.qs.serve.modules.exl.entity.ExlTableConf;
import com.qs.serve.modules.exl.service.ExlTableConfService;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 动态Excel表 表配置
* @author YenHex
* @since 2023-08-11
*/
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("exl/tableConf")
public class ExlTableConfController {
private SqlSessionTemplate sqlSessionTemplate;
private ExlTableConfService exlTableConfService;
private ExlColumnConfService exlColumnConfService;
/**
* 列表
* @param param
* @return
*/
//@GetMapping("/list")
public R<List<ExlTableConf>> getList(ExlTableConf param){
LambdaQueryWrapper<ExlTableConf> lqw = new LambdaQueryWrapper<>(param);
List<ExlTableConf> list = exlTableConfService.list(lqw);
return R.ok(list);
}
/**
* 翻页
* @param param
* @return
*/
@GetMapping("/page")
public R<PageVo<ExlTableConf>> getPage(ExlTableConf param){
LambdaQueryWrapper<ExlTableConf> lqw = new LambdaQueryWrapper<>(param);
PageUtil.startPage();
List<ExlTableConf> list = exlTableConfService.list(lqw);
return R.byPageHelperList(list);
}
/**
* ID查询
* @param id
* @return
*/
@GetMapping("/getById/{id}")
@SysLog(module = SystemModule.Excel, title = "表配置", biz = BizType.QUERY)
public R<ExlTableConf> getById(@PathVariable("id") String id){
ExlTableConf exlTableConf = exlTableConfService.getById(id);
LambdaQueryWrapper<ExlColumnConf> columnLqw = new LambdaQueryWrapper<>();
columnLqw.eq(ExlColumnConf::getTableConfId,id);
List<ExlColumnConf> columnConfList = exlColumnConfService.list(columnLqw);
exlTableConf.setColumnList(columnConfList);
//组装查询参数列表
List<ExlColumnConf> queryColumn = columnConfList.stream()
.filter(a->a.getConditionFlag().equals(1)).collect(Collectors.toList());
List<ExlQueryFieldDto> queryFieldList = new ArrayList<>();
for (ExlColumnConf columnConf : queryColumn) {
if(columnConf.getColumnType().contains(ExlConst.DATE_TYPE)){
ExlQueryFieldDto startDto = new ExlQueryFieldDto();
startDto.setField(ExlConst.PRE_COLUMN_START + columnConf.getColumnName());
startDto.setType(columnConf.getColumnType());
startDto.setLabel(columnConf.getColumnHeader());
queryFieldList.add(startDto);
ExlQueryFieldDto fieldDto = new ExlQueryFieldDto();
fieldDto.setField(ExlConst.PRE_COLUMN_END + columnConf.getColumnName());
fieldDto.setType(columnConf.getColumnType());
fieldDto.setLabel(columnConf.getColumnHeader());
queryFieldList.add(fieldDto);
}else {
ExlQueryFieldDto fieldDto = new ExlQueryFieldDto();
fieldDto.setField(columnConf.getColumnName());
fieldDto.setType(columnConf.getColumnType());
fieldDto.setLabel(columnConf.getColumnHeader());
queryFieldList.add(fieldDto);
}
}
exlTableConf.setQueryList(queryFieldList);
return R.ok(exlTableConf);
}
/**
* 更新
* @param param
* @return
*/
@PostMapping("/updateById")
@SysLog(module = SystemModule.Excel, title = "表配置", biz = BizType.UPDATE)
public R<?> updateById(@RequestBody @Valid ExlTableBo param){
if(param.getId()==null){
return R.error("id is null");
}
ExlTableConf tableConf = exlTableConfService.modify(param);
return R.ok(tableConf);
}
/**
* 新增
* @param param
* @return
*/
@PostMapping("/save")
@SysLog(module = SystemModule.Excel, title = "表配置", biz = BizType.INSERT)
public R<?> save(@RequestBody @Valid ExlTableBo param){
if(param.getId()!=null){
return R.error("id should be null");
}
ExlTableConf tableConf = exlTableConfService.modify(param);
return R.ok(tableConf);
}
/**
* 启用配置
* @param tableId
* @return
*/
@PostMapping("/enable/{tableId}")
@SysLog(module = SystemModule.Excel, title = "表配置", biz = BizType.INSERT)
public R<?> enable(@PathVariable("tableId") String tableId){
ExlTableConf tableConf = exlTableConfService.getById(tableId);
LambdaQueryWrapper<ExlColumnConf> columnLqw = new LambdaQueryWrapper<>();
columnLqw.eq(ExlColumnConf::getTableConfId,tableId);
List<ExlColumnConf> columnConfList = exlColumnConfService.list(columnLqw);
if(tableConf.getEnableFlag().equals(0)){
String sql = TableCreateSqlUtil.createMysqlTableSql(
ExlConst.TABLE_NAME_PRE + tableConf.getTableName(),
ExlConst.TABLE_COMMENT_PRE + tableConf.getExcelTitle(),
columnConfList);
log.debug(sql);
boolean result = QsSqlSessionUtil.executeSql(sql,sqlSessionTemplate);
if(result){
tableConf.setEnableFlag(1);
tableConf.setEnableTime(LocalDateTime.now());
exlTableConfService.updateById(tableConf);
}else {
log.error("[ID:{}]创建表格失败,建表语句:{}",tableId,sql);
return R.error("创建失败");
}
}
return R.ok();
}
/**
* 删除
* @param ids
* @return
*/
@DeleteMapping("/deleteById/{ids}")
@SysLog(module = SystemModule.Excel, title = "表配置", biz = BizType.DELETE)
public R<?> deleteById(@PathVariable("ids") String ids){
List<Long> idsLong = StringUtils.splitIdLong(ids);
LambdaQueryWrapper<ExlTableConf> lqw = new LambdaQueryWrapper<>();
lqw.in(ExlTableConf::getId,ids);
lqw.eq(ExlTableConf::getEnableFlag,1);
Long count = exlTableConfService.count(lqw);
if(count>0){
return R.error("已启用的配置不可删除");
}
boolean result = exlTableConfService.removeByIds(idsLong);
return R.isTrue(result);
}
}

121
src/main/java/com/qs/serve/modules/exl/controller/ExlTableDataController.java

@ -0,0 +1,121 @@
package com.qs.serve.modules.exl.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.exl.common.ExlConst;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
import com.qs.serve.modules.exl.entity.ExlTableConf;
import com.qs.serve.modules.exl.entity.dto.ExlConditionDto;
import com.qs.serve.modules.exl.entity.dto.ExlQueryFieldDto;
import com.qs.serve.modules.exl.entity.dto.ExlTableBo;
import com.qs.serve.modules.exl.mapper.ExlTableConfMapper;
import com.qs.serve.modules.exl.service.ExlColumnConfService;
import com.qs.serve.modules.exl.service.ExlTableConfService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 动态Excel表 表配置
* @author YenHex
* @since 2023-08-11
*/
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("exl/tableData")
public class ExlTableDataController {
private ExlTableConfService exlTableConfService;
private ExlColumnConfService exlColumnConfService;
private ExlTableConfMapper exlTableConfMapper;
/**
* test
* @return
*/
@GetMapping("/page/{tableConfigId}")
public R<?> test(@PathVariable("tableConfigId") Long tableConfigId,@RequestParam Map<String,String> map){
// table
ExlTableConf tableConf = exlTableConfService.getById(tableConfigId);
// columns
LambdaQueryWrapper<ExlColumnConf> columnLqw = new LambdaQueryWrapper<>();
columnLqw.eq(ExlColumnConf::getTableConfId,tableConfigId);
List<ExlColumnConf> columnList = exlColumnConfService.list(columnLqw);
// condition
List<ExlConditionDto> ge_conditions = new ArrayList<>();
List<ExlConditionDto> le_conditions = new ArrayList<>();
List<ExlConditionDto> eq_conditions = new ArrayList<>();
List<ExlConditionDto> like_conditions = new ArrayList<>();
if(!map.isEmpty()){
for (String columnName : map.keySet()) {
String searchValue = map.get(columnName);
if(columnName.contains(ExlConst.PRE_COLUMN_START)){
String orgColumn = columnName.replace(ExlConst.PRE_COLUMN_START,"").trim();
ExlConditionDto conditionDto = new ExlConditionDto(orgColumn,searchValue);
ge_conditions.add(conditionDto);
}else if (columnName.contains(ExlConst.PRE_COLUMN_END)){
String orgColumn = columnName.replace(ExlConst.PRE_COLUMN_END,"").trim();
ExlConditionDto conditionDto = new ExlConditionDto(orgColumn,searchValue);
le_conditions.add(conditionDto);
}else {
for (ExlColumnConf columnConf : columnList) {
if(columnConf.getColumnName().equals(columnName)){
ExlConditionDto conditionDto = new ExlConditionDto(columnName,searchValue);
if (columnConf.getColumnType().equals(ExlConst.TYPE_INT)){
eq_conditions.add(conditionDto);
}else if (columnConf.getColumnType().equals(ExlConst.TYPE_STRING)){
like_conditions.add(conditionDto);
}
}
}
}
}
}
// page
Integer pageSize = PageUtil.getPageSize();
Integer startRow = PageUtil.getStartRow();
// query
Map<String,Object> queryMap = new HashMap<>(10);
queryMap.put("startRow",startRow);
queryMap.put("pageSize",pageSize);
queryMap.put("leList",le_conditions);
queryMap.put("geList",ge_conditions);
queryMap.put("eqList",eq_conditions);
queryMap.put("likeList",like_conditions);
String targetTableName = ExlConst.TABLE_NAME_PRE + tableConf.getTableName();
return R.ok(exlTableConfMapper.listData(targetTableName,queryMap));
}
/**
* 新增
* @param param
* @return
*/
@PostMapping("/batchSave/{tableConfigId}")
public R<?> batchSave(@RequestBody List<Object> param){
for (Object obj : param) {
}
return R.ok(param);
}
}

111
src/main/java/com/qs/serve/modules/exl/entity/ExlColumnConf.java

@ -0,0 +1,111 @@
package com.qs.serve.modules.exl.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-14
*/
@Data
@TableName("exl_column_conf")
public class ExlColumnConf implements Serializable {
private static final long serialVersionUID = 1L;
/** id */
@JsonIgnore
@TableId(type = IdType.AUTO)
private Long id;
/** 非必传 */
@JsonIgnore
private Long tableConfId;
/** 列名 */
@NotBlank(message = "列名不能为空")
@Length(max = 255,message = "列名长度不能超过255字")
private String columnName;
/** excel头部 */
@NotBlank(message = "excel头部不能为空")
@Length(max = 255,message = "excel头部长度不能超过255字")
private String columnHeader;
/** 数据类型:string;int;money;date;datetime; */
@Length(max = 20,message = "数据类型:string;int;money;date;datetime;长度不能超过255字")
private String columnType;
//string-like;int-eq;date-between;datetime-between
/** 作为查询条件标识 */
private Integer conditionFlag;
/** 空值标识 */
private Integer notNullFlag;
/** 空值标识 */
private Integer keyFlag;
/** 创建时间 */
@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 ExlColumnConf toNewObject(ExlColumnConf source){
ExlColumnConf columnConf = new ExlColumnConf();
columnConf.setId(source.getId());
columnConf.setColumnName(source.getColumnName());
columnConf.setColumnHeader(source.getColumnHeader());
columnConf.setColumnType(source.getColumnType());
columnConf.setConditionFlag(source.getConditionFlag());
columnConf.setCreateTime(source.getCreateTime());
columnConf.setUpdateTime(source.getUpdateTime());
columnConf.setTenantId(source.getTenantId());
columnConf.setCreateBy(source.getCreateBy());
columnConf.setUpdateBy(source.getUpdateBy());
columnConf.setDelFlag(source.getDelFlag());
return columnConf;
}
}

105
src/main/java/com/qs/serve/modules/exl/entity/ExlDsConf.java

@ -0,0 +1,105 @@
package com.qs.serve.modules.exl.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-11
*/
@Data
@TableName("exl_ds_conf")
public class ExlDsConf implements Serializable {
private static final long serialVersionUID = 1L;
/** id */
@TableId(type = IdType.AUTO)
private Long id;
/** 启用 */
@NotNull(message = "启用不能为空")
private Integer enable;
/** 用户名 */
@NotBlank(message = "用户名不能为空")
@Length(max = 255,message = "用户名长度不能超过255字")
private String username;
/** 密码 */
@NotBlank(message = "密码不能为空")
@Length(max = 255,message = "密码长度不能超过255字")
private String password;
/** url */
@Length(max = 255,message = "url长度不能超过255字")
private String url;
/** 备注 */
@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 ExlDsConf toNewObject(ExlDsConf source){
ExlDsConf dsConf = new ExlDsConf();
dsConf.setId(source.getId());
dsConf.setEnable(source.getEnable());
dsConf.setUsername(source.getUsername());
dsConf.setPassword(source.getPassword());
dsConf.setUrl(source.getUrl());
dsConf.setRemark(source.getRemark());
dsConf.setCreateTime(source.getCreateTime());
dsConf.setUpdateTime(source.getUpdateTime());
dsConf.setTenantId(source.getTenantId());
dsConf.setCreateBy(source.getCreateBy());
dsConf.setUpdateBy(source.getUpdateBy());
dsConf.setDelFlag(source.getDelFlag());
return dsConf;
}
}

115
src/main/java/com/qs/serve/modules/exl/entity/ExlTableConf.java

@ -0,0 +1,115 @@
package com.qs.serve.modules.exl.entity;
import java.time.LocalDate;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
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-11
*/
@Data
@TableName("exl_table_conf")
public class ExlTableConf 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 tableName;
/** excel标题 */
@NotBlank(message = "excel标题不能为空")
@Length(max = 255,message = "excel标题长度不能超过255字")
private String excelTitle;
/** 备注 */
@Length(max = 255,message = "备注长度不能超过255字")
private String remark;
/** 启用标识 (0/1) */
private Integer enableFlag;
/** 启用时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime enableTime;
/** 创建时间 */
@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;
/**
* 列配置的列表
*/
@TableField(exist = false)
private List<ExlColumnConf> columnList;
/**
* 查询参数列表
*/
@TableField(exist = false)
private List<?> queryList;
public static ExlTableConf toNewObject(ExlTableConf source){
ExlTableConf tableConf = new ExlTableConf();
tableConf.setId(source.getId());
tableConf.setTableName(source.getTableName());
tableConf.setExcelTitle(source.getExcelTitle());
tableConf.setRemark(source.getRemark());
tableConf.setCreateTime(source.getCreateTime());
tableConf.setUpdateTime(source.getUpdateTime());
tableConf.setTenantId(source.getTenantId());
tableConf.setCreateBy(source.getCreateBy());
tableConf.setUpdateBy(source.getUpdateBy());
tableConf.setDelFlag(source.getDelFlag());
return tableConf;
}
}

18
src/main/java/com/qs/serve/modules/exl/entity/dto/ExlConditionDto.java

@ -0,0 +1,18 @@
package com.qs.serve.modules.exl.entity.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @author YenHex
* @since 2023/8/15
*/
@Data
@AllArgsConstructor
public class ExlConditionDto {
String column;
String value;
}

24
src/main/java/com/qs/serve/modules/exl/entity/dto/ExlQueryFieldDto.java

@ -0,0 +1,24 @@
package com.qs.serve.modules.exl.entity.dto;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @author YenHex
* @since 2023/8/14
*/
@Data
public class ExlQueryFieldDto {
/** 字段名 */
private String field;
/** 数据类型 */
private String type;
/** 显示标签 */
private String label;
}

39
src/main/java/com/qs/serve/modules/exl/entity/dto/ExlTableBo.java

@ -0,0 +1,39 @@
package com.qs.serve.modules.exl.entity.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @author YenHex
* @since 2023/8/14
*/
@Data
public class ExlTableBo {
/** id(修改时参数) */
@TableId(type = IdType.AUTO)
private Long id;
/** 表名 */
@NotBlank(message = "表名不能为空")
@Length(max = 255,message = "表名长度不能超过255字")
private String tableName;
/** excel标题 */
@NotBlank(message = "excel标题不能为空")
@Length(max = 255,message = "excel标题长度不能超过255字")
private String excelTitle;
/** 备注 */
@Length(max = 255,message = "备注长度不能超过255字")
private String remark;
private List<ExlColumnConf> columnList;
}

14
src/main/java/com/qs/serve/modules/exl/mapper/ExlColumnConfMapper.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.exl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
/**
* 行配置 Mapper
* @author YenHex
* @date 2023-08-14
*/
public interface ExlColumnConfMapper extends BaseMapper<ExlColumnConf> {
}

14
src/main/java/com/qs/serve/modules/exl/mapper/ExlDsConfMapper.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.exl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.exl.entity.ExlDsConf;
/**
* 数据源配置 Mapper
* @author YenHex
* @date 2023-08-11
*/
public interface ExlDsConfMapper extends BaseMapper<ExlDsConf> {
}

23
src/main/java/com/qs/serve/modules/exl/mapper/ExlTableConfMapper.java

@ -0,0 +1,23 @@
package com.qs.serve.modules.exl.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qs.serve.modules.exl.entity.ExlTableConf;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 表配置 Mapper
* @author YenHex
* @date 2023-08-11
*/
public interface ExlTableConfMapper extends BaseMapper<ExlTableConf> {
@InterceptorIgnore(tenantLine = "1")
List<Map<String,Object>> listData(@Param("tableName") String tableName,@Param("query")Map<String,Object> query);
}

14
src/main/java/com/qs/serve/modules/exl/service/ExlColumnConfService.java

@ -0,0 +1,14 @@
package com.qs.serve.modules.exl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
/**
* 行配置 服务接口
* @author YenHex
* @date 2023-08-14
*/
public interface ExlColumnConfService extends IService<ExlColumnConf> {
}

22
src/main/java/com/qs/serve/modules/exl/service/ExlTableConfService.java

@ -0,0 +1,22 @@
package com.qs.serve.modules.exl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qs.serve.modules.exl.entity.ExlTableConf;
import com.qs.serve.modules.exl.entity.dto.ExlTableBo;
/**
* 表配置 服务接口
* @author YenHex
* @date 2023-08-11
*/
public interface ExlTableConfService extends IService<ExlTableConf> {
/**
* 编辑
* @param param
* @return
*/
ExlTableConf modify(ExlTableBo param);
}

22
src/main/java/com/qs/serve/modules/exl/service/impl/ExlColumnConfServiceImpl.java

@ -0,0 +1,22 @@
package com.qs.serve.modules.exl.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.exl.entity.ExlColumnConf;
import com.qs.serve.modules.exl.service.ExlColumnConfService;
import com.qs.serve.modules.exl.mapper.ExlColumnConfMapper;
/**
* 行配置 服务实现类
* @author YenHex
* @since 2023-08-14
*/
@Slf4j
@Service
@AllArgsConstructor
public class ExlColumnConfServiceImpl extends ServiceImpl<ExlColumnConfMapper,ExlColumnConf> implements ExlColumnConfService {
}

79
src/main/java/com/qs/serve/modules/exl/service/impl/ExlTableConfServiceImpl.java

@ -0,0 +1,79 @@
package com.qs.serve.modules.exl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qs.serve.common.util.Assert;
import com.qs.serve.modules.exl.common.ExlConst;
import com.qs.serve.modules.exl.entity.ExlColumnConf;
import com.qs.serve.modules.exl.entity.dto.ExlTableBo;
import com.qs.serve.modules.exl.service.ExlColumnConfService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.qs.serve.modules.exl.entity.ExlTableConf;
import com.qs.serve.modules.exl.service.ExlTableConfService;
import com.qs.serve.modules.exl.mapper.ExlTableConfMapper;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 表配置 服务实现类
* @author YenHex
* @since 2023-08-11
*/
@Slf4j
@Service
@AllArgsConstructor
public class ExlTableConfServiceImpl extends ServiceImpl<ExlTableConfMapper,ExlTableConf> implements ExlTableConfService {
private final ExlColumnConfService columnConfService;
@Override
@Transactional(rollbackFor = Exception.class)
public ExlTableConf modify(ExlTableBo param) {
ExlTableConf tableConf = new ExlTableConf();
if(param.getId()==null){
//save
tableConf.setTableName(param.getTableName());
tableConf.setExcelTitle(param.getExcelTitle());
tableConf.setRemark(param.getRemark());
this.save(tableConf);
final Long tableId = tableConf.getId();
List<ExlColumnConf> columnList = param.getColumnList();
columnList.forEach(a->{
a.setTableConfId(tableId);
a.setId(null);
});
columnConfService.saveBatch(columnList);
return tableConf;
}else {
//update
final Long tableId = param.getId();
ExlTableConf dbData = this.getById(tableId);
if(dbData.getEnableFlag().equals(1)){
Assert.throwEx("已启用的配置不可修改");
}
tableConf.setId(tableId);
tableConf.setTableName(param.getTableName());
tableConf.setExcelTitle(param.getExcelTitle());
tableConf.setRemark(param.getRemark());
this.updateById(tableConf);
LambdaQueryWrapper<ExlColumnConf> columnLqw = new LambdaQueryWrapper<>();
columnLqw.eq(ExlColumnConf::getTableConfId,param.getId());
columnConfService.remove(columnLqw);
List<ExlColumnConf> columnList = param.getColumnList();
columnList.forEach(a->{
a.setTableConfId(tableId);
if(a.getColumnType().equals(ExlConst.TYPE_MONEY)){
a.setConditionFlag(0);
}
a.setId(null);
});
columnConfService.saveBatch(columnList);
}
return tableConf;
}
}

7
src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java

@ -131,9 +131,7 @@ public interface SeeYonOperationService extends SeeYonBaseService{
* @param targetId * @param targetId
* @return * @return
*/ */
default boolean checkSyFormIdIsNotNull(String targetId){ boolean checkSyFormIdIsNotNull(String targetId);
return false;
}
/** /**
* 审批列表(用于详情页) * 审批列表(用于详情页)
@ -276,6 +274,9 @@ public interface SeeYonOperationService extends SeeYonBaseService{
default R<?> commitAffair(TbsAffairCommitBo affairCommit){ default R<?> commitAffair(TbsAffairCommitBo affairCommit){
getRequestService().testConnection(); getRequestService().testConnection();
String syFormId = this.getSyFormIdByTargetInfo(affairCommit); String syFormId = this.getSyFormIdByTargetInfo(affairCommit);
if(syFormId==null){
Assert.throwEx("["+affairCommit.getTargetId()+"]__syFormId is null");
}
R<String> result = getRequestService().commonCommit(affairCommit, getTemplateCode(),syFormId); R<String> result = getRequestService().commonCommit(affairCommit, getTemplateCode(),syFormId);
boolean isBackCommit = affairCommit.getState()==2; boolean isBackCommit = affairCommit.getState()==2;
if(result.getStatus()==200){ if(result.getStatus()==200){

3
src/main/java/com/qs/serve/modules/tbs/common/TbsBudgetCheckState.java

@ -7,12 +7,13 @@ package com.qs.serve.modules.tbs.common;
public interface TbsBudgetCheckState { public interface TbsBudgetCheckState {
/** /**
* 0=未发布1=审批中2=完成3-被驳回;4-中止; * 0=未发布1=审批中2=完成3-被驳回;4-中止;5关闭
*/ */
int State_0_unPublish = 0; int State_0_unPublish = 0;
int State_1_apply = 1; int State_1_apply = 1;
int State_2_finished = 2; int State_2_finished = 2;
int State_3_setback = 3; int State_3_setback = 3;
int State_4_stop = 4; int State_4_stop = 4;
int State_5_close = 5;
} }

2
src/main/java/com/qs/serve/modules/tbs/common/util/CostSort2WrapperUtil.java

@ -59,8 +59,8 @@ public class CostSort2WrapperUtil {
} }
sortProductAndTime(sortOfNoCondition); sortProductAndTime(sortOfNoCondition);
sortProductAndTime(sortOfCondition); sortProductAndTime(sortOfCondition);
listResult.addAll(sortOfNoCondition);
listResult.addAll(sortOfCondition); listResult.addAll(sortOfCondition);
listResult.addAll(sortOfNoCondition);
return listResult; return listResult;
} }

57
src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java

@ -1,6 +1,8 @@
package com.qs.serve.modules.tbs.controller; package com.qs.serve.modules.tbs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qs.serve.common.framework.manager.AsyncFactory;
import com.qs.serve.common.framework.manager.AsyncManager;
import com.qs.serve.common.model.annotation.SysLog; import com.qs.serve.common.model.annotation.SysLog;
import com.qs.serve.common.model.dto.PageVo; import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R; import com.qs.serve.common.model.dto.R;
@ -10,21 +12,20 @@ import com.qs.serve.common.util.AuthContextUtils;
import com.qs.serve.common.util.PageUtil; import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.CopierUtil; import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.StringUtils; import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.sys.service.SysAttachService;
import com.qs.serve.modules.tbs.common.TbsBudgetCheckState;
import com.qs.serve.modules.tbs.common.dto.TbsBudgetChangeVo; import com.qs.serve.modules.tbs.common.dto.TbsBudgetChangeVo;
import com.qs.serve.modules.tbs.entity.TbsBudgetChangeCondition; import com.qs.serve.modules.tbs.entity.*;
import com.qs.serve.modules.tbs.entity.TbsBudgetChangeScheduleItem;
import com.qs.serve.modules.tbs.entity.so.TbsBudgetChangeSo; import com.qs.serve.modules.tbs.entity.so.TbsBudgetChangeSo;
import com.qs.serve.modules.tbs.service.TbsBudgetChangeConditionService; import com.qs.serve.modules.tbs.service.*;
import com.qs.serve.modules.tbs.service.TbsBudgetChangeScheduleItemService; import com.qs.serve.modules.tbs.service.impl.TbsBudgetChangeOperationServiceImpl;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.qs.serve.modules.tbs.entity.TbsBudgetChange;
import com.qs.serve.modules.tbs.service.TbsBudgetChangeService;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -40,9 +41,13 @@ import java.util.stream.Collectors;
@RequestMapping("tbs/budgetChange") @RequestMapping("tbs/budgetChange")
public class TbsBudgetChangeController { public class TbsBudgetChangeController {
private SysAttachService sysAttachService;
private TbsBudgetChangeService tbsBudgetChangeService; private TbsBudgetChangeService tbsBudgetChangeService;
private TbsBudgetChangeScheduleItemService tbsBudgetChangeScheduleItemService; private TbsBudgetChangeScheduleItemService tbsBudgetChangeScheduleItemService;
private TbsBudgetChangeConditionService tbsBudgetChangeConditionService; private TbsBudgetChangeConditionService tbsBudgetChangeConditionService;
private TbsBudgetService tbsBudgetService;
private TbsScheduleItemBudgetService tbsScheduleItemBudgetService;
private TbsBudgetConditionService tbsBudgetConditionService;
/** /**
* 预算审批整合翻页 * 预算审批整合翻页
@ -75,6 +80,44 @@ public class TbsBudgetChangeController {
budgetChange.setChangeScheduleItemList(changeScheduleItemList); budgetChange.setChangeScheduleItemList(changeScheduleItemList);
budgetChange.setChangeConditionList(map.get(0)); budgetChange.setChangeConditionList(map.get(0));
budgetChange.setOrgConditionList(map.get(1)); budgetChange.setOrgConditionList(map.get(1));
if(budgetChange.getNewAttachIds()!=null&&budgetChange.getNewAttachIds().length>0){
budgetChange.setNewAttachInfos(sysAttachService.listByIds(Arrays.asList(budgetChange.getNewAttachIds())));
}
if(budgetChange.getOrgAttachIds()!=null&&budgetChange.getOrgAttachIds().length>0){
budgetChange.setOrgAttachInfos(sysAttachService.listByIds(Arrays.asList(budgetChange.getOrgAttachIds())));
}
if (budgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){
AsyncManager.me().execute(AsyncFactory.submitBudgetChange(budgetChange.getId()+""));
}
return R.ok(budgetChange);
}
/**
* budgetId查询
* @param id
* @return
*/
@GetMapping("/apply/{id}")
public R<TbsBudgetChange> getApplyBudget(@PathVariable("id")Long id ){
TbsBudget budget = tbsBudgetService.getById(id);
LambdaQueryWrapper<TbsBudgetCondition> conditionLqw = new LambdaQueryWrapper<>();
conditionLqw.eq(TbsBudgetCondition::getBudgetId,id);
conditionLqw.isNull(TbsBudgetCondition::getChangeId);
List<TbsBudgetCondition> conditions = tbsBudgetConditionService.list(conditionLqw);
LambdaQueryWrapper<TbsScheduleItemBudget> schItemBudgetLqw = new LambdaQueryWrapper<>();
schItemBudgetLqw.eq(TbsScheduleItemBudget::getBudgetId,id);
List<TbsScheduleItemBudget> scheduleItemBudgetList = tbsScheduleItemBudgetService.list(schItemBudgetLqw);
TbsBudgetChange budgetChange = TbsBudgetChange.toNewObject(budget);
List<TbsBudgetChangeCondition> budgetChangeConditions = conditions.stream()
.map(TbsBudgetChangeCondition::toNewObject).collect(Collectors.toList());
List<TbsBudgetChangeScheduleItem> budgetChangeScheduleItemList = scheduleItemBudgetList.stream()
.map(TbsBudgetChangeScheduleItem::toNewObject).collect(Collectors.toList());
budgetChange.setChangeScheduleItemList(budgetChangeScheduleItemList);
budgetChange.setChangeConditionList(budgetChangeConditions);
if(budget.getAttachIds()!=null&&budget.getAttachIds().length>0){
budgetChange.setNewAttachIds(budget.getAttachIds());
budgetChange.setNewAttachInfos(sysAttachService.listByIds(Arrays.asList(budget.getAttachIds())));
}
return R.ok(budgetChange); return R.ok(budgetChange);
} }

10
src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetCheckController.java

@ -39,6 +39,16 @@ public class TbsBudgetCheckController {
private final TbsBudgetApplyOperationServiceImpl tbsBudgetApplyOperationService; private final TbsBudgetApplyOperationServiceImpl tbsBudgetApplyOperationService;
private final TbsBudgetChangeOperationServiceImpl tbsBudgetChangeOperationService; private final TbsBudgetChangeOperationServiceImpl tbsBudgetChangeOperationService;
//测试
@PostMapping("test/{id}")
public R<?> test(@PathVariable String id){
TbsAffairCommitBo param = new TbsAffairCommitBo();
param.setTargetId(id);
tbsBudgetChangeOperationService.doFinished(param);
return R.ok();
}
/** /**
* 提交申请 * 提交申请
* @return * @return

9
src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java

@ -215,8 +215,16 @@ public class TbsCostApplyController {
@GetMapping("/getById/{id}") @GetMapping("/getById/{id}")
@SysLog(module = SystemModule.Budget, title = "费用申请", biz = BizType.QUERY) @SysLog(module = SystemModule.Budget, title = "费用申请", biz = BizType.QUERY)
@PreAuthorize("hasRole('tbs:costApply:query')") @PreAuthorize("hasRole('tbs:costApply:query')")
@Transactional(rollbackFor = Exception.class)
public R<TbsCostApply> getById(@PathVariable("id") String id){ public R<TbsCostApply> getById(@PathVariable("id") String id){
TbsCostApply tbsCostApply = tbsCostApplyService.getById(id); TbsCostApply tbsCostApply = tbsCostApplyService.getById(id);
if(tbsCostApply.getChargeState().equals(TbsCostApplyState.State_1_apply.getCode())){
try {
tbsCostApplyOperationServiceImpl.runCompensate(id);
} catch (Exception e) {
e.printStackTrace();
}
}
TbsCostContract contract = costContractService.getByCostApplyId(tbsCostApply.getId()); TbsCostContract contract = costContractService.getByCostApplyId(tbsCostApply.getId());
tbsCostApply.setContractInfo(contract); tbsCostApply.setContractInfo(contract);
return R.ok(tbsCostApply); return R.ok(tbsCostApply);
@ -260,6 +268,7 @@ public class TbsCostApplyController {
if(contract&&!supplier.getSupplierFlag().equals(1)){ if(contract&&!supplier.getSupplierFlag().equals(1)){
return R.error("当前用户非供应商"); return R.error("当前用户非供应商");
} }
entity.setMatchType(1);
entity.setCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.CostApply)); entity.setCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.CostApply));
entity.setSupplierCode(supplier.getCode()); entity.setSupplierCode(supplier.getCode());
entity.setSupplierName(supplier.getName()); entity.setSupplierName(supplier.getName());

1
src/main/java/com/qs/serve/modules/tbs/controller/TbsScheduleItemBudgetController.java

@ -102,6 +102,7 @@ public class TbsScheduleItemBudgetController {
@SysLog(module = SystemModule.Budget, title = "预算考核期项", biz = BizType.INSERT) @SysLog(module = SystemModule.Budget, title = "预算考核期项", biz = BizType.INSERT)
@PreAuthorize("hasRole('tbs:schedule:insert')") @PreAuthorize("hasRole('tbs:schedule:insert')")
public R<?> save(@RequestBody @Valid TbsScheduleItemBudget param){ public R<?> save(@RequestBody @Valid TbsScheduleItemBudget param){
param.setPreDispatchAmountFirst(param.getPreDispatchAmount());
TbsScheduleItemBudget entity = CopierUtil.copy(param,new TbsScheduleItemBudget()); TbsScheduleItemBudget entity = CopierUtil.copy(param,new TbsScheduleItemBudget());
boolean result = tbsScheduleItemBudgetService.save(entity); boolean result = tbsScheduleItemBudgetService.save(entity);
return R.isTrue(result); return R.isTrue(result);

23
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java

@ -10,7 +10,9 @@ import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.qs.serve.common.framework.mybatis.handler.meta.SplitStringTypeHandler;
import lombok.Data; import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -23,7 +25,7 @@ import javax.validation.constraints.NotBlank;
* @since 2023-08-09 * @since 2023-08-09
*/ */
@Data @Data
@TableName("tbs_budget_change") @TableName(value = "tbs_budget_change", autoResultMap = true)
public class TbsBudgetChange implements Serializable { public class TbsBudgetChange implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -128,6 +130,15 @@ public class TbsBudgetChange implements Serializable {
@Length(max = 255,message = "备注长度不能超过255字") @Length(max = 255,message = "备注长度不能超过255字")
private String remark; private String remark;
/** 附件id */
@TableField(typeHandler = SplitStringTypeHandler.class,jdbcType= JdbcType.VARCHAR)
private String[] orgAttachIds;
/** 附件id */
@TableField(typeHandler = SplitStringTypeHandler.class,jdbcType= JdbcType.VARCHAR)
private String[] newAttachIds;
/** 创建时间 */ /** 创建时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ -168,12 +179,18 @@ public class TbsBudgetChange implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<?> changeConditionList; private List<?> changeConditionList;
@TableField(exist = false)
private List<?> newAttachInfos;
@TableField(exist = false)
private List<?> orgAttachInfos;
public static TbsBudgetChange toNewObject(TbsBudget source){ public static TbsBudgetChange toNewObject(TbsBudget source){
TbsBudgetChange budgetChange = new TbsBudgetChange(); TbsBudgetChange budgetChange = new TbsBudgetChange();
budgetChange.setId(source.getId()); //budgetChange.setId(source.getId());
budgetChange.setBudgetId(source.getId()); budgetChange.setBudgetId(source.getId());
//budgetChange.setChangeCode(source.getChangeCode()); //budgetChange.setChangeCode(source.getChangeCode());
//budgetChange.setBudgetTitle(source.getBudgetTitle()); budgetChange.setBudgetTitle(source.getBudgetCode());
budgetChange.setBudgetNumber(source.getBudgetNumber()); budgetChange.setBudgetNumber(source.getBudgetNumber());
budgetChange.setBudgetCheckState(source.getBudgetCheckState()); budgetChange.setBudgetCheckState(source.getBudgetCheckState());
budgetChange.setSubjectId(source.getSubjectId()); budgetChange.setSubjectId(source.getSubjectId());

2
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChangeCondition.java

@ -106,7 +106,7 @@ public class TbsBudgetChangeCondition implements Serializable {
public static TbsBudgetChangeCondition toNewObject(TbsBudgetCondition source){ public static TbsBudgetChangeCondition toNewObject(TbsBudgetCondition source){
TbsBudgetChangeCondition budgetChangeCondition = new TbsBudgetChangeCondition(); TbsBudgetChangeCondition budgetChangeCondition = new TbsBudgetChangeCondition();
budgetChangeCondition.setId(source.getId()); //budgetChangeCondition.setId(source.getId());
//budgetChangeCondition.setChangeId(source.getChangeId()); //budgetChangeCondition.setChangeId(source.getChangeId());
budgetChangeCondition.setBudgetId(source.getBudgetId()); budgetChangeCondition.setBudgetId(source.getBudgetId());
budgetChangeCondition.setTargetType(source.getTargetType()); budgetChangeCondition.setTargetType(source.getTargetType());

2
src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetCondition.java

@ -35,6 +35,8 @@ public class TbsBudgetCondition implements Serializable {
@NotNull(message = "预算id不能为空") @NotNull(message = "预算id不能为空")
private Long budgetId; private Long budgetId;
private Long changeId;
/** 目标类型(brand、category、series、spu、sku) */ /** 目标类型(brand、category、series、spu、sku) */
@NotBlank(message = "目标类型(brand、category、series、spu、sku)不能为空") @NotBlank(message = "目标类型(brand、category、series、spu、sku)不能为空")
@Length(max = 30,message = "目标类型(brand、category、series、spu、sku)长度不能超过30字") @Length(max = 30,message = "目标类型(brand、category、series、spu、sku)长度不能超过30字")

1
src/main/java/com/qs/serve/modules/tbs/entity/TbsScheduleItemBudget.java

@ -70,6 +70,7 @@ public class TbsScheduleItemBudget implements Serializable {
@NotNull(message = "预估发货金额") @NotNull(message = "预估发货金额")
private BigDecimal preDispatchAmount; private BigDecimal preDispatchAmount;
private BigDecimal preDispatchAmountFirst;
/** 备注 */ /** 备注 */
@Length(max = 255,message = "备注长度不能超过255字") @Length(max = 255,message = "备注长度不能超过255字")

3
src/main/java/com/qs/serve/modules/tbs/entity/bo/TbsBudgetUpdateAfterStartBo.java

@ -24,6 +24,9 @@ public class TbsBudgetUpdateAfterStartBo implements Serializable {
/** 预算编码 */ /** 预算编码 */
private String budgetCode; private String budgetCode;
/** 原来的更变记录id */
private String orgChangeId;
/** /**
* 成本中心类型 * 成本中心类型
center, center,

5
src/main/java/com/qs/serve/modules/tbs/entity/so/TbsBudgetSo.java

@ -28,9 +28,12 @@ public class TbsBudgetSo implements Serializable {
private Integer budgetState; private Integer budgetState;
/** 预算编码 */ /** 预算标题 */
private String budgetCode; private String budgetCode;
/** 预算编码 */
private String budgetNumber;
/** 科目编码搜索值 */ /** 科目编码搜索值 */
private String subjectValue; private String subjectValue;

6
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetApplyOperationServiceImpl.java

@ -25,6 +25,12 @@ public class TbsBudgetApplyOperationServiceImpl implements SeeYonOperationServic
private TbsBudgetMapper budgetMapper; private TbsBudgetMapper budgetMapper;
@Override
public boolean checkSyFormIdIsNotNull(String targetId) {
TbsBudget tbsBudget = budgetMapper.selectById(targetId);
return tbsBudget.getSyFormId()!=null;
}
@Override @Override
public void doCommitBacked(String targetId) { public void doCommitBacked(String targetId) {
AsyncManager.me().execute(AsyncFactory.submitBudgetApply(targetId)); AsyncManager.me().execute(AsyncFactory.submitBudgetApply(targetId));

11
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeOperationServiceImpl.java

@ -47,6 +47,12 @@ public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationServi
private TbsScheduleItemBudgetService tbsScheduleItemBudgetService; private TbsScheduleItemBudgetService tbsScheduleItemBudgetService;
@Override
public boolean checkSyFormIdIsNotNull(String targetId) {
TbsBudgetChange budgetChange = budgetChangeMapper.selectById(targetId);
return budgetChange.getSyFormId()!=null;
}
@Override @Override
public void doCommitBacked(String targetId) { public void doCommitBacked(String targetId) {
AsyncManager.me().execute(AsyncFactory.submitBudgetChange(targetId)); AsyncManager.me().execute(AsyncFactory.submitBudgetChange(targetId));
@ -79,7 +85,7 @@ public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationServi
budgetChangeMapper.updateById(budgetChange); budgetChangeMapper.updateById(budgetChange);
} }
TbsBudget tbsBudget = budgetMapper.selectById(budgetChange.getBudgetId()); TbsBudget tbsBudget = budgetMapper.selectById(budgetChange.getBudgetId());
SysUser sysUser = getSysUserService().getBySyId(budgetChange.getUserId()); SysUser sysUser = getSysUserService().getById(budgetChange.getUserId());
//更新条件 //更新条件
List<TbsBudgetChangeCondition> allChangeConditionList = tbsBudgetChangeConditionService.listByChangeId(budgetChange.getId()); List<TbsBudgetChangeCondition> allChangeConditionList = tbsBudgetChangeConditionService.listByChangeId(budgetChange.getId());
Map<Integer,List<TbsBudgetChangeCondition>> map = allChangeConditionList.stream().collect(Collectors.groupingBy(TbsBudgetChangeCondition::getSourceFlag)); Map<Integer,List<TbsBudgetChangeCondition>> map = allChangeConditionList.stream().collect(Collectors.groupingBy(TbsBudgetChangeCondition::getSourceFlag));
@ -88,6 +94,7 @@ public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationServi
List<TbsBudgetCondition> budgetConditionList = new ArrayList<>(); List<TbsBudgetCondition> budgetConditionList = new ArrayList<>();
for (TbsBudgetChangeCondition changeCondition : changeConditionList) { for (TbsBudgetChangeCondition changeCondition : changeConditionList) {
TbsBudgetCondition budgetCondition = TbsBudgetCondition.toNewObject(changeCondition); TbsBudgetCondition budgetCondition = TbsBudgetCondition.toNewObject(changeCondition);
budgetCondition.setChangeId(budgetChange.getId());
budgetConditionList.add(budgetCondition); budgetConditionList.add(budgetCondition);
} }
if(CollectionUtil.isNotEmpty(budgetConditionList)){ if(CollectionUtil.isNotEmpty(budgetConditionList)){
@ -149,7 +156,7 @@ public class TbsBudgetChangeOperationServiceImpl implements SeeYonOperationServi
@Override @Override
public String getTemplateCode() { public String getTemplateCode() {
return TbsSeeYonConst.BudgetApplyConf.Code(); return TbsSeeYonConst.BudgetChangeConf.Code();
} }
} }

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

@ -27,6 +27,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.qs.serve.modules.tbs.service.TbsBudgetChangeService; import com.qs.serve.modules.tbs.service.TbsBudgetChangeService;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
@ -67,11 +68,20 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public TbsBudgetChange commitApply(TbsBudgetUpdateAfterStartBo param) { public TbsBudgetChange commitApply(TbsBudgetUpdateAfterStartBo param) {
seeYonService.testConnection(); seeYonService.testConnection();
TbsBudget budget = tbsBudgetMapper.selectById(param.getId()); TbsBudget budget = tbsBudgetMapper.selectById(param.getId());
if(param.getOrgChangeId()!=null){
TbsBudgetChange orgBudgetChange = this.getById(param.getOrgChangeId());
if(orgBudgetChange.getBudgetCheckState().equals(TbsBudgetCheckState.State_3_setback)){
orgBudgetChange.setBudgetCheckState(TbsBudgetCheckState.State_5_close);
this.updateById(orgBudgetChange);
}
}
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId());
TbsBudgetChange budgetChange = buildBudgetChange(param, budget,sysUser);
TbsBudgetChange budgetChange = this.buildBudgetChange(param, budget,sysUser);
String templateCode = TbsSeeYonConst.BudgetChangeConf.Code(); String templateCode = TbsSeeYonConst.BudgetChangeConf.Code();
Map<String,Object> data = new HashMap<>(); Map<String,Object> data = new HashMap<>();
data.put("exsp5", budgetChange.getChangeCode()); data.put("exsp5", budgetChange.getChangeCode());
@ -107,7 +117,7 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
budgetChange.setSubmitTime(LocalDateTime.now()); budgetChange.setSubmitTime(LocalDateTime.now());
budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_1_apply); budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_1_apply);
budgetChange.setSyFormId(formId); budgetChange.setSyFormId(formId);
this.updateById(budgetChange);
//创建流程后回调 //创建流程后回调
BaseCreateCallbackBo callbackBo = new BaseCreateCallbackBo(templateCode,budgetChange.getId()+""); BaseCreateCallbackBo callbackBo = new BaseCreateCallbackBo(templateCode,budgetChange.getId()+"");
seeYonService.createCallbackStatus(callbackBo); seeYonService.createCallbackStatus(callbackBo);
@ -128,10 +138,13 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
*/ */
private TbsBudgetChange buildBudgetChange(TbsBudgetUpdateAfterStartBo param, TbsBudget budget,SysUser sysUser) { private TbsBudgetChange buildBudgetChange(TbsBudgetUpdateAfterStartBo param, TbsBudget budget,SysUser sysUser) {
TbsBudgetChange budgetChange = TbsBudgetChange.toNewObject(budget); TbsBudgetChange budgetChange = TbsBudgetChange.toNewObject(budget);
budgetChange.setOrgAttachIds(budget.getAttachIds());
budgetChange.setNewAttachIds(param.getAttachIds());
budgetChange.setChangeCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.BudgetChange)); budgetChange.setChangeCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.BudgetChange));
budgetChange.setUserId(sysUser.getId()); budgetChange.setUserId(sysUser.getId());
budgetChange.setUserCode(sysUser.getCode()); budgetChange.setUserCode(sysUser.getCode());
budgetChange.setUserName(sysUser.getName()); budgetChange.setUserName(sysUser.getName());
budgetChange.setBudgetCheckState(TbsBudgetCheckState.State_1_apply);
boolean notChangeTitle = param.getBudgetCode()!=null&& param.getBudgetCode().equals(budget.getBudgetCode()); boolean notChangeTitle = param.getBudgetCode()!=null&& param.getBudgetCode().equals(budget.getBudgetCode());
if(!notChangeTitle){ if(!notChangeTitle){
budgetChange.setNewBudgetTitle(param.getBudgetCode()); budgetChange.setNewBudgetTitle(param.getBudgetCode());

15
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetServiceImpl.java

@ -38,6 +38,7 @@ import com.qs.serve.modules.tbs.entity.bo.TbsBudgetExcelBo;
import com.qs.serve.modules.tbs.entity.bo.TbsBudgetMoveAmountBo; import com.qs.serve.modules.tbs.entity.bo.TbsBudgetMoveAmountBo;
import com.qs.serve.modules.tbs.entity.bo.TbsBudgetUpdateAfterStartBo; import com.qs.serve.modules.tbs.entity.bo.TbsBudgetUpdateAfterStartBo;
import com.qs.serve.modules.tbs.entity.vo.TbsBudgetVo; import com.qs.serve.modules.tbs.entity.vo.TbsBudgetVo;
import com.qs.serve.modules.tbs.mapper.TbsBudgetChangeMapper;
import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper; import com.qs.serve.modules.tbs.mapper.TbsBudgetMapper;
import com.qs.serve.modules.tbs.service.*; import com.qs.serve.modules.tbs.service.*;
import com.qs.serve.modules.tzc.entity.TzcPolicyItem; import com.qs.serve.modules.tzc.entity.TzcPolicyItem;
@ -68,6 +69,7 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget>
private final BmsSubjectService subjectService; private final BmsSubjectService subjectService;
private final TbsScheduleService scheduleService; private final TbsScheduleService scheduleService;
private final TbsBudgetConditionService budgetConditionService; private final TbsBudgetConditionService budgetConditionService;
private final TbsBudgetChangeMapper tbsBudgetChangeMapper;
private final TbsBudgetLogService budgetLogService; private final TbsBudgetLogService budgetLogService;
private final TbsScheduleItemBudgetService scheduleItemBudgetService; private final TbsScheduleItemBudgetService scheduleItemBudgetService;
private final TbsScheduleItemService scheduleItemService; private final TbsScheduleItemService scheduleItemService;
@ -96,6 +98,9 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget>
String templateCode = TbsSeeYonConst.BudgetApplyConf.Code(); String templateCode = TbsSeeYonConst.BudgetApplyConf.Code();
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId());
TbsBudget tbsBudget = this.getById(id); TbsBudget tbsBudget = this.getById(id);
if(tbsBudget.getBudgetState().equals(1)){
Assert.throwEx("");
}
Map<String,Object> data = new HashMap<>(); Map<String,Object> data = new HashMap<>();
data.put("exsp5", tbsBudget.getBudgetCode()); data.put("exsp5", tbsBudget.getBudgetCode());
data.put("orgId", tbsBudget.getId().toString()); data.put("orgId", tbsBudget.getId().toString());
@ -516,6 +521,16 @@ public class TbsBudgetServiceImpl extends ServiceImpl<TbsBudgetMapper,TbsBudget>
List<SysAttach> attachList = attachService.listByIds(attachIds); List<SysAttach> attachList = attachService.listByIds(attachIds);
budgetVo.setAttachList(attachList); budgetVo.setAttachList(attachList);
} }
//TODO 添加子状态码;有更变时,修改为审批状态
if(budgetVo.getBudgetState().equals(1)&&!budgetVo.getBudgetCheckState().equals(TbsBudgetCheckState.State_1_apply)){
LambdaQueryWrapper<TbsBudgetChange> change_lqw = new LambdaQueryWrapper<>();
change_lqw.eq(TbsBudgetChange::getBudgetId,budgetVo.getId());
change_lqw.eq(TbsBudgetChange::getBudgetCheckState,TbsBudgetCheckState.State_1_apply);
long count = tbsBudgetChangeMapper.selectCount(change_lqw);
if(count>0){
budgetVo.setBudgetCheckState(TbsBudgetCheckState.State_1_apply);
}
}
return budgetVo; return budgetVo;
} }

6
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationOperationServiceImpl.java

@ -42,6 +42,12 @@ public class VtbVerificationOperationServiceImpl implements SeeYonOperationServi
private TbsActivityPayConditionService activityPayConditionService; private TbsActivityPayConditionService activityPayConditionService;
private TbsActivityService tbsActivityService; private TbsActivityService tbsActivityService;
@Override
public boolean checkSyFormIdIsNotNull(String targetId) {
VtbVerification verification = vtbVerificationMapper.selectById(targetId);
return verification.getSyFormId()!=null;
}
@Override @Override
public String getTemplateCode() { public String getTemplateCode() {
return TbsSeeYonConst.CostCheckConf.Code(); return TbsSeeYonConst.CostCheckConf.Code();

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

@ -247,6 +247,7 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
VtbVerificationSubject verificationSubject = new VtbVerificationSubject(); VtbVerificationSubject verificationSubject = new VtbVerificationSubject();
String vtbSubCode = verification.getVerificationCode()+"_"+countCode; String vtbSubCode = verification.getVerificationCode()+"_"+countCode;
verificationSubject.setVerificationSubCode(vtbSubCode); verificationSubject.setVerificationSubCode(vtbSubCode);
verificationSubject.setVerificationId(verification.getId());
countCode++; countCode++;
verificationSubject.setCostApplyId(costApply.getId()); verificationSubject.setCostApplyId(costApply.getId());
verificationSubject.setActivityId(activity.getId()); verificationSubject.setActivityId(activity.getId());

5
src/main/java/com/qs/serve/task/TbsTask.java

@ -45,10 +45,11 @@ public class TbsTask {
List<TbsCostApply> costApplyList = tbsCostApplyService.list(lqwApply); List<TbsCostApply> costApplyList = tbsCostApplyService.list(lqwApply);
List<Long> costApplyIds = costApplyList.stream().map(a->a.getId()).collect(Collectors.toList()); List<Long> costApplyIds = costApplyList.stream().map(a->a.getId()).collect(Collectors.toList());
//只更新审批完成的申请活动状态 //只更新审批完成的申请活动状态
LocalDate now = LocalDate.now();
LocalDate lastDay = now.plusDays(-1);
LambdaQueryWrapper<TbsActivity> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TbsActivity> lqw = new LambdaQueryWrapper<>();
lqw.in(TbsActivity::getCostApplyId,costApplyIds); lqw.in(TbsActivity::getCostApplyId,costApplyIds);
lqw.le(TbsActivity::getPreCheckDate, LocalDate.now()); lqw.le(TbsActivity::getPreCheckDate, lastDay);
lqw.eq(TbsActivity::getReopenFlag,0); lqw.eq(TbsActivity::getReopenFlag,0);
// 2-完成;4-已释放;5-已关闭 表流程已完结,冻结无意义 // 2-完成;4-已释放;5-已关闭 表流程已完结,冻结无意义
lqw.eq(TbsActivity::getActivityState,TbsActivityState.STATE_0_Todo); lqw.eq(TbsActivity::getActivityState,TbsActivityState.STATE_0_Todo);

62
src/main/resources/mapper/exl/ExlTableConfMapper.xml

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qs.serve.modules.exl.mapper.ExlTableConfMapper">
<resultMap id="exlTableConfMap" type="com.qs.serve.modules.exl.entity.ExlTableConf" >
<result property="id" column="id"/>
<result property="tableName" column="table_name"/>
<result property="excelTitle" column="excel_title"/>
<result property="enableFlag" column="enable_flag"/>
<result property="enableTime" column="enable_time"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="tenantId" column="tenant_id"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="exlTableConfSql">
exl_table_conf.`id`,
exl_table_conf.`table_name`,
exl_table_conf.`excel_title`,
exl_table_conf.`enable_flag`,
exl_table_conf.`enable_time`,
exl_table_conf.`remark`,
exl_table_conf.`create_time`,
exl_table_conf.`update_time`,
exl_table_conf.`tenant_id`,
exl_table_conf.`create_by`,
exl_table_conf.`update_by`,
exl_table_conf.`del_flag` </sql>
<select id="listData" resultType="java.util.Map">
select * from ${tableName}
<where>
<if test="query.leList!=null and query.leList.size > 0">
<foreach collection="query.leList" item ="item" index="i" open="(" close=")" separator=",">
and ${item.column} &lt;= #{item.value}
</foreach>
</if>
<if test="query.geList!=null and query.geList.size > 0">
<foreach collection="query.geList" item ="item" index="i" open="(" close=")" separator=",">
and ${item.column} &gt;= #{item.value}
</foreach>
</if>
<if test="query.eqList!=null and query.eqList.size > 0">
<foreach collection="query.eqList" item ="item" index="i" open="(" close=")" separator=",">
and ${item.column} = #{item.value}
</foreach>
</if>
<if test="query.likeList!=null and query.likeList.size > 0">
<foreach collection="query.likeList" item ="item" index="i" open="(" close=")" separator=",">
and ${item.column} like concat('%', #{item.value} ,'%')
</foreach>
</if>
</where>
limit #{query.startRow},#{query.pageSize}
</select>
</mapper>

2
src/main/resources/mapper/tbs/TbsBudgetChangeMapper.xml

@ -56,6 +56,7 @@
tbs_budget.`remark` tbs_budget.`remark`
from tbs_budget from tbs_budget
where tbs_budget.del_flag = 0 and `tbs_budget`.`budget_check_state` != 0 where tbs_budget.del_flag = 0 and `tbs_budget`.`budget_check_state` != 0
<if test="query.budgetId != null"> and `tbs_budget`.`id` = #{query.budgetId}</if>
<if test="query.title != null and query.title != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.title},'%') </if> <if test="query.title != null and query.title != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.title},'%') </if>
<if test="query.code != null and query.code != ''"> and `tbs_budget`.`budget_number` like concat('%',#{query.code},'%')</if> <if test="query.code != null and query.code != ''"> and `tbs_budget`.`budget_number` like concat('%',#{query.code},'%')</if>
<if test="query.budgetCheckState != null"> and `tbs_budget`.`budget_check_state` = #{query.budgetCheckState}</if> <if test="query.budgetCheckState != null"> and `tbs_budget`.`budget_check_state` = #{query.budgetCheckState}</if>
@ -98,6 +99,7 @@
and (`tbs_budget_change`.`change_code` like concat('%',#{query.code},'%') and (`tbs_budget_change`.`change_code` like concat('%',#{query.code},'%')
or `tbs_budget_change`.`budget_number` like concat('%',#{query.code},'%') ) or `tbs_budget_change`.`budget_number` like concat('%',#{query.code},'%') )
</if> </if>
<if test="query.budgetId != null"> and `tbs_budget_change`.`budget_id` = #{query.budgetId}</if>
<if test="query.title != null and query.title != ''"> and `tbs_budget_change`.`budget_title` like concat('%',#{query.title},'%') </if> <if test="query.title != null and query.title != ''"> and `tbs_budget_change`.`budget_title` like concat('%',#{query.title},'%') </if>
<if test="query.budgetCheckState != null"> and `tbs_budget_change`.`budget_check_state` = #{query.budgetCheckState}</if> <if test="query.budgetCheckState != null"> and `tbs_budget_change`.`budget_check_state` = #{query.budgetCheckState}</if>
<if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget_change`.`subject_code` like concat('%',#{query.subjectCode},'%') </if> <if test="query.subjectCode != null and query.subjectCode != ''"> and `tbs_budget_change`.`subject_code` like concat('%',#{query.subjectCode},'%') </if>

1
src/main/resources/mapper/tbs/TbsBudgetMapper.xml

@ -73,6 +73,7 @@
FROM `tbs_budget` `tbs_budget` FROM `tbs_budget` `tbs_budget`
LEFT JOIN `tbs_budget_condition` `tbs_budget_condition` ON `tbs_budget`.`id` = `tbs_budget_condition`.`budget_id` LEFT JOIN `tbs_budget_condition` `tbs_budget_condition` ON `tbs_budget`.`id` = `tbs_budget_condition`.`budget_id`
<where> <where>
<if test="query.budgetNumber !=null "> and `tbs_budget`.`budget_number` like concat('%',#{query.budgetNumber},'%')</if>
<if test="query.budgetState !=null "> and `tbs_budget`.`budget_state` = #{query.budgetState}</if> <if test="query.budgetState !=null "> and `tbs_budget`.`budget_state` = #{query.budgetState}</if>
<if test="query.budgetCode != null and query.budgetCode != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.budgetCode},'%')</if> <if test="query.budgetCode != null and query.budgetCode != ''"> and `tbs_budget`.`budget_code` like concat('%',#{query.budgetCode},'%')</if>
<if test="query.subjectValue != null and query.subjectValue != ''"> <if test="query.subjectValue != null and query.subjectValue != ''">

4
src/main/resources/mapper/tbs/TbsBudgetMatchMapper.xml

@ -19,7 +19,7 @@
<result property="usedBudgetAmount" column="used_budget_amount"/> <result property="usedBudgetAmount" column="used_budget_amount"/>
<result property="unUsedBudgetAmount" column="un_used_budget_amount"/> <result property="unUsedBudgetAmount" column="un_used_budget_amount"/>
<result property="budgetConditionFlag" column="budget_condition_flag"/> <result property="budgetConditionFlag" column="budget_condition_flag"/>
<result property="budgetSubjectId" column="subject_id"/> <result property="budgetSubjectId" column="budget_subject_id"/>
<result property="conditionGoodsIds" column="condition_goods_ids"/> <result property="conditionGoodsIds" column="condition_goods_ids"/>
<result property="budgetName" column="budget_name"/> <result property="budgetName" column="budget_name"/>
<result property="budgetCode" column="budget_code"/> <result property="budgetCode" column="budget_code"/>
@ -34,7 +34,7 @@
-- temp_tbg2.amt final_budget_amount, -- temp_tbg2.amt final_budget_amount,
-- temp_tbg3.amt used_budget_amount, -- temp_tbg3.amt used_budget_amount,
tb.condition_flag budget_condition_flag, tb.condition_flag budget_condition_flag,
tb.subject_id subject_id, tb.subject_id budget_subject_id,
tb.budget_code budget_name, tb.budget_code budget_name,
tb.budget_number budget_code, tb.budget_number budget_code,
tbc.target_level_path_ids condition_goods_ids tbc.target_level_path_ids condition_goods_ids

Loading…
Cancel
Save