From 3a102b246b592e5e1dd34d6de07a8191de90a8e1 Mon Sep 17 00:00:00 2001
From: 李白 <7387820+wjli_13439841639@user.noreply.gitee.com>
Date: 星期五, 29 五月 2026 11:15:17 +0800
Subject: [PATCH] 开票前基础数据设置
---
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductionPlanController.java | 57 +++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 37 insertions(+), 20 deletions(-)
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductionPlanController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductionPlanController.java
index 234d838..662ad16 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductionPlanController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductionPlanController.java
@@ -7,12 +7,16 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.by4cloud.platformx.business.entity.ContractSubjectMatter;
+import com.by4cloud.platformx.business.entity.PlanSubjectMatter;
import com.by4cloud.platformx.business.service.ContractSubjectMatterService;
+import com.by4cloud.platformx.business.service.PlanSubjectMatterService;
+import com.by4cloud.platformx.business.utils.ContractNumberGenerator;
import com.by4cloud.platformx.common.core.util.R;
import com.by4cloud.platformx.common.data.mybatis.BaseModel;
import com.by4cloud.platformx.common.log.annotation.SysLog;
import com.by4cloud.platformx.business.entity.ProductionPlan;
import com.by4cloud.platformx.business.service.ProductionPlanService;
+import com.by4cloud.platformx.common.security.util.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
@@ -42,7 +46,8 @@
public class ProductionPlanController {
private final ProductionPlanService productionPlanService;
- private final ContractSubjectMatterService contractSubjectMatterService;
+ //private final ContractSubjectMatterService contractSubjectMatterService;
+ private final PlanSubjectMatterService planSubjectMatterService;
/**
* 鍒嗛〉鏌ヨ
@@ -62,10 +67,10 @@
Page<ProductionPlan> page1 = productionPlanService.page(page, wrapper);
List<ProductionPlan> list = page1.getRecords();
for(ProductionPlan plan : list){
- List<ContractSubjectMatter> metterList = contractSubjectMatterService.list(new LambdaQueryWrapper<ContractSubjectMatter>()
- .eq(ContractSubjectMatter::getProductionPlanId,plan.getId())
+ List<PlanSubjectMatter> metterList = planSubjectMatterService.list(new LambdaQueryWrapper<PlanSubjectMatter>()
+ .eq(PlanSubjectMatter::getPlanId,plan.getId())
);
- plan.setContractSubjectMatterList(metterList);
+ plan.setPlanSubjectMatterList(metterList);
}
page1.setRecords(list);
return R.ok(page1);
@@ -97,10 +102,10 @@
if(productionPlan==null){
return R.failed("id閿欒锛�");
}
- List<ContractSubjectMatter> list = contractSubjectMatterService.list(new LambdaQueryWrapper<ContractSubjectMatter>()
- .eq(ContractSubjectMatter::getProductionPlanId,productionPlan.getId())
+ List<PlanSubjectMatter> list = planSubjectMatterService.list(new LambdaQueryWrapper<PlanSubjectMatter>()
+ .eq(PlanSubjectMatter::getPlanId,productionPlan.getId())
);
- productionPlan.setContractSubjectMatterList(list);
+ productionPlan.setPlanSubjectMatterList(list);
return R.ok(productionPlan);
}
@@ -117,14 +122,16 @@
if(StrUtil.isEmpty(productionPlan.getProductionPlanName())){
return R.failed("鎺掍骇璁″垝鍚嶇О涓嶈兘涓虹┖锛�");
}
+ productionPlan.setPartybid(SecurityUtils.getUser().getCompId());
+ productionPlan.setPartyb(SecurityUtils.getUser().getCompName());
+ productionPlan.setProductionPlanNo("p-"+ContractNumberGenerator.generateContractNumber());
productionPlanService.save(productionPlan);
- if(productionPlan.getContractSubjectMatterList()!=null){
- for(ContractSubjectMatter matter1 : productionPlan.getContractSubjectMatterList()){
- matter1.setProductionPlanId(productionPlan.getId());
- matter1.setProductionPlanName(productionPlan.getProductionPlanName());
+ if(productionPlan.getPlanSubjectMatterList()!=null){
+ for(PlanSubjectMatter matter1 : productionPlan.getPlanSubjectMatterList()){
+ matter1.setPlanId(productionPlan.getId());
}
- contractSubjectMatterService.saveBatch(productionPlan.getContractSubjectMatterList());
+ planSubjectMatterService.saveBatch(productionPlan.getPlanSubjectMatterList());
}
return R.ok(true);
@@ -141,8 +148,8 @@
@PreAuthorize("@pms.hasPermission('business_productionPlan_edit')" )
public R updateById(@RequestBody ProductionPlan productionPlan) {
- List<ContractSubjectMatter> list = contractSubjectMatterService.list(new LambdaQueryWrapper<ContractSubjectMatter>()
- .eq(ContractSubjectMatter::getProductionPlanId,productionPlan.getId())
+ List<PlanSubjectMatter> list = planSubjectMatterService.list(new LambdaQueryWrapper<PlanSubjectMatter>()
+ .eq(PlanSubjectMatter::getPlanId,productionPlan.getId())
);
List<Long> idsO = new ArrayList<>();
if(list!=null){
@@ -151,21 +158,20 @@
}
}
- if(productionPlan.getContractSubjectMatterList()!=null){
+ if(productionPlan.getPlanSubjectMatterList()!=null){
List<Long> idsN = new ArrayList<>();
- for(ContractSubjectMatter matter : productionPlan.getContractSubjectMatterList()){
+ for(PlanSubjectMatter matter : productionPlan.getPlanSubjectMatterList()){
if(matter.getId()==null){
- matter.setProductionPlanId(productionPlan.getId());
- matter.setProductionPlanName(productionPlan.getProductionPlanName());
+ matter.setPlanId(productionPlan.getId());
}else{
idsN.add(matter.getId());
}
}
- contractSubjectMatterService.saveOrUpdateBatch(productionPlan.getContractSubjectMatterList());
+ planSubjectMatterService.saveOrUpdateBatch(productionPlan.getPlanSubjectMatterList());
if(!idsO.isEmpty()) {
for (Long id : idsO) {
if (!idsN.contains(id)) {
- contractSubjectMatterService.removeById(id);
+ planSubjectMatterService.removeById(id);
}
}
}
@@ -199,4 +205,15 @@
public List<ProductionPlan> export(ProductionPlan productionPlan,Long[] ids) {
return productionPlanService.list(Wrappers.lambdaQuery(productionPlan).in(ArrayUtil.isNotEmpty(ids), ProductionPlan::getId, ids));
}
+
+ /**
+ * 鍚姩瀹℃牳娴佺▼
+ * @param id id
+ * @return R
+ */
+ @Operation(summary = "閫氳繃id鍚姩瀹℃牳娴佺▼" , description = "閫氳繃id鍚堝悓鐢熸晥" )
+ @GetMapping("/startApproval/{id}" )
+ public R startApproval(@PathVariable("id" ) Long id) {
+ return productionPlanService.startApproval(id);
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1