待办关注提醒按文档修改

This commit is contained in:
z 2025-02-15 20:44:05 +08:00
parent 7d10143442
commit ddcd521075
13 changed files with 304 additions and 112 deletions

View File

@ -65,5 +65,7 @@ public class MaterialPlanBoomDO extends BaseDO {
private String compositionName;
@TableField(exist = false)
private Long compositionId;
@TableField(exist = false)
private String projectMaterialPlanNo;
}

View File

@ -7,6 +7,7 @@ import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO;
@ -15,6 +16,7 @@ import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper;
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.util.StringUtils;
/**
@ -66,6 +68,8 @@ public interface MaterialPlanBoomMapper extends BaseMapperX<MaterialPlanBoomDO>
return selectPage(reqVO,query);
}
List<MaterialPlanBoomDO> selectafterten(@Param("id") Long txrid, @Param("evday") String evday);
// default PageResult<MaterialPlanBoomDO> selectPage(MaterialPlanBoomPageReqVO reqVO) {
// return selectPage(reqVO, new LambdaQueryWrapperX<MaterialPlanBoomDO>()
// .eqIfPresent(MaterialPlanBoomDO::getId, reqVO.getId())

View File

@ -16,6 +16,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import org.apache.ibatis.annotations.Mapper;
import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.util.StringUtils;
/**
@ -78,7 +79,7 @@ public interface MaterialPlanDetailMapper extends BaseMapperX<MaterialPlanDetail
// .orderByDesc(MaterialPlanDetailDO::getId));
// }
List<MaterialPlanDetailDO> selectafterten(Long id);
List<MaterialPlanDetailDO> selectafterten(@Param("id") Long id, @Param("evday") String evday);
List<MaterialPlanDetailDO> selectafterten1();
}

View File

@ -1,6 +1,7 @@
package com.chanko.yunxi.mes.module.heli.service.bdgzsomthing;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.useragent.UserAgentUtil;
import cn.hutool.system.SystemUtil;
import com.alibaba.fastjson.JSON;
@ -10,6 +11,8 @@ import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchPageReqVO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.pgmaster.PgMasterLineDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO;
@ -22,6 +25,8 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.weiXinXiaoXi.WeixinXiaoXi
import com.chanko.yunxi.mes.module.heli.dal.dataobject.zjpgmaster.ZjPgMasterLineDO;
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplan.MaterialPlanMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplandetail.MaterialPlanDetailMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.pgmaster.PgMasterMapper;
import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper;
@ -31,6 +36,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetai
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper;
import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchTypeEnum;
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
import com.chanko.yunxi.mes.module.heli.service.materialplan.MaterialPlanService;
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
import com.chanko.yunxi.mes.module.system.api.user.dto.AdminUserRespDTO;
import com.chanko.yunxi.mes.module.system.controller.admin.user.UserController;
@ -62,6 +68,7 @@ import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.chanko.yunxi.mes.module.heli.controller.admin.bdgzsomthing.vo.*;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
@ -108,6 +115,11 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
private PgMasterMapper pgMasterMapper;
@Resource
private ProjectOrderMapper projectOrderMapper;
@Resource
private MaterialPlanBoomMapper materialPlanBoomMapper;
@Resource
private MaterialPlanMapper materialPlanMapper;
@Override
public Long createbdgzsomthing(bdgzsomthingSaveReqVO createReqVO) {
// 插入
@ -307,7 +319,18 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectOne(new LambdaQueryWrapper<TaskDispatchDO>().eq(TaskDispatchDO::getCode, deliverOrderDO.getCode()));
if (ObjectUtil.isNotEmpty(taskDispatchDO)){
AdminUserDO user = adminUserService.getUser(Long.valueOf(taskDispatchDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}//提醒人
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
@ -324,7 +347,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
//去重查询,重复则不加
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
System.out.println("生产任务单"+BdgzsomthingDO);
if(selecteqint.size()>0){
}else{
@ -395,7 +418,18 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectOne(new LambdaQueryWrapper<TaskDispatchDO>().eq(TaskDispatchDO::getCode, deliverOrderDO.getCode()));
if (ObjectUtil.isNotEmpty(taskDispatchDO)){
AdminUserDO user = adminUserService.getUser(Long.valueOf(taskDispatchDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}//提醒人
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
@ -690,7 +724,15 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
AdminUserDO user = adminUserService.getUser(Long.valueOf(deliverOrderDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}//提醒人
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
@ -734,6 +776,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
attentiontodoDO.setAttr5("1");
attentiontodoDO.setAttr4(userApi.getUser( Long.parseLong(storageLogNowDO.getCreator())).getNickname()); //改对应
attentiontodoDO.setLevel("1");
attentiontodoDO.setEvday("10");
attentiontodookddfh9.add(attentiontodoDO);
@ -759,13 +802,26 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
for (AttentiontodoDO attentiontodoRespVO : attentiontodookddfh9) {
List<MaterialPlanDetailDO> selectafterten = materialPlanDetailMapper.selectafterten(attentiontodoRespVO.getTxrid());
List<MaterialPlanDetailDO> selectafterten = materialPlanDetailMapper.selectafterten(attentiontodoRespVO.getTxrid(),attentiontodoRespVO.getEvday());
List<MaterialPlanBoomDO> selectafterten1 = materialPlanBoomMapper.selectafterten(attentiontodoRespVO.getTxrid(), attentiontodoRespVO.getEvday());
Set<String> uniqueProjectMaterialPlanNos = Stream.concat(selectafterten.stream(), selectafterten1.stream())
.map(obj -> {
if (obj instanceof MaterialPlanDetailDO) {
return ((MaterialPlanDetailDO) obj).getProjectMaterialPlanNo();
} else if (obj instanceof MaterialPlanBoomDO) {
return ((MaterialPlanBoomDO) obj).getProjectMaterialPlanNo();
} else {
throw new IllegalArgumentException("Unexpected object type");
}
})
.collect(Collectors.toSet());
{
for (MaterialPlanDetailDO deliverOrderDO : selectafterten) {
for (String projectMaterialPlanNo : uniqueProjectMaterialPlanNos) {
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
BdgzsomthingDO.setAttr4("0");//是否点击
BdgzsomthingDO.setThings("计划单号:"+deliverOrderDO.getProjectMaterialPlanNo()+"货物临近到货日期");//事件名称
BdgzsomthingDO.setThings("计划单号:"+projectMaterialPlanNo+"货物临近到货日期");//事件名称
BdgzsomthingDO.setAttr2(null);//因为不用跳转所以为null
BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
BdgzsomthingDO.setTenantId(attentiontodoRespVO.getTxrid());
@ -776,7 +832,18 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
MaterialPlanDO planDO = materialPlanMapper.selectOne(new LambdaQueryWrapper<MaterialPlanDO>().eq(MaterialPlanDO::getProjectMaterialPlanNo, projectMaterialPlanNo));
if (ObjectUtil.isNotEmpty(planDO)){
AdminUserDO user = adminUserService.getUser(Long.valueOf(planDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
@ -788,7 +855,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
}
BdgzsomthingDO.setYesorno("0");//是否点击
BdgzsomthingDO.setAttr3(deliverOrderDO.getProjectMaterialPlanNo());//获取数据当前表的id
BdgzsomthingDO.setAttr3(projectMaterialPlanNo);//获取数据当前表的id
BdgzsomthingDO.setShowname(null);//获取数据当前表的创建事件
//去重查询,重复则不加
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqintone(BdgzsomthingDO);
@ -814,6 +881,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
}
public int updateById(bdgzsomthingDO entity){

View File

@ -1,8 +1,20 @@
package com.chanko.yunxi.mes.module.heli.service.materialplan;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.chanko.yunxi.mes.framework.common.util.object.ObjectUtils;
import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO;
import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO;
import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMapper;
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService;
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
import com.chanko.yunxi.mes.module.system.service.user.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -39,6 +51,15 @@ public class MaterialPlanServiceImpl implements MaterialPlanService {
@Resource
private SerialNumberService serialNumberService;
@Resource
private AdminUserApi userApi;
@Autowired
private AttentiontodoService attentiontodoService;
@Resource
private AttentiontodoMapper attentiontodoMapper;
@Resource
private AdminUserService adminUserService;
@Resource
private com.chanko.yunxi.mes.module.heli.dal.mysql.bdgzsomthing.bdgzsomthingMapper bdgzsomthingMapper;
@Override
public Long createMaterialPlan(MaterialPlanSaveReqVO createReqVO) {
@ -72,6 +93,73 @@ public class MaterialPlanServiceImpl implements MaterialPlanService {
LocalDateTime currTime = LocalDateTime.now();
if(updateReqVO.getStatus()==2){
updateObj.setSubmitTime(currTime);
MaterialPlanDO materialPlanDO = materialPlanMapper.selectById(updateReqVO.getId());
List<AttentiontodoDO> attentiontodook = attentiontodoMapper.selectByIdlist(8);//查找该类型的待办和关注人
String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
List<AttentiontodoDO> attentiontodook1 = attentiontodoService.getAttentiontodolistdaiban(8);
if (attentiontodook1.size()<1){
{
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
attentiontodoDO.setEvent("《物料需求计划》提交后");
attentiontodoDO.setAttr5("1");
attentiontodoDO.setAttr4(nickname);
attentiontodoDO.setLevel("1");
attentiontodook.add(attentiontodoDO);
}
}
for (AttentiontodoDO attentiontodoRespVO : attentiontodook) {
{
// for (StorageLogNowDO storageLogNowDO : pageResult) {
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
BdgzsomthingDO.setThings(materialPlanDO.getProjectMaterialPlanNo()+"已提交送审");//事件名称
BdgzsomthingDO.setAttr2(materialPlanDO.getProjectMaterialPlanNo());//跳转携带参数
BdgzsomthingDO.setAttr3(materialPlanDO.getProjectMaterialPlanNo());//独特标识
// BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
// BdgzsomthingDO.setShowname(new Date());比较创建时间,不用单独填写
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
BdgzsomthingDO.setDborgz("待办");
}
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
AdminUserDO user = adminUserService.getUser(Long.valueOf(materialPlanDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
else if(attentiontodoRespVO.getLevel().equals("2")){
BdgzsomthingDO.setLevel("一般");
}
else if(attentiontodoRespVO.getLevel().equals("3")){
BdgzsomthingDO.setLevel("非紧急");
}
// BdgzsomthingDO.setClick(attentiontodoRespVO.getRemindman());//提醒人
BdgzsomthingDO.setYesorno("0");//是否点击
BdgzsomthingDO.setAttr4("0");//是否已处理
// BdgzsomthingDO.setShowname(operateReqVO.getCreateTime());//获取数据当前表的创建事件
bdgzsomthingMapper.insert(BdgzsomthingDO);
// }
}
}
}
if(updateReqVO.getStatus()== 3){
updateObj.setAuditTime(currTime);
@ -79,10 +167,10 @@ public class MaterialPlanServiceImpl implements MaterialPlanService {
materialPlanMapper.updateById(updateObj);
bdgzsomthingDO abc= new bdgzsomthingDO();
abc.setThingname("《物料需求计划》提交后");
abc.setAttr3(updateObj.getProjectMaterialPlanNo());
bdgzsomthingMapper.updateok(abc);
// bdgzsomthingDO abc= new bdgzsomthingDO();
// abc.setThingname("《物料需求计划》提交后");
// abc.setAttr3(updateObj.getProjectMaterialPlanNo());
// bdgzsomthingMapper.updateok(abc);
}

View File

@ -36,11 +36,7 @@ import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
@Service
@Validated
public class MaterialPlanDetailServiceImpl implements MaterialPlanDetailService {
@Resource
private AdminUserApi userApi;
@Autowired
private AttentiontodoService attentiontodoService;
@Resource
private MaterialPlanMapper materialPlanMapper;
@Resource
@ -66,65 +62,7 @@ public class MaterialPlanDetailServiceImpl implements MaterialPlanDetailService
MaterialPlanDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPlanDetailDO.class);
materialPlanDetailMapper.updateById(updateObj);
//需求计划送审 完美点击插入
MaterialPlanDO materialPlanDO = materialPlanMapper.selectById(updateObj.getProjectMaterialPlanId());
List<AttentiontodoDO> attentiontodook = attentiontodoMapper.selectByIdlist(8);//查找该类型的待办和关注人
String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
List<AttentiontodoDO> attentiontodook1 = attentiontodoService.getAttentiontodolistdaiban(8);
if (attentiontodook1.size()<1){
{
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
attentiontodoDO.setEvent("《物料需求计划》提交后");
attentiontodoDO.setAttr5("1");
attentiontodoDO.setAttr4(nickname);
attentiontodoDO.setLevel("1");
attentiontodook.add(attentiontodoDO);
}
}
for (AttentiontodoDO attentiontodoRespVO : attentiontodook) {
{
// for (StorageLogNowDO storageLogNowDO : pageResult) {
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
BdgzsomthingDO.setThings(materialPlanDO.getProjectMaterialPlanNo()+"已提交送审");//事件名称
BdgzsomthingDO.setAttr2(materialPlanDO.getProjectMaterialPlanNo());//跳转携带参数
BdgzsomthingDO.setAttr3(materialPlanDO.getProjectMaterialPlanNo());//独特标识
// BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
// BdgzsomthingDO.setShowname(new Date());比较创建时间,不用单独填写
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
BdgzsomthingDO.setDborgz("待办");
}
else if(attentiontodoRespVO.getAttr5().equals("2")){
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if(attentiontodoRespVO.getLevel().equals("1")){
BdgzsomthingDO.setLevel("紧急");
}
else if(attentiontodoRespVO.getLevel().equals("2")){
BdgzsomthingDO.setLevel("一般");
}
else if(attentiontodoRespVO.getLevel().equals("3")){
BdgzsomthingDO.setLevel("非紧急");
}
// BdgzsomthingDO.setClick(attentiontodoRespVO.getRemindman());//提醒人
BdgzsomthingDO.setYesorno("0");//是否点击
BdgzsomthingDO.setAttr4("0");//是否已处理
// BdgzsomthingDO.setShowname(operateReqVO.getCreateTime());//获取数据当前表的创建事件
bdgzsomthingMapper.insert(BdgzsomthingDO);
// }
}
}
//////////////////////////////////////////////////

View File

@ -1,6 +1,7 @@
package com.chanko.yunxi.mes.module.heli.service.processbom;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.generator.IFill;
@ -41,7 +42,9 @@ import com.chanko.yunxi.mes.module.heli.service.plantaskbom.PlanTaskBomService;
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
import com.chanko.yunxi.mes.module.system.controller.admin.dict.vo.data.DictDataPageReqVO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.dict.DictDataDO;
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
import com.chanko.yunxi.mes.module.system.dal.mysql.dict.DictDataMapper;
import com.chanko.yunxi.mes.module.system.service.user.AdminUserService;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -98,6 +101,8 @@ public class ProcessBomServiceImpl implements ProcessBomService {
private AttentiontodoMapper attentiontodoMapper;
@Resource
private DictDataMapper dictDataMapper;
@Resource
private AdminUserService adminUserService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createProcessBom(ProcessBomSaveReqVO createReqVO) {
@ -547,8 +552,8 @@ public class ProcessBomServiceImpl implements ProcessBomService {
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
BdgzsomthingDO.setThings("BOM" + updateObj.getProjectSubCode() + "审核已通过,请推送任务通知单");//事件名称
BdgzsomthingDO.setAttr2(getplanid.getId().toString());//跳转携带参数
BdgzsomthingDO.setAttr3(getplanid.getId().toString());//独特标识
BdgzsomthingDO.setAttr2(getplanid.getPlanNo());//跳转携带参数
BdgzsomthingDO.setAttr3(getplanid.getPlanNo());//独特标识
// BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
// BdgzsomthingDO.setShowname(new Date());比较创建时间,不用单独填写
if (attentiontodoRespVO.getAttr5().equals("1")) {//提醒状态
@ -556,7 +561,18 @@ public class ProcessBomServiceImpl implements ProcessBomService {
} else if (attentiontodoRespVO.getAttr5().equals("2")) {
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
ProcessBomDO processBomDO = processBomMapper.selectById(updateReqVO.getId());
if (ObjectUtil.isNotEmpty(processBomDO)){
AdminUserDO user = adminUserService.getUser(Long.valueOf(processBomDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}
if (attentiontodoRespVO.getLevel().equals("1")) {
BdgzsomthingDO.setLevel("紧急");
} else if (attentiontodoRespVO.getLevel().equals("2")) {
@ -745,7 +761,15 @@ public class ProcessBomServiceImpl implements ProcessBomService {
} else if (attentiontodoRespVO.getAttr5().equals("2")) {
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
AdminUserDO user = adminUserService.getUser(Long.valueOf(processBomDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}
if (attentiontodoRespVO.getLevel().equals("1")) {
BdgzsomthingDO.setLevel("紧急");
} else if (attentiontodoRespVO.getLevel().equals("2")) {
@ -810,7 +834,14 @@ public class ProcessBomServiceImpl implements ProcessBomService {
} else if (attentiontodoRespVO.getAttr5().equals("2")) {
BdgzsomthingDO.setDborgz("关注");
}
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
if (ObjectUtil.isEmpty(attentiontodoRespVO.getAttr4())){
AdminUserDO user = adminUserService.getUser(Long.valueOf(processBomDO.getCreator()));
if (ObjectUtil.isNotEmpty(user)){
BdgzsomthingDO.setClick(user.getNickname());
}
}else {
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());
}
if (attentiontodoRespVO.getLevel().equals("1")) {
BdgzsomthingDO.setLevel("紧急");
} else if (attentiontodoRespVO.getLevel().equals("2")) {

View File

@ -8,4 +8,24 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectafterten"
parameterType="map"
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO">
select w.*from project_purchase_order q,
(SELECT
b.project_material_plan_no,a.project_material_plan_id
FROM
project_material_plan_boom a
JOIN
project_material_plan b ON a.project_material_plan_id = b.id
WHERE
b.status = '3'
AND CURDATE() >= DATE_SUB(a.boom_arrive_date, INTERVAL #{evday} DAY)
and b.tenant_id =#{id}
) w
where q.project_material_plan_id =w.project_material_plan_id
and q.receiving_status !='3'
group by project_material_plan_no
</select>
</mapper>

View File

@ -10,7 +10,7 @@
-->
<select id="selectafterten"
parameterType="Long"
parameterType="map"
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO">
select w.*from project_purchase_order q,
(SELECT
@ -23,8 +23,8 @@
base_material bm ON a.material_id = bm.id
WHERE
b.status = '3'
AND CURDATE() >= DATE_SUB(a.require_arrive_time, INTERVAL 10 DAY)
and b.tenant_id =#{param1}
AND CURDATE() >= DATE_SUB(a.require_arrive_time, INTERVAL #{evday} DAY)
and b.tenant_id =#{id}
) w
where q.project_material_plan_id =w.project_material_plan_id
and q.receiving_status !='3'

View File

@ -42,6 +42,7 @@
AND blank_date &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_WORKBLANK'
@ -87,6 +88,7 @@
AND three_dim_date &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_3D'
@ -132,6 +134,7 @@
AND two_dim_date &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_2D'
@ -183,6 +186,7 @@
AND blank_date&lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_WORKBLANK'
@ -230,6 +234,7 @@
AND three_dim_date&lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_3D'
@ -277,6 +282,7 @@
AND two_dim_date &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY)
) x
JOIN project_plan y ON x.project_plan_id = y.id
where y.status in('1','2')
) c ON c.project_plan_id = d.plan_id AND c.project_sub_id = d.project_sub_id
WHERE
d.process_design_type = 'BLUEPRINT_2D'

View File

@ -22,7 +22,7 @@
select c.code,d.end_time project_end_time from pro_task_dispatch c,(SELECT b.*, COALESCE(SUM(a.amount), 0) AS total_amount
FROM pro_task_dispatch_detail b
LEFT JOIN pro_task_report a ON a.dispatch_detail_id = b.id
WHERE b.end_time &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY) and b.tenant_id =#{param1}
WHERE b.end_time &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY) and b.tenant_id =#{param1} and b.procedure_status!=2
GROUP BY b.id
HAVING COALESCE(SUM(a.amount), 0) &lt; b.amount) d
where d.dispatch_id =c.id and c.dispatch_type ='ASSEMBLE'
@ -57,7 +57,7 @@
select c.code,d.end_time project_end_time from pro_task_dispatch c,(SELECT b.*, COALESCE(SUM(a.amount), 0) AS total_amount
FROM pro_task_dispatch_detail b
LEFT JOIN pro_task_report a ON a.dispatch_detail_id = b.id
WHERE b.end_time &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY) and b.tenant_id =#{param1}
WHERE b.end_time &lt;= DATE_ADD(CURDATE(), INTERVAL 1 DAY) and b.tenant_id =#{param1} and b.procedure_status!=2
GROUP BY b.id
HAVING COALESCE(SUM(a.amount), 0) &lt; b.amount) d
where d.dispatch_id =c.id and c.dispatch_type ='PRODUCTION'

View File

@ -153,7 +153,7 @@
<el-dialog title="提示" v-model="showDialog" width="30%" center>
<span>该物料需求计划是否正常</span>
<template #footer>
<el-button @click="showDialog = false"></el-button>
<el-button @click="showDialog = false"></el-button>
<el-button type="primary" @click="suerMaterialNeed()"> </el-button>
</template>
</el-dialog>
@ -320,6 +320,7 @@ const buttonTypes = ref([
'生产任务到期',
'质检任务到期前',
'《物料需求计划》的采购',
'《物料需求计划》提交后',
'BOM变更通知'
]);
@ -661,13 +662,14 @@ const handlePay =async (row: any) => {
// router.push({ path: '/order/project', state: { idid: row.idid } });
}
if (row.type == '《物料需求计划》提交后') {
await bdgzsomthingApi.deleteByIdNew(row.id);
router.push({ path: '/purchase/MaterialPlanAudit', state: { idid: row.idid } });
// router.push({ path: '/purchase/MaterialPlanAudit', query: { idid: row.idid } });
}
if (row.type == 'BOM变更审核') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == 'BOM变更通知') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
@ -681,14 +683,23 @@ const handlePay =async (row: any) => {
if (row.type == '质检通知单') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
router.push({ path: '/quality/unqualifiedNotificationApprove', state: { idid: row.idid } });
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
// &lt;
if (row.type == '设计任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '装配任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '生产任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '订单发货满一年') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
router.push({ path: '/order/project', query: { idid: row.idid } });
}
if(row.type == '《物料需求计划》的采购'&&userDept.value.deptName == '采购部'){
if(row.type == '《物料需求计划》的采购'){
showDialog.value = true;
materialNeedRow.value = row;
@ -703,7 +714,8 @@ const handlePay =async (row: any) => {
||row.type == '装配任务到期'
||row.type == '生产任务到期'
||row.type == '质检任务到期前'
||(row.type == '《物料需求计划》的采购'&&userDept.value.deptName != '采购部')
||row.type == '《物料需求计划》提交后'
// ||(row.type == ''&&userDept.value.deptName != '')
) {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', query: { idid: row.idid } });
@ -733,6 +745,25 @@ const handlePaysee =async (row: any) => {
}else{
await bdgzsomthingApi.updatebdgzsomthingbyidone(row.id)
}
if (row.type == 'BOM变更通知') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
router.push({ path: '/processDesign/heli/processdesign/bom', state: { idid: row.idid } });
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '设计任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '质检通知单') {
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
router.push({ path: '/quality/unqualifiedNotificationApprove', state: { idid: row.idid } });
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '装配任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
if (row.type == '生产任务到期'){
await bdgzsomthingApi.updatebdgzsomthingbyidoneandok(row.id) //
}
}
//

View File

@ -307,7 +307,10 @@ const submitForm = async () => {
//
// }
if (formData.value.event=='《物料需求计划》的采购'&&(formData.value.evday==null || formData.value.evday=='' )){
message.error("《物料需求计划》的采购,必须配置提醒天数,请确认")
return
}
for (let i = 0; i < data.taskDispatchDetails.length; i++) {
if (data.taskDispatchDetails[i].type==2&&data.taskDispatchDetails[i].remindman==null){
message.error("操作类型为关注,必须配置提醒人,请确认")