Parcourir la source

物资-采购审核通过抄送仓管

huangguoce il y a 4 semaines
Parent
commit
02a7afb7df

+ 32 - 0
jeeplus-modules/jeeplus-psi-management/src/main/java/com/jeeplus/psimanage/purchase/service/PsiMaterialService.java

@@ -24,8 +24,10 @@ import com.jeeplus.psimanage.supplier.mapper.PsiMaterialSupplierMapper;
 import com.jeeplus.psimanage.oss.service.dto.WorkAttachmentDto;
 import com.jeeplus.psimanage.serialNumTpl.service.PsiSerialnumTplService;
 import com.jeeplus.sys.feign.IDictApi;
+import com.jeeplus.sys.feign.IRoleApi;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.feign.IWorkAttachmentApi;
+import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.jeeplus.utils.StringUtils;
@@ -310,6 +312,36 @@ public class PsiMaterialService {
         info.setHandledBy(dto.getHandledById());
         info.setUpdateTime(new Date());
         basicMapper.updateById(info);
+
+        //审核通过抄送仓库管理员
+        if(dto.getStatus().equals("5")){
+            Map<String, String> keyMap = new HashMap<>();
+            keyMap.put("name", "仓库管理员");
+            keyMap.put("tenantId", "10009");
+            List<RoleDTO> roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
+            RoleDTO role = roleDTO.get(0);
+            List<UserDTO> notifiedPartyUsers =SpringUtil.getBean(IUserApi.class).findListByRoleId(role.getId());
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+            String day = format.format(new Date());
+            String title = "[采购编号:"+dto.getPurchaseNo()+"]-采购申请审批通过";
+            //向用户发起通知
+            if (null != notifiedPartyUsers) {
+                for (UserDTO userDTO1 : notifiedPartyUsers) {
+                    //发送通知
+                    Map<String ,String > map = new HashMap<>();
+                    map.put("taskId",dto.getProcInsId());
+                    map.put("title",title);
+                    map.put("defId",dto.getProcessDefinitionId());
+                    map.put("taskName","采购申请审批通过");
+                    map.put("createUser","管理员");
+                    map.put("createTime",day);
+                    map.put("noticeName",userDTO1.getLoginName());
+                    map.put("noticeId",userDTO1.getId());
+                    map.put("createById",userDTO.getId());
+                    flowTaskService.add(map);
+                }
+            }
+        }
         // 修改报销详情列表信息
         // 删除原有数据
 //        LambdaQueryWrapper<MaterialDetailed> detailWrapper = new LambdaQueryWrapper<>();