¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; |
| | | import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; |
| | | import org.jeecg.modules.flowable.apithird.service.FlowCommonService; |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.tms.entity.*; |
| | | import org.jeecg.modules.tms.entity.dto.InboundOrderFlowDto; |
| | | import org.jeecg.modules.tms.entity.vo.InboundDetailVo; |
| | | import org.jeecg.modules.tms.mapper.InboundOrderMapper; |
| | | import org.jeecg.modules.tms.service.*; |
| | | import org.jeecg.modules.tms.utils.QrCodePrinterUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description: å
¥åºç³è¯·å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service("IInboundOrderService") |
| | | public class InboundOrderServiceImpl extends ServiceImpl<InboundOrderMapper, InboundOrder> implements IInboundOrderService, FlowCallBackServiceI { |
| | | |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | @Autowired |
| | | private IFlowDefinitionService flowDefinitionService; |
| | | |
| | | @Autowired |
| | | private IFlowTaskService flowTaskService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private IFlowMyBusinessService flowMyBusinessService; |
| | | |
| | | @Autowired |
| | | private IBaseToolsService baseToolsService; |
| | | |
| | | @Autowired |
| | | private IInStoreDetailService inStoreDetailService; |
| | | |
| | | @Autowired |
| | | private IToolLedgerService toolLedgerService; |
| | | |
| | | @Autowired |
| | | private IToolLedgerDetailService toolLedgerDetailService; |
| | | |
| | | @Autowired |
| | | private IInboundDetailService inboundDetailService; |
| | | |
| | | @Autowired |
| | | private IGoodsShelvesService goodsShelvesService; |
| | | @Override |
| | | public boolean submit(String id) { |
| | | InboundOrder inboundOrder = this.getById(id); |
| | | //åç¨åå磨å
¥åºæ¶æ ¡éªåºå |
| | | List<InboundDetail> inboundDetailList = inboundDetailService.lambdaQuery().eq(InboundDetail::getInStorehouseId,id).list(); |
| | | if("2".equals(inboundOrder.getInStorehouseType())){ |
| | | for(InboundDetail inboundDetail : inboundDetailList){ |
| | | if(StringUtils.isNotBlank(inboundDetail.getToolId())){ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolId,inboundDetail.getToolId()).one(); |
| | | if(toolLedgerDetail.getQuantity().compareTo(inboundDetail.getInStorageQuantity()) == 0){ |
| | | throw new JeecgBootException("ç¼ç 为ã" + toolLedgerDetail.getToolId() + "ãçå·¥å
·æªååºï¼ä¸éè¦å½è¿å
¥åºï¼"); |
| | | } |
| | | }else { |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId,inboundDetail.getToolCode()).one(); |
| | | if(toolLedger.getLendCount().compareTo(inboundDetail.getInStorageQuantity()) < 0){ |
| | | throw new JeecgBootException("ç¼ç 为ã" + toolLedger.getToolId() + "ãçå·¥å
·æªååºï¼ä¸éè¦å½è¿å
¥åºï¼"); |
| | | } |
| | | } |
| | | } |
| | | }else if("5".equals(inboundOrder.getInStorehouseType())){ |
| | | for(InboundDetail inboundDetail : inboundDetailList){ |
| | | if(StringUtils.isNotBlank(inboundDetail.getToolId())){ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolId,inboundDetail.getToolId()).one(); |
| | | if(toolLedgerDetail.getQuantity().compareTo(inboundDetail.getInStorageQuantity()) == 0){ |
| | | throw new JeecgBootException("ç¼ç 为ã" + toolLedgerDetail.getToolId() + "ãçå·¥å
·æªå磨ï¼ä¸éè¦å磨å
¥åºï¼"); |
| | | } |
| | | }else { |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId,inboundDetail.getToolCode()).one(); |
| | | if(toolLedger.getSharpeningCount().compareTo(inboundDetail.getInStorageQuantity()) < 0){ |
| | | throw new JeecgBootException("ç¼ç 为ã" + toolLedger.getToolId() + "ãçå·¥å
·æªå磨ï¼ä¸éè¦å磨å
¥åºï¼"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //åèµ·å®¡æ¹æµç¨ |
| | | this.triggerProcess(inboundOrder); |
| | | //æ´æ°å
¥åºå审æ¹ç¶æä¸ºå·²æäº¤ |
| | | inboundOrder.setOrderStatus("2"); |
| | | this.updateById(inboundOrder); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * è§¦åæµç¨ |
| | | * |
| | | * @param inboundOrder |
| | | * @return |
| | | */ |
| | | public boolean triggerProcess(InboundOrder inboundOrder) { |
| | | |
| | | flowCommonService.initActBusiness("å
¥åºç³è¯·åå·ï¼" + inboundOrder.getInboundNum()+"åèµ·å®¡æ¹æµç¨", |
| | | inboundOrder.getId(), "IInboundOrderService", "tool_in_storage", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", inboundOrder.getId()); |
| | | variables.put("organization", "æ°å¢å
¥åºç³è¯·åé»è®¤å¯å¨æµç¨"); |
| | | variables.put("comment", "æ°å¢å
¥åºç³è¯·åé»è®¤å¯å¨æµç¨"); |
| | | variables.put("proofreading", true); |
| | | List<String> usernames = new ArrayList<>(); |
| | | usernames.add(inboundOrder.getReviewer()); |
| | | variables.put("NextAssignee", usernames); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("tool_in_storage", variables); |
| | | return result.isSuccess(); |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//æ¥ä¸æ¥å®¡æ¹çèç¹ |
| | | business.getValues();//åç«¯ä¼ è¿æ¥çåæ° |
| | | business.getActStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public Object getBusinessDataById(String dataId) { |
| | | return this.getById(dataId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { |
| | | //ä¸å¡æ¯å¦å¹²é¢æµç¨ï¼ä¸å¡å¹²é¢ï¼æµç¨å¹²é¢ï¼æå®äººåè¿è¡å¤ç |
| | | //è·åä¸ä¸æ¥å¤ç人 |
| | | Object object = values.get("NextAssignee"); |
| | | return (List<String>) object; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void approvalProcess(InboundOrderFlowDto inboundOrderFlowDto) { |
| | | if (StrUtil.isBlank(inboundOrderFlowDto.getTaskId()) || StrUtil.isBlank(inboundOrderFlowDto.getDataId())) { |
| | | throw new JeecgBootException("鿳忰ï¼"); |
| | | } |
| | | |
| | | // è·åå½åç»å½ç¨æ· |
| | | LoginUser user = getCurrentUser(); |
| | | if (user == null || StrUtil.isBlank(user.getId())) { |
| | | throw new JeecgBootException("è´¦å·ä¸åå¨"); |
| | | } |
| | | |
| | | //è·åå
¥åºç³è¯·åä¿¡æ¯ |
| | | InboundOrder inboundOrder = getById(inboundOrderFlowDto.getDataId()); |
| | | if (inboundOrder == null) { |
| | | throw new JeecgBootException("æªæ¾å°å¯¹åºçåºåºç³è¯·åï¼"); |
| | | } |
| | | |
| | | //è·åæµç¨ä¸å¡è®°å½ |
| | | FlowMyBusiness flowMyBusiness = getFlowMyBusiness(inboundOrderFlowDto.getInstanceId()); |
| | | if (flowMyBusiness == null) { |
| | | throw new JeecgBootException("æµç¨è®°å½ä¸åå¨"); |
| | | } |
| | | |
| | | // æ£æ¥ç¨æ·æ¯å¦ææéæä½ä»»å¡ |
| | | if (!isUserAuthorized(flowMyBusiness, user)) { |
| | | throw new JeecgBootException("ç¨æ·æ ææä½æ¤ä»»å¡"); |
| | | } |
| | | |
| | | // 认é¢ä»»å¡ |
| | | if (!claimTask(flowMyBusiness.getTaskId(), user)) { |
| | | throw new JeecgBootException("ä»»å¡ä¸åå¨ã已宿æå·²è¢«ä»äººè®¤é¢"); |
| | | } |
| | | |
| | | //设置æµç¨åé |
| | | setupProcessVariables(inboundOrderFlowDto, inboundOrder, user); |
| | | |
| | | //宿æµç¨ä»»å¡ |
| | | Result result = flowTaskService.complete(inboundOrderFlowDto); |
| | | |
| | | //æ ¹æ®ä»»å¡å®æç»ææ´æ°ç³è¯·åç¶æ |
| | | if (result.isSuccess()) { |
| | | if ("3".equals(inboundOrderFlowDto.getStatus())) { |
| | | inboundOrder.setOrderStatus("3"); |
| | | }else if("4".equals(inboundOrderFlowDto.getStatus())){ |
| | | inboundOrder.setOrderStatus("1"); |
| | | } |
| | | inboundOrder.setReviewer(user.getUsername()); |
| | | inboundOrder.setApprovalDate(new Date()); |
| | | inboundOrder.setApprovalOpinion(inboundOrderFlowDto.getApprovalOpinion()); |
| | | updateById(inboundOrder); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String,String>> addInStorage(JSONObject jSONObject) { |
| | | String inStorehouseType = jSONObject.getString("inStorehouseType"); |
| | | String locationCodeId = jSONObject.getString("locationCodeId"); |
| | | //äºç»´ç æå°å表 |
| | | List<Map<String,String>> results = new ArrayList<>(); |
| | | List<String> contentList = new ArrayList<>(); |
| | | String classifyId = jSONObject.getString("classifyId"); |
| | | Date inboundTime = jSONObject.getDate("inboundTime"); |
| | | //è·åå
¥åºæç» |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<InboundDetailVo> inStoreDetailList =jsonArray.toJavaList(InboundDetailVo.class); |
| | | //æ°è´§å
¥åº |
| | | if("1".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList){ |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //æä½åºå,æ¥è¯¢æ»åºåæ¯å¦åå¨è¯¥ç±»åå
· |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId,inboundDetailVo.getToolCodeId()).one(); |
| | | if(toolLedger == null){ |
| | | ToolLedger newToolLedger = new ToolLedger(); |
| | | newToolLedger.setToolId(inboundDetailVo.getToolCodeId()); |
| | | newToolLedger.setAvailableCount(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedger.setTotalCount(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedger.setLendCount(BigDecimal.ZERO); |
| | | newToolLedger.setDetectionCount(BigDecimal.ZERO); |
| | | newToolLedger.setLossCount(BigDecimal.ZERO); |
| | | newToolLedger.setRepairCount(BigDecimal.ZERO); |
| | | newToolLedger.setSharpeningCount(BigDecimal.ZERO); |
| | | newToolLedger.setClassifyId(classifyId); |
| | | toolLedgerService.save(newToolLedger); |
| | | }else { |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setTotalCount(toolLedger.getTotalCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | } |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //循ç¯å
¥åºæ°éï¼ä¸ºå®ç©èµç |
| | | for(int i=0;i<inboundDetailVo.getInStorageQuantity().intValue();i++){ |
| | | BaseTools newBaseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //æ¥è¯¢å½åç¼ç |
| | | String currentCode = newBaseTools.getCurrentCode(); |
| | | //å°å符串转æ¢ä¸ºæ´æ° |
| | | int num = Integer.parseInt(currentCode); |
| | | //å 1æä½ |
| | | num++; |
| | | //转æ¢åå符串并ä¿çåå¯¼é¶ |
| | | String result = String.format("%0" + currentCode.length() + "d", num); |
| | | //æå°äºç»´ç |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("1"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getToolCode()+"-"+result); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //å¢å åºåæç» |
| | | ToolLedgerDetail toolLedgerDetail = new ToolLedgerDetail(); |
| | | toolLedgerDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setToolId(inboundDetailVo.getToolCode()+"-"+result); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.save(toolLedgerDetail); |
| | | //æ´æ°å½åç¼ç |
| | | newBaseTools.setCurrentCode(result); |
| | | baseToolsService.updateById(newBaseTools); |
| | | //æå°äºç»´ç |
| | | contentList.add(inboundDetailVo.getToolCode()+"-"+result); |
| | | } |
| | | //æå°äºç»´ç ï¼ææ¶æ³¨éï¼å¾
ç°åºè°è¯ææ æº |
| | | // for(String content : contentList){ |
| | | // Map<String,String> result = new HashMap<>(); |
| | | // result.put("content",content); |
| | | // result.put("image", QrCodePrinterUtils.generateBacthQRCode(content, 200, 200)); |
| | | // // çæäºç»´ç å¾çï¼Base64ï¼ |
| | | // results.add(result); |
| | | // } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("1"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //æ¥è¯¢åºåæç»ä¸æ¯å¦åå¨è¯¥å·¥å
· |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | if(toolLedgerDetail == null){ |
| | | ToolLedgerDetail newToolLedgerDetail = new ToolLedgerDetail(); |
| | | newToolLedgerDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | newToolLedgerDetail.setQuantity(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedgerDetail.setPositionCode(locationCodeId); |
| | | newToolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.save(newToolLedgerDetail); |
| | | }else { |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | } |
| | | } |
| | | //å½è¿å
¥åº |
| | | }else if("2".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList) { |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //å¢å å¯ç¨åºåï¼åå°ååºåºå |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId, inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setLendCount(toolLedger.getLendCount().subtract(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçç¨toolIdï¼ä¸ç®¡å°æçç¨toolCodeId |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery() |
| | | .eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()) |
| | | .eq(ToolLedgerDetail::getToolId,inboundDetailVo.getOnlyCode()).one(); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("2"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getOnlyCode()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("2"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | } |
| | | |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | }else if("5".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList) { |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //å¢å æ»åºååå¯ç¨åºåï¼åå°å磨åºå |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId, inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setSharpeningCount(toolLedger.getSharpeningCount().subtract(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçç¨toolIdï¼ä¸ç®¡å°æçç¨toolCodeId |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery() |
| | | .eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()) |
| | | .eq(ToolLedgerDetail::getToolId,inboundDetailVo.getOnlyCode()).one(); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("5"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getOnlyCode()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(inboundTime); |
| | | inStoreDetail.setOperateType("2"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("5"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | } |
| | | |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String,String>> addApplyInStorage(JSONObject jSONObject) { |
| | | String inStorehouseType = jSONObject.getString("inStorehouseType"); |
| | | String locationCodeId = jSONObject.getString("locationCodeId"); |
| | | //äºç»´ç æå°å表 |
| | | List<Map<String,String>> results = new ArrayList<>(); |
| | | List<String> contentList = new ArrayList<>(); |
| | | //å
¥åºç³è¯·åid |
| | | String orderId = jSONObject.getString("orderId"); |
| | | //è·åå
¥åºæç» |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<InboundDetailVo> inStoreDetailList =jsonArray.toJavaList(InboundDetailVo.class); |
| | | //æ°è´§å
¥åº |
| | | if("1".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList){ |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //æä½åºå,æ¥è¯¢æ»åºåæ¯å¦åå¨è¯¥ç±»åå
· |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId,inboundDetailVo.getToolCodeId()).one(); |
| | | if(toolLedger == null){ |
| | | ToolLedger newToolLedger = new ToolLedger(); |
| | | newToolLedger.setToolId(inboundDetailVo.getToolCodeId()); |
| | | newToolLedger.setAvailableCount(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedger.setTotalCount(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedger.setLendCount(BigDecimal.ZERO); |
| | | newToolLedger.setDetectionCount(BigDecimal.ZERO); |
| | | newToolLedger.setLossCount(BigDecimal.ZERO); |
| | | newToolLedger.setRepairCount(BigDecimal.ZERO); |
| | | newToolLedger.setSharpeningCount(BigDecimal.ZERO); |
| | | newToolLedger.setClassifyId(inboundDetailVo.getClassifyId()); |
| | | toolLedgerService.save(newToolLedger); |
| | | }else { |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setTotalCount(toolLedger.getTotalCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | } |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //循ç¯å
¥åºæ°éï¼ä¸ºå®ç©èµç |
| | | for(int i=0;i<inboundDetailVo.getInStorageQuantity().intValue();i++){ |
| | | BaseTools newBaseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //æ¥è¯¢å½åç¼ç |
| | | String currentCode = newBaseTools.getCurrentCode(); |
| | | //å°å符串转æ¢ä¸ºæ´æ° |
| | | int num = Integer.parseInt(currentCode); |
| | | //å 1æä½ |
| | | num++; |
| | | //转æ¢åå符串并ä¿çåå¯¼é¶ |
| | | String result = String.format("%0" + currentCode.length() + "d", num); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("1"); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getToolCode()+"-"+result); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //å¢å åºåæç» |
| | | ToolLedgerDetail toolLedgerDetail = new ToolLedgerDetail(); |
| | | toolLedgerDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | toolLedgerDetail.setToolId(inboundDetailVo.getToolCode()+"-"+result); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.save(toolLedgerDetail); |
| | | //æ´æ°å½åç¼ç |
| | | newBaseTools.setCurrentCode(result); |
| | | baseToolsService.updateById(newBaseTools); |
| | | //æå°äºç»´ç |
| | | contentList.add(inboundDetailVo.getToolCode()+"-"+result); |
| | | } |
| | | //æå°äºç»´ç ï¼ææ¶æ³¨éï¼å¾
ç°åºéªè¯ææ æº |
| | | // for(String content : contentList){ |
| | | // Map<String,String> result = new HashMap<>(); |
| | | // result.put("content",content); |
| | | // result.put("image", QrCodePrinterUtils.generateBacthQRCode(content, 200, 200)); |
| | | // // çæäºç»´ç å¾çï¼Base64ï¼ |
| | | // results.add(result); |
| | | // } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("1"); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //æ¥è¯¢åºåæç»ä¸æ¯å¦åå¨è¯¥å·¥å
· |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | if(toolLedgerDetail == null){ |
| | | ToolLedgerDetail newToolLedgerDetail = new ToolLedgerDetail(); |
| | | newToolLedgerDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | newToolLedgerDetail.setQuantity(inboundDetailVo.getInStorageQuantity()); |
| | | newToolLedgerDetail.setPositionCode(locationCodeId); |
| | | newToolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.save(newToolLedgerDetail); |
| | | }else { |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | } |
| | | //æ´æ¹æç»å
¥åºç¶æåå®é
å
¥åºæ°é |
| | | InboundDetail inboundDetail = inboundDetailService.getById(inboundDetailVo.getId()); |
| | | inboundDetail.setInStatus("3"); |
| | | inboundDetail.setInActualCount(inboundDetailVo.getInStorageQuantity()); |
| | | inboundDetailService.updateById(inboundDetail); |
| | | } |
| | | //å½è¿å
¥åº |
| | | }else if("2".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList) { |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //å¢å å¯ç¨åºåï¼åå°ååºåºå |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId, inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setLendCount(toolLedger.getLendCount().subtract(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçç¨toolIdï¼ä¸ç®¡å°æçç¨toolCodeId |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery() |
| | | .eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()) |
| | | .eq(ToolLedgerDetail::getToolId,inboundDetailVo.getOnlyCode()).one(); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("2"); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getOnlyCode()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("2"); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | } |
| | | //æ´æ¹æç»å
¥åºç¶æåå®é
å
¥åºæ°é |
| | | InboundDetail inboundDetail = inboundDetailService.getById(inboundDetailVo.getId()); |
| | | inboundDetail.setInStatus("3"); |
| | | inboundDetail.setInActualCount(inboundDetailVo.getInStorageQuantity()); |
| | | inboundDetailService.updateById(inboundDetail); |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | }else if("5".equals(inStorehouseType)){ |
| | | //å¾ªç¯æ°å¢æç» |
| | | for(InboundDetailVo inboundDetailVo : inStoreDetailList) { |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçæ¥è¯¢å½åç¼ç |
| | | BaseTools baseTools = baseToolsService.getById(inboundDetailVo.getToolCodeId()); |
| | | //å¢å æ»åºååå¯ç¨åºåï¼åå°å磨åºå |
| | | ToolLedger toolLedger = toolLedgerService.lambdaQuery().eq(ToolLedger::getToolId, inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedger.setAvailableCount(toolLedger.getAvailableCount().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedger.setSharpeningCount(toolLedger.getSharpeningCount().subtract(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerService.updateById(toolLedger); |
| | | //æ¥è¯¢æ¯å¦ç®¡å°æï¼ç®¡å°æçç¨toolIdï¼ä¸ç®¡å°æçç¨toolCodeId |
| | | //ç®¡å°æ |
| | | if("1".equals(baseTools.getAccuracyClass())){ |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery() |
| | | .eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()) |
| | | .eq(ToolLedgerDetail::getToolId,inboundDetailVo.getOnlyCode()).one(); |
| | | toolLedgerDetail.setQuantity(BigDecimal.ONE); |
| | | toolLedgerDetail.setRemainingPercentage(BigDecimal.ONE); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(BigDecimal.ONE); |
| | | inStoreDetail.setInStorehouseType("5"); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setToolId(inboundDetailVo.getOnlyCode()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | //ä¸ç®¡å°æ |
| | | }else { |
| | | //å¢å åºåæç»å¯ç¨åºåï¼ä¿®æ¹ç¶æ |
| | | ToolLedgerDetail toolLedgerDetail = toolLedgerDetailService.lambdaQuery().eq(ToolLedgerDetail::getToolCode,inboundDetailVo.getToolCodeId()).one(); |
| | | toolLedgerDetail.setQuantity(toolLedgerDetail.getQuantity().add(inboundDetailVo.getInStorageQuantity())); |
| | | toolLedgerDetail.setStatus("1"); |
| | | toolLedgerDetail.setPositionCode(locationCodeId); |
| | | toolLedgerDetailService.updateById(toolLedgerDetail); |
| | | //ä¿åå
¥åºæµæ°´ |
| | | InStoreDetail inStoreDetail = new InStoreDetail(); |
| | | inStoreDetail.setInboundTime(new Date()); |
| | | inStoreDetail.setOperateType("1"); |
| | | inStoreDetail.setInNumber(inboundDetailVo.getInStorageQuantity()); |
| | | inStoreDetail.setInStorehouseType("5"); |
| | | inStoreDetail.setInStorehouseId(orderId); |
| | | inStoreDetail.setToolCode(inboundDetailVo.getToolCodeId()); |
| | | inStoreDetail.setGoodsShelvesId(locationCodeId); |
| | | inStoreDetailService.save(inStoreDetail); |
| | | } |
| | | //æ´æ¹æç»å
¥åºç¶æåå®é
å
¥åºæ°é |
| | | InboundDetail inboundDetail = inboundDetailService.getById(inboundDetailVo.getId()); |
| | | inboundDetail.setInStatus("3"); |
| | | inboundDetail.setInActualCount(inboundDetailVo.getInStorageQuantity()); |
| | | inboundDetailService.updateById(inboundDetail); |
| | | } |
| | | Map<String,String> result = new HashMap<>(); |
| | | result.put("content","ä¿åæå"); |
| | | results.add(result); |
| | | } |
| | | //æ´æ¹ç³è¯·åå
¥åºç¶æ |
| | | InboundOrder inboundOrder = this.getById(orderId); |
| | | List<InboundDetail> inboundDetailList = inboundDetailService.lambdaQuery().eq(InboundDetail::getInStorehouseId,orderId).list(); |
| | | boolean flag = inboundDetailList.stream().allMatch(inboundDetail -> "3".equals(inboundDetail.getInStatus())); |
| | | if(flag){ |
| | | inboundOrder.setInStatus("3"); |
| | | }else { |
| | | inboundOrder.setInStatus("2"); |
| | | } |
| | | this.updateById(inboundOrder); |
| | | return results; |
| | | } |
| | | |
| | | private LoginUser getCurrentUser() { |
| | | // è·åå½å认è¯çç»å½ç¨æ·ä¿¡æ¯ |
| | | Subject currentUser = SecurityUtils.getSubject(); |
| | | if (currentUser != null && currentUser.isAuthenticated()) { |
| | | Object principal = currentUser.getPrincipal(); |
| | | if (principal instanceof LoginUser) { |
| | | return (LoginUser) principal; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private FlowMyBusiness getFlowMyBusiness(String instanceId) { |
| | | List<FlowMyBusiness> businessList = flowMyBusinessService.list( |
| | | new LambdaQueryWrapper<FlowMyBusiness>().eq(FlowMyBusiness::getProcessInstanceId, instanceId)); |
| | | return businessList.isEmpty() ? null : businessList.get(0); |
| | | } |
| | | |
| | | private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { |
| | | List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); |
| | | return todoUsers != null && todoUsers.contains(user.getUsername()); |
| | | } |
| | | |
| | | private boolean claimTask(String taskId, LoginUser user) { |
| | | Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
| | | if (task == null) { |
| | | return false; |
| | | } |
| | | if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { |
| | | return false; |
| | | } |
| | | taskService.claim(taskId, user.getUsername()); |
| | | return true; |
| | | } |
| | | |
| | | private void setupProcessVariables(InboundOrderFlowDto inboundOrderFlowDto, InboundOrder inboundOrder, LoginUser user) { |
| | | if ("2".equals(inboundOrder.getOrderStatus()) && user.getUsername().equals(inboundOrder.getReviewer())) { |
| | | Map<String, Object> values = new HashMap<>(); |
| | | values.put("dataId", inboundOrder.getId()); |
| | | values.put("organization", inboundOrderFlowDto.getApprovalOpinion()); |
| | | values.put("comment", inboundOrderFlowDto.getApprovalOpinion()); |
| | | values.put("status", inboundOrderFlowDto.getStatus()); |
| | | values.put("NextAssignee", Collections.singletonList(inboundOrder.getReviewer())); |
| | | inboundOrderFlowDto.setValues(values); |
| | | } |
| | | } |
| | | } |