From 24a5d5ae8439e48de62f4e65f763f6d7a1b43f3d Mon Sep 17 00:00:00 2001 From: Yen Date: Mon, 14 Aug 2023 09:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=AE=97=E5=AE=A1=E6=89=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E8=A1=A5=E5=85=85=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TbsBudgetChangeController.java | 13 +++++++++++++ .../controller/TbsCostApplyController.java | 1 + .../modules/tbs/entity/TbsBudgetChange.java | 19 ++++++++++++++++++- .../impl/TbsBudgetChangeServiceImpl.java | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java index 8ada7b07..8befb337 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java +++ b/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); } diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java index c5ac2a41..028e4584 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsCostApplyController.java +++ b/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()); diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java b/src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java index cb0d4bf2..e606b25b 100644 --- a/src/main/java/com/qs/serve/modules/tbs/entity/TbsBudgetChange.java +++ b/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()); diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java index 14edb2d9..cfc14264 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java @@ -131,6 +131,8 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl