Browse Source

预算审批功能补充附件

v1.0
Yen 2 years ago
parent
commit
24a5d5ae84
  1. 13
      src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java
  2. 1
      src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java
  3. 19
      src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java
  4. 2
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java

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

@ -10,6 +10,7 @@ import com.qs.serve.common.util.AuthContextUtils;
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.modules.sys.service.SysAttachService;
import com.qs.serve.modules.tbs.common.dto.TbsBudgetChangeVo;
import com.qs.serve.modules.tbs.entity.*;
import com.qs.serve.modules.tbs.entity.so.TbsBudgetChangeSo;
@ -20,6 +21,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -35,6 +37,7 @@ import java.util.stream.Collectors;
@RequestMapping("tbs/budgetChange")
public class TbsBudgetChangeController {
private SysAttachService sysAttachService;
private TbsBudgetChangeService tbsBudgetChangeService;
private TbsBudgetChangeScheduleItemService tbsBudgetChangeScheduleItemService;
private TbsBudgetChangeConditionService tbsBudgetChangeConditionService;
@ -73,6 +76,12 @@ public class TbsBudgetChangeController {
budgetChange.setChangeScheduleItemList(changeScheduleItemList);
budgetChange.setChangeConditionList(map.get(0));
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())));
}
return R.ok(budgetChange);
}
@ -98,6 +107,10 @@ public class TbsBudgetChangeController {
.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);
}

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

@ -268,6 +268,7 @@ public class TbsCostApplyController {
if(contract&&!supplier.getSupplierFlag().equals(1)){
return R.error("当前用户非供应商");
}
entity.setMatchType(1);
entity.setCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.CostApply));
entity.setSupplierCode(supplier.getCode());
entity.setSupplierName(supplier.getName());

19
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.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.qs.serve.common.framework.mybatis.handler.meta.SplitStringTypeHandler;
import lombok.Data;
import org.apache.ibatis.type.JdbcType;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
@ -23,7 +25,7 @@ import javax.validation.constraints.NotBlank;
* @since 2023-08-09
*/
@Data
@TableName("tbs_budget_change")
@TableName(value = "tbs_budget_change", autoResultMap = true)
public class TbsBudgetChange implements Serializable {
private static final long serialVersionUID = 1L;
@ -128,6 +130,15 @@ public class TbsBudgetChange implements Serializable {
@Length(max = 255,message = "备注长度不能超过255字")
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")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ -168,6 +179,12 @@ public class TbsBudgetChange implements Serializable {
@TableField(exist = false)
private List<?> changeConditionList;
@TableField(exist = false)
private List<?> newAttachInfos;
@TableField(exist = false)
private List<?> orgAttachInfos;
public static TbsBudgetChange toNewObject(TbsBudget source){
TbsBudgetChange budgetChange = new TbsBudgetChange();
//budgetChange.setId(source.getId());

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

@ -131,6 +131,8 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
*/
private TbsBudgetChange buildBudgetChange(TbsBudgetUpdateAfterStartBo param, TbsBudget budget,SysUser sysUser) {
TbsBudgetChange budgetChange = TbsBudgetChange.toNewObject(budget);
budgetChange.setOrgAttachIds(budget.getAttachIds());
budgetChange.setNewAttachIds(param.getAttachIds());
budgetChange.setChangeCode(CodeGenUtil.generate(CodeGenUtil.SourceKey.BudgetChange));
budgetChange.setUserId(sysUser.getId());
budgetChange.setUserCode(sysUser.getCode());

Loading…
Cancel
Save