From cec870f99fa6e3f2535c33ca1f93e0d0de686702 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期一, 31 三月 2025 10:48:28 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessSpecVersionServiceImpl.java | 28 +++++++++++++++++++++------- 1 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessSpecVersionServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessSpecVersionServiceImpl.java index 370f098..22055f0 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessSpecVersionServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessSpecVersionServiceImpl.java @@ -21,10 +21,7 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; +import java.util.*; @Service public class ProcessSpecVersionServiceImpl extends ServiceImpl<ProcessSpecVersionMapper, ProcessSpecVersion> implements IProcessSpecVersionService{ @@ -45,6 +42,10 @@ private IProcessSpecVersionDepartmentService processSpecVersionDepartmentService; @Autowired private IProductMixService productMixService; + @Autowired + private IWorkStepService workStepService; + @Autowired + private IProductPermissionService productPermissionService; /** * 鏍规嵁鐢ㄦ埛id鑾峰彇鎺堟潈鐨勫伐鑹鸿绋嬬増鏈〃淇℃伅 * @param userId @@ -144,16 +145,22 @@ ExceptionCast.cast(CommonCode.FAIL); } } + //娣诲姞鐢ㄦ埛鏉冮檺 + b = productPermissionService.add(ProcessSpecVersion.getId(), userId,"4"); + if (!b) { + ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); + } //娣诲姞缁撴瀯鏍� ProductMix productMix = new ProductMix(Long.parseLong(ProcessSpecVersion.getId()),Long.parseLong(ProcessSpecVersion.getPartsId()) - ,ProcessSpecVersion.getProcessSpecVersionName(),ProcessSpecVersion.getProcessSpecVersionCode(),"4"); + ,ProcessSpecVersion.getProcessSpecVersionName(), + ProcessSpecVersion.getProcessSpecVersionCode(),4,new Date()); productMixService.save(productMix); //娣诲姞鐢ㄦ埛鏉冮檺 PermissionStreamNew stream = new PermissionStreamNew(); stream.setBusinessId(ProcessSpecVersion.getId()); stream.setBusinessType("4"); stream.setUserId(userId); - return permissionStreamNewService.save(stream); + return permissionStreamNewService.addPermissionStreamNew(stream); } /** @@ -178,6 +185,11 @@ processSpecVersion.setComponentId(null); processSpecVersion.setPartsId(null); boolean b = super.updateById(processSpecVersion); + //鍚屾淇敼缁撴瀯鏍� + ProductMix productMix = productMixService.getById(Long.parseLong(id)); + productMix.setName(processSpecVersion.getProcessSpecVersionName()); + productMix.setCode(processSpecVersion.getProcessSpecVersionCode()); + productMixService.updateById(productMix); if(!b) return false; ProcessSpecVersionPermission permission = processSpecVersionPermissionService.getByPsvIdAndUserId(id, userId); @@ -211,7 +223,7 @@ ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST); List<ProcessStream> processStreams = processStreamService.findBypsvId(id); if(processStreams!= null &&!processStreams.isEmpty()) - ExceptionCast.cast(PartsInfoCode.PARTS_PROCESS_EXIST); + ExceptionCast.cast(PartsInfoCode.PROCESSSPECVERSION_PROCESS_EXIST); boolean b = processSpecVersionPermissionService.deleteByPsvId(processSpecVersion.getId()); if(!b) ExceptionCast.cast(CommonCode.FAIL); @@ -439,6 +451,8 @@ */ @Override public Result<?> getProcessSpecVersionCount(String processSpecId){ + List<ProcessStream> list = processStreamService.findBypsvId(processSpecId); + List<WorkStep> workStepList=workStepService.list(new LambdaQueryWrapper<WorkStep>().eq(WorkStep::getPsvId,processSpecId)); return null; } } -- Gitblit v1.9.3