Commit 22b50b90 authored by hezhuozhi's avatar hezhuozhi

工作台

parent 8b41f5fc
...@@ -12,6 +12,7 @@ public enum HygfRouthTypeEnum { ...@@ -12,6 +12,7 @@ public enum HygfRouthTypeEnum {
*/ */
HYGF_REPAY("hygf_repayment", "还款"), HYGF_REPAY("hygf_repayment", "还款"),
HYGF_DZKC("hygf_dzkc", "电站勘察"), HYGF_DZKC("hygf_dzkc", "电站勘察"),
HYGF_DSG("hygf_dsg", "待施工"),
; ;
private final String code; private final String code;
......
...@@ -11,6 +11,7 @@ public enum TaskTypeStationEnum { ...@@ -11,6 +11,7 @@ public enum TaskTypeStationEnum {
重置密码("重置密码", "重置密码"), 重置密码("重置密码", "重置密码"),
设置管理员("设置管理员", "设置管理员"), 设置管理员("设置管理员", "设置管理员"),
发货管理("发货管理", "发货管理"), 发货管理("发货管理", "发货管理"),
派工发料("派工发料", "派工发料"),
施工完工("施工完工", "施工完工"), 施工完工("施工完工", "施工完工"),
并网管理("并网管理", "并网管理"), 并网管理("并网管理", "并网管理"),
验收管理("验收管理", "验收管理"), 验收管理("验收管理", "验收管理"),
......
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.Date; import java.util.Date;
...@@ -77,9 +85,15 @@ public class ToDoTasks extends BaseEntity { ...@@ -77,9 +85,15 @@ public class ToDoTasks extends BaseEntity {
@TableField("route_path") @TableField("route_path")
private String routePath; private String routePath;
/**
*路由地址
*/
@TableField("wx_route_path")
private String wxRoutePath;
public ToDoTasks(String type, Long businessId, String taskName,String orgCode) { public ToDoTasks(String type, Long businessId, String taskName, String orgCode) {
addOperator();
this.type = type; this.type = type;
this.businessId = businessId; this.businessId = businessId;
this.state = "待办"; this.state = "待办";
...@@ -88,7 +102,8 @@ public class ToDoTasks extends BaseEntity { ...@@ -88,7 +102,8 @@ public class ToDoTasks extends BaseEntity {
this.taskName = taskName; this.taskName = taskName;
} }
public ToDoTasks(String type, Long businessId, String taskName,String orgCode,String routePath) { public ToDoTasks(String type, Long businessId, String taskName, String orgCode, String routePath,String wxRoutePath) {
addOperator();
this.type = type; this.type = type;
this.businessId = businessId; this.businessId = businessId;
this.state = "待办"; this.state = "待办";
...@@ -96,9 +111,11 @@ public class ToDoTasks extends BaseEntity { ...@@ -96,9 +111,11 @@ public class ToDoTasks extends BaseEntity {
this.creationTime = new Date(); this.creationTime = new Date();
this.taskName = taskName; this.taskName = taskName;
this.routePath = routePath; this.routePath = routePath;
this.wxRoutePath= wxRoutePath;
} }
public ToDoTasks(String type, Long businessId) { public ToDoTasks(String type, Long businessId) {
addOperator();
this.type = type; this.type = type;
this.businessId = businessId; this.businessId = businessId;
this.state = "待办"; this.state = "待办";
...@@ -107,4 +124,15 @@ public class ToDoTasks extends BaseEntity { ...@@ -107,4 +124,15 @@ public class ToDoTasks extends BaseEntity {
public ToDoTasks() { public ToDoTasks() {
} }
private void addOperator() {
try {
this.recDate = new Date();
this.recUserId = RequestContext.getExeUserId();
this.recUserName = RequestContext.getLoginId();
} catch (Exception e) {
e.printStackTrace();
}
}
} }
...@@ -28,4 +28,12 @@ public interface ToDoTasksMapper extends BaseMapper<ToDoTasks> { ...@@ -28,4 +28,12 @@ public interface ToDoTasksMapper extends BaseMapper<ToDoTasks> {
*/ */
List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId); List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
/**
* 根据区域公司、角色、经销商获取待办的人员
* @param companyOrgCode
* @param roleId
* @param amosDealerId
* @return
*/
List<String> getTodoUserIdsByAmosDealer(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId, @Param("amosDealerId") String amosDealerId);
} }
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
left join hygf_financing_info hfi on hfi.peasant_household_id = hph.sequence_nbr left join hygf_financing_info hfi on hfi.peasant_household_id = hph.sequence_nbr
<where> <where>
hph.construction_state = '验收完成' hph.construction_state = '验收完成'
<if test="map.routhPathId != null and map.routhPathId != ''"> <if test="params.routhPathId != null and params.routhPathId != ''">
and hph.sequence_nbr = #{map.routhPathId} and hph.sequence_nbr = #{params.routhPathId}
</if> </if>
<if test="params.ownersName != null and params.ownersName !=''"> <if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%') and hph.owners_name like concat('%',#{params.ownersName},'%')
......
...@@ -36,6 +36,20 @@ ...@@ -36,6 +36,20 @@
</if> </if>
</where> </where>
GROUP BY USER_ID; GROUP BY USER_ID
</select>
<select id="getTodoUserIdsByAmosDealer" resultType="java.lang.String">
SELECT amos_user_id FROM std_user_biz sub
LEFT JOIN hygf_personnel_business hpb ON hpb.foundation_id=sub.sequence_nbr
<where>
sub.role like #{roleId}
and sub.amos_id = #{amosDealerId}
<if test="companyOrgCode != null and companyOrgCode != ''">
and hpb.regional_companies_code like #{companyOrgCode}
</if>
</where>
GROUP BY amos_user_id
</select> </select>
</mapper> </mapper>
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.*; import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.*; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.*;
import com.yeejoin.amos.boot.module.hygf.biz.vo.RouthPathVO;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -35,9 +36,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -35,9 +36,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Collection; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
......
...@@ -171,8 +171,6 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A ...@@ -171,8 +171,6 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
basicGridAuditingDto.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId()); basicGridAuditingDto.setPeasantHouseholdId(basicGridRecord.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(RequestContext.getExeUserId()); basicGridAuditingDto.setPromoter(RequestContext.getExeUserId());
Sequence sequence = new Sequence(); Sequence sequence = new Sequence();
long auditingSequenceNbr = sequence.nextId();
basicGridAuditingDto.setSequenceNbr(auditingSequenceNbr);
acceptanceCheckAuditingService.createWithModel(basicGridAuditingDto); acceptanceCheckAuditingService.createWithModel(basicGridAuditingDto);
update.set(AcceptanceCheck::getInstanceId,basicGridAuditingDto.getInstanceId()); update.set(AcceptanceCheck::getInstanceId,basicGridAuditingDto.getInstanceId());
...@@ -193,7 +191,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A ...@@ -193,7 +191,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(basicGridRecord.getPeasantHouseholdId())); routhPathVO.setRouthPathId(String.valueOf(basicGridRecord.getPeasantHouseholdId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.验收管理.getCode(), auditingSequenceNbr, taskName, orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.验收管理.getCode(), basicGridRecord.getPeasantHouseholdId(), taskName, orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks);
} }
...@@ -272,7 +271,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A ...@@ -272,7 +271,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(basicGridAuditing.getPeasantHouseholdId())); routhPathVO.setRouthPathId(String.valueOf(basicGridAuditing.getPeasantHouseholdId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.验收管理.getCode(), basicGridAuditing.getSequenceNbr(), taskName,orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.验收管理.getCode(), basicGridAuditing.getPeasantHouseholdId(), taskName,orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,""); toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,"");
} }
......
...@@ -251,9 +251,6 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta ...@@ -251,9 +251,6 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto); BeanUtils.copyProperties(workflowResultDto, basicGridAuditingDto);
basicGridAuditingDto.setPeasantHouseholdId(grid.getPeasantHouseholdId()); basicGridAuditingDto.setPeasantHouseholdId(grid.getPeasantHouseholdId());
basicGridAuditingDto.setPromoter(RequestContext.getExeUserId()); basicGridAuditingDto.setPromoter(RequestContext.getExeUserId());
Sequence sequence = new Sequence();
long auditingSequenceNbr = sequence.nextId();
basicGridAuditingDto.setSequenceNbr(auditingSequenceNbr);
basicGridAuditingService.createWithModel(basicGridAuditingDto); basicGridAuditingService.createWithModel(basicGridAuditingDto);
update.set(BasicGridRecord::getInstanceId, basicGridAuditingDto.getInstanceId()); update.set(BasicGridRecord::getInstanceId, basicGridAuditingDto.getInstanceId());
...@@ -274,7 +271,8 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta ...@@ -274,7 +271,8 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(grid.getPeasantHouseholdId())); routhPathVO.setRouthPathId(String.valueOf(grid.getPeasantHouseholdId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.并网管理.getCode(), auditingSequenceNbr, taskName, orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.并网管理.getCode(), grid.getPeasantHouseholdId(), taskName, orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks);
} }
...@@ -535,7 +533,8 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta ...@@ -535,7 +533,8 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(basicGridAuditing.getPeasantHouseholdId())); routhPathVO.setRouthPathId(String.valueOf(basicGridAuditing.getPeasantHouseholdId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.并网管理.getCode(), basicGridAuditing.getSequenceNbr(), taskName,orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.并网管理.getCode(), basicGridAuditing.getPeasantHouseholdId(), taskName,orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,""); toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,"");
} }
......
...@@ -92,7 +92,8 @@ public class DealerReviewServiceImpl extends BaseService<DealerReviewDto, Dealer ...@@ -92,7 +92,8 @@ public class DealerReviewServiceImpl extends BaseService<DealerReviewDto, Dealer
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(dealerReview.getUnitInfoId())); routhPathVO.setRouthPathId(String.valueOf(dealerReview.getUnitInfoId()));
String routhPath = toDoTasksService.getRouthPath(dealerReview.getNextProcessNode(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(dealerReview.getNextProcessNode(), routhPathVO);
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.经销商审核.getCode(), dealerReview.getUnitInfoId(), "经销商"+ name +"待经销商审核", regionalCompaniesCode, routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(dealerReview.getNextProcessNode(), routhPathVO);
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.经销商审核.getCode(), dealerReview.getUnitInfoId(), "经销商"+ name +"待经销商审核", regionalCompaniesCode, routhPath,wxRouthPath);
String roleId = toDoTasksService.getRoleIdByName("户用光伏-管理员"); String roleId = toDoTasksService.getRoleIdByName("户用光伏-管理员");
List<String> todoUserIds = toDoTasksService.getTodoUserIds(null, roleId); List<String> todoUserIds = toDoTasksService.getTodoUserIds(null, roleId);
toDoTasksService.addToDoTasksByUserIds(todoUserIds, toDoTasks); toDoTasksService.addToDoTasksByUserIds(todoUserIds, toDoTasks);
......
...@@ -234,7 +234,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -234,7 +234,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.投融资管理.getCode(), peasantHousehold.getSequenceNbr(), taskName, orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.投融资管理.getCode(), peasantHousehold.getSequenceNbr(), taskName, orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks);
} }
...@@ -382,7 +383,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -382,7 +383,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(financingAuditing.getPeasantHouseholdId())); routhPathVO.setRouthPathId(String.valueOf(financingAuditing.getPeasantHouseholdId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.投融资管理.getCode(), peasantHousehold.getSequenceNbr(), taskName,orgCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.投融资管理.getCode(), peasantHousehold.getSequenceNbr(), taskName,orgCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,""); toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,"");
//节点为待整改时生成整改单 //节点为待整改时生成整改单
......
...@@ -205,7 +205,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -205,7 +205,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr(), "用户"+householdContract.getPartyA()+"电站信息勘察",householdContract.getDealerCode(),routhPath); String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr(), "用户"+householdContract.getPartyA()+"电站信息勘察",householdContract.getDealerCode(),routhPath,wxRouthPath);
toDoTasksServiceImpl.addToDoTasksByUserIds(todoUserIds,toDoTasks); toDoTasksServiceImpl.addToDoTasksByUserIds(todoUserIds,toDoTasks);
ToDoTasks toDoTasks1= new ToDoTasks (TaskTypeStationEnum.合同填报.getCode(), householdContract.getSequenceNbr(), "用户"+householdContract.getPartyA()+"的合同待发起",householdContract.getDealerCode()); ToDoTasks toDoTasks1= new ToDoTasks (TaskTypeStationEnum.合同填报.getCode(), householdContract.getSequenceNbr(), "用户"+householdContract.getPartyA()+"的合同待发起",householdContract.getDealerCode());
...@@ -965,7 +966,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -965,7 +966,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(peasantHousehold.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr(), "用户"+householdContract.getPartyA()+"电站信息勘察",householdContract.getDealerCode(),routhPath); String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(HygfRouthTypeEnum.HYGF_DZKC.getCode(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr(), "用户"+householdContract.getPartyA()+"电站信息勘察",householdContract.getDealerCode(),routhPath,wxRouthPath);
toDoTasksServiceImpl.addToDoTasksByUserIds(todoUserIds,toDoTasks); toDoTasksServiceImpl.addToDoTasksByUserIds(todoUserIds,toDoTasks);
ToDoTasks toDoTasks1= new ToDoTasks (TaskTypeStationEnum.合同填报.getCode(), householdContract.getSequenceNbr(), "用户"+householdContract.getPartyA()+"的合同待发起",householdContract.getDealerCode()); ToDoTasks toDoTasks1= new ToDoTasks (TaskTypeStationEnum.合同填报.getCode(), householdContract.getSequenceNbr(), "用户"+householdContract.getPartyA()+"的合同待发起",householdContract.getDealerCode());
......
...@@ -230,15 +230,15 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS ...@@ -230,15 +230,15 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(powerStation.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(powerStation.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(powerStation.getNextProcessNode(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(powerStation.getNextProcessNode(), routhPathVO);
String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(powerStation.getNextProcessNode(), routhPathVO);
if (PowerStationNodeEnum.经销商确认.getCode().equals(powerStationNodeEnum.getCode())) { if (PowerStationNodeEnum.经销商确认.getCode().equals(powerStationNodeEnum.getCode())) {
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.电站审核.getCode(), powerStation.getSequenceNbr(), "用户" + name + "电站勘察待" + powerStationNodeEnum.getName(), peasantHousehold.getDeveloperCode(),routhPath); ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.电站审核.getCode(), powerStation.getSequenceNbr(), "用户" + name + "电站勘察待" + powerStationNodeEnum.getName(), peasantHousehold.getDeveloperCode(),routhPath,wxRouthPath);
List<String> userIds = new ArrayList<>(); List<String> userIds = new ArrayList<>();
userIds.add(peasantHousehold.getDeveloperUserId()); userIds.add(peasantHousehold.getDeveloperUserId());
toDoTasksServiceImpl.addToDoTasksByUserIds(userIds, toDoTasks); toDoTasksServiceImpl.addToDoTasksByUserIds(userIds, toDoTasks);
}else { }else {
ToDoTasks toDoTasks= new ToDoTasks(TaskTypeStationEnum.电站审核.getCode(), powerStation.getSequenceNbr(), "用户" + name + "电站勘察待" + powerStationNodeEnum.getName(), peasantHousehold.getDeveloperCode(),routhPath); ToDoTasks toDoTasks= new ToDoTasks(TaskTypeStationEnum.电站审核.getCode(), powerStation.getSequenceNbr(), "用户" + name + "电站勘察待" + powerStationNodeEnum.getName(), peasantHousehold.getDeveloperCode(),routhPath,wxRouthPath);
String roleId = toDoTasksServiceImpl.getRoleIdByName(powerStation.getNodeRole()); List<String> todoUserIds = Arrays.asList(Optional.ofNullable(powerStation.getNextExecuteUserIds()).orElse("").split(","));
List<String> todoUserIds = toDoTasksServiceImpl.getTodoUserIds(null, roleId);
toDoTasksServiceImpl.completeAndAddToDoTask(todoUserIds, toDoTasks,meg); toDoTasksServiceImpl.completeAndAddToDoTask(todoUserIds, toDoTasks,meg);
} }
} else { } else {
......
...@@ -673,9 +673,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -673,9 +673,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(model.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(model.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), model.getSequenceNbr(), "下单人"+model.getOrderUser()+"发货待确认",model.getRegionalCompaniesCode(),routhPath); String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), model.getSequenceNbr(), "下单人"+model.getOrderUser()+"发货待确认",model.getRegionalCompaniesCode(),routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksServiceImpl.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksServiceImpl.completeAndAddToDoTask(userIds,toDoTasks,"");
//提交时 赋值发货时间及订单状态 //提交时 赋值发货时间及订单状态
model.setDeliveryTime(new Date()); model.setDeliveryTime(new Date());
model.setDeliveryState(DeliveryStateeEnum.已发货.getName()); model.setDeliveryState(DeliveryStateeEnum.已发货.getName());
...@@ -773,7 +774,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -773,7 +774,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(model.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(model.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), model.getSequenceNbr(), "下单人"+model.getOrderUser()+"发货待确认",model.getRegionalCompaniesCode(),routhPath); String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), model.getSequenceNbr(), "下单人"+model.getOrderUser()+"发货待确认",model.getRegionalCompaniesCode(),routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksServiceImpl.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksServiceImpl.addToDoTasksByUserIds(userIds,toDoTasks);
}else { }else {
...@@ -1052,7 +1054,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1052,7 +1054,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(preparationMoney.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(preparationMoney.getSequenceNbr()));
String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksServiceImpl.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), preparationMoney.getSequenceNbr(), "下单人"+preparationMoney.getOrderUser()+"发货"+preparationMoney.getOrderStatus(),preparationMoney.getRegionalCompaniesCode(),routhPath); String wxRouthPath = toDoTasksServiceImpl.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.发货管理.getCode(), preparationMoney.getSequenceNbr(), "下单人"+preparationMoney.getOrderUser()+"发货"+preparationMoney.getOrderStatus(),preparationMoney.getRegionalCompaniesCode(),routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksServiceImpl.completeAndAddToDoTask(userIds,toDoTasks,""); toDoTasksServiceImpl.completeAndAddToDoTask(userIds,toDoTasks,"");
} }
......
...@@ -170,9 +170,10 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R ...@@ -170,9 +170,10 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(repayment.getSequenceNbr())); routhPathVO.setRouthPathId(String.valueOf(repayment.getSequenceNbr()));
String routhPath = toDoTasksService.getRouthPath(HygfRouthTypeEnum.HYGF_REPAY.getCode(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(HygfRouthTypeEnum.HYGF_REPAY.getCode(), routhPathVO);
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.还款.getCode(), repayment.getSequenceNbr(), createTaskName(repayment), repayment.getRegionalCompaniesCode(), routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(HygfRouthTypeEnum.HYGF_REPAY.getCode(), routhPathVO);
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.还款.getCode(), repayment.getSequenceNbr(), createTaskName(repayment), repayment.getRegionalCompaniesCode(), routhPath,wxRouthPath);
String roleId = toDoTasksService.getRoleIdByName("户用光伏-投融"); String roleId = toDoTasksService.getRoleIdByName("户用光伏-投融");
List<String> todoUserIds = toDoTasksService.getTodoUserIds("%" + repayment.getRegionalCompaniesCode() + "%", roleId); List<String> todoUserIds = toDoTasksService.getTodoUserIds(repayment.getRegionalCompaniesCode(), roleId);
toDoTasksService.addToDoTasksByUserIds(todoUserIds, toDoTasks); toDoTasksService.addToDoTasksByUserIds(todoUserIds, toDoTasks);
if (CollectionUtil.isNotEmpty(todoUserIds)){ if (CollectionUtil.isNotEmpty(todoUserIds)){
List<String> todoTelephones = repaymentMapper.getTodoTelephones(todoUserIds); List<String> todoTelephones = repaymentMapper.getTodoTelephones(todoUserIds);
......
...@@ -304,9 +304,9 @@ public class SurveyInformationServiceImpl ...@@ -304,9 +304,9 @@ public class SurveyInformationServiceImpl
// peasantHousehold.setSurveyOrNot(1); // peasantHousehold.setSurveyOrNot(1);
} else if (OPERATION_TYPE_APPLY.equals(operationType)) { } else if (OPERATION_TYPE_APPLY.equals(operationType)) {
// 提交审核 // 提交审核
submitExamine(peasantHousehold);
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr()); ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.电站勘察.getCode(), peasantHousehold.getSequenceNbr());
toDoTasksService.completeToDoTasks(toDoTasks,""); toDoTasksService.completeToDoTasks(toDoTasks,"");
submitExamine(peasantHousehold);
} }
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold); peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
...@@ -444,10 +444,6 @@ public class SurveyInformationServiceImpl ...@@ -444,10 +444,6 @@ public class SurveyInformationServiceImpl
long idsk = peasantHousehold.getSequenceNbr(); long idsk = peasantHousehold.getSequenceNbr();
up.eq(PeasantHousehold::getSequenceNbr, idsk); up.eq(PeasantHousehold::getSequenceNbr, idsk);
peasantHouseholdMapper.update(null, up); peasantHouseholdMapper.update(null, up);
//添加待办
// WorkflowResultDto workflowResultDto = workFlowService.buildWorkFlowInfo(processTaskDTOS).get(0);
// workflowResultDto.setInstanceId(powerStation.getProcessInstanceId());
// commonService.buildTaskModel(commonService.buildTaskModelDto(powerStation, workflowResultDto, BusinessTypeEnum.HYGF_DZ_SH));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("submitExamine error:", e); log.error("submitExamine error:", e);
......
...@@ -4,10 +4,8 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -4,10 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.dto.TasksRole; import com.yeejoin.amos.boot.module.hygf.api.dto.TasksRole;
...@@ -32,13 +30,11 @@ import org.springframework.stereotype.Service; ...@@ -32,13 +30,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -51,23 +47,23 @@ import java.util.stream.Collectors; ...@@ -51,23 +47,23 @@ import java.util.stream.Collectors;
* @date 2023-09-08 * @date 2023-09-08
*/ */
@Service @Service
public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToDoTasksMapper> implements IToDoTasksService { public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto, ToDoTasks, ToDoTasksMapper> implements IToDoTasksService {
final static Logger log = LoggerFactory.getLogger(ToDoTasksServiceImpl.class);
@Autowired
protected EmqKeeper emqKeeper;
@Autowired @Autowired
ToDoTasksMapper toDoTasksMapper; ToDoTasksMapper toDoTasksMapper;
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired @Autowired
UserMessageMapper userMessageMapper; UserMessageMapper userMessageMapper;
@Autowired
protected EmqKeeper emqKeeper;
@Autowired @Autowired
Sequence sequence; Sequence sequence;
@Value("classpath:/json/hygfRouth.json") @Value("classpath:/json/hygfRouth.json")
private Resource urlInfo; private Resource urlInfo;
final static Logger log = LoggerFactory.getLogger(ToDoTasksServiceImpl.class); @Value("classpath:/json/wxHygfRouth.json")
private Resource wxUrlInfo;
/** /**
* 分页查询 * 分页查询
...@@ -80,7 +76,7 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -80,7 +76,7 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
* 列表查询 示例 * 列表查询 示例
*/ */
public List<ToDoTasksDto> queryForToDoTasksList() { public List<ToDoTasksDto> queryForToDoTasksList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
...@@ -88,9 +84,9 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -88,9 +84,9 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
//列表数据组装 //列表数据组装
QueryWrapper<ToDoTasks> qw = new QueryWrapper<>(); QueryWrapper<ToDoTasks> qw = new QueryWrapper<>();
qw.eq(StringUtils.isNotEmpty(dto.getType()), "type",dto.getType() ); qw.eq(StringUtils.isNotEmpty(dto.getType()), "type", dto.getType());
qw.eq(StringUtils.isNotEmpty(dto.getState()), "state",dto.getState() ); qw.eq(StringUtils.isNotEmpty(dto.getState()), "state", dto.getState());
qw.eq(StringUtils.isNotEmpty(dto.getAmosUserId()), "amos_user_id",dto.getAmosUserId() ); qw.eq(StringUtils.isNotEmpty(dto.getAmosUserId()), "amos_user_id", dto.getAmosUserId());
qw.orderBy(Boolean.TRUE, Boolean.FALSE, "creation_time"); qw.orderBy(Boolean.TRUE, Boolean.FALSE, "creation_time");
IPage<ToDoTasks> toDoTasksPage = toDoTasksMapper.selectPage(dto, qw); IPage<ToDoTasks> toDoTasksPage = toDoTasksMapper.selectPage(dto, qw);
...@@ -99,41 +95,39 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -99,41 +95,39 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
@Transactional @Transactional
@Async @Async
public void completeAndAddToDoTask(List<String> userIds,ToDoTasks toDoTasks,String meg) { public void completeAndAddToDoTask(List<String> userIds, ToDoTasks toDoTasks, String meg) {
try { try {
completeToDoTasks(toDoTasks,meg); completeToDoTasks(toDoTasks, meg);
addToDoTasksByUserIds(userIds,toDoTasks); addToDoTasksByUserIds(userIds, toDoTasks);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("任务更新失败!");
} }
} }
@Transactional @Transactional
@Async @Async
public void completeToDoTasks(ToDoTasks toDoTasks,String meg) { public void completeToDoTasks(ToDoTasks toDoTasks, String meg) {
try { try {
LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ToDoTasks::getType, toDoTasks.getType()); wrapper.eq(ToDoTasks::getType, toDoTasks.getType());
wrapper.eq(ToDoTasks::getState, "待办"); wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId()); wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId());
List<ToDoTasks> doTasks= toDoTasksMapper.selectList(wrapper); List<ToDoTasks> doTasks = toDoTasksMapper.selectList(wrapper);
if(CollectionUtils.isNotEmpty(doTasks)){ if (CollectionUtils.isNotEmpty(doTasks)) {
for (ToDoTasks doTask : doTasks) { for (ToDoTasks doTask : doTasks) {
doTask.setState("已办"); doTask.setState("已办");
doTask.setCompleteTime(new Date()); doTask.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTask); toDoTasksMapper.updateById(doTask);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTask).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(doTask).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( doTask.getType(), doTask.getBusinessId(), doTask.getAmosUserId(), new Date(), doTask.getTaskName()+",此消息已确认."+meg, doTask.getAmosOrgCode()); UserMessage userMessage = new UserMessage(doTask.getType(), doTask.getBusinessId(), doTask.getAmosUserId(), new Date(), doTask.getTaskName() + ",此消息已确认." + meg, doTask.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
}else { } else {
log.error("没有查询到待办,不进行更新和发送消息"); log.error("没有查询到待办,不进行更新和发送消息");
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); log.error(e.getMessage(), e);
throw new BadRequest("任务更新失败!");
} }
} }
...@@ -146,25 +140,24 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -146,25 +140,24 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
@Async @Async
public void deleteByBusinessIds(List<String> businessIds) { public void deleteByBusinessIds(List<String> businessIds) {
try { try {
if(CollectionUtil.isNotEmpty(businessIds)){ if (CollectionUtil.isNotEmpty(businessIds)) {
if(businessIds.size() < 1000){ if (businessIds.size() < 1000) {
LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ToDoTasks::getBusinessId,businessIds); wrapper.in(ToDoTasks::getBusinessId, businessIds);
remove(wrapper); remove(wrapper);
}else { } else {
List<List<String>> lists = ListUtils.splitList(businessIds, 1000); List<List<String>> lists = ListUtils.splitList(businessIds, 1000);
for (List<String> list : lists) { for (List<String> list : lists) {
LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ToDoTasks> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ToDoTasks::getBusinessId,list); wrapper.in(ToDoTasks::getBusinessId, list);
remove(wrapper); remove(wrapper);
} }
} }
}else { } else {
log.error("业务Id为空,不进行删除"); log.error("业务Id为空,不进行删除");
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); log.error(e.getMessage(), e);
throw new BadRequest("业务删除失败!");
} }
} }
...@@ -172,28 +165,27 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -172,28 +165,27 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
@Async @Async
public void addToDoTasksByUserIds(List<String> userIds, ToDoTasks toDoTasks) { public void addToDoTasksByUserIds(List<String> userIds, ToDoTasks toDoTasks) {
try { try {
if(CollectionUtil.isNotEmpty(userIds)){ if (CollectionUtil.isNotEmpty(userIds)) {
for (String todoUserId : userIds) { for (String todoUserId : userIds) {
toDoTasks.setAmosUserId(todoUserId); toDoTasks.setAmosUserId(todoUserId);
toDoTasks.setSequenceNbr(sequence.nextId()); toDoTasks.setSequenceNbr(sequence.nextId());
toDoTasksMapper.insert(toDoTasks); toDoTasksMapper.insert(toDoTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(toDoTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(toDoTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName(), toDoTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName(), toDoTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
}else { } else {
log.error("用户为空,不进行添加待办和发送消息"); log.error("用户为空,不进行添加待办和发送消息");
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("任务添加失败!");
} }
} }
@Override @Override
@Transactional @Transactional
public void addToDoTasksByUserId(String userId, ToDoTasks toDoTasks,String meg) { public void addToDoTasksByUserId(String userId, ToDoTasks toDoTasks, String meg) {
try { try {
...@@ -201,32 +193,31 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -201,32 +193,31 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
wrapper.eq(ToDoTasks::getType, toDoTasks.getType()); wrapper.eq(ToDoTasks::getType, toDoTasks.getType());
wrapper.eq(ToDoTasks::getState, "待办"); wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId()); wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId());
ToDoTasks doTasks= toDoTasksMapper.selectOne(wrapper); ToDoTasks doTasks = toDoTasksMapper.selectOne(wrapper);
if(doTasks!=null){ if (doTasks != null) {
doTasks.setState("已办"); doTasks.setState("已办");
doTasks.setCompleteTime(new Date()); doTasks.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTasks); toDoTasksMapper.updateById(doTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(doTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName()+",此消息已确认."+meg, doTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName() + ",此消息已确认." + meg, doTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
toDoTasks.setAmosUserId(userId); toDoTasks.setAmosUserId(userId);
toDoTasksMapper.insert(toDoTasks); toDoTasksMapper.insert(toDoTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(toDoTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(toDoTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName(), toDoTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName(), toDoTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); log.error(e.getMessage(), e);
throw new BadRequest("任务添加失败!");
} }
} }
@Override @Override
@Async @Async
public void addToDoTasksByRole(String role, ToDoTasks toDoTasks,String meg) { public void addToDoTasksByRole(String role, ToDoTasks toDoTasks, String meg) {
//查询该角色的所有人员,按时间倒序排序。缓存,每次按顺序取一个,内存中删除一个,知道分配完,继续查询获取,重新分配。 //查询该角色的所有人员,按时间倒序排序。缓存,每次按顺序取一个,内存中删除一个,知道分配完,继续查询获取,重新分配。
try { try {
...@@ -235,16 +226,16 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -235,16 +226,16 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
wrapper.eq(ToDoTasks::getType, toDoTasks.getType()); wrapper.eq(ToDoTasks::getType, toDoTasks.getType());
wrapper.eq(ToDoTasks::getState, "待办"); wrapper.eq(ToDoTasks::getState, "待办");
wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId()); wrapper.eq(ToDoTasks::getBusinessId, toDoTasks.getBusinessId());
ToDoTasks doTasks= toDoTasksMapper.selectOne(wrapper); ToDoTasks doTasks = toDoTasksMapper.selectOne(wrapper);
if(doTasks!=null){ if (doTasks != null) {
doTasks.setState("已办"); doTasks.setState("已办");
doTasks.setCompleteTime(new Date()); doTasks.setCompleteTime(new Date());
toDoTasksMapper.updateById(doTasks); toDoTasksMapper.updateById(doTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(doTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(doTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName()+"已完成."+meg, doTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(doTasks.getType(), doTasks.getBusinessId(), doTasks.getAmosUserId(), new Date(), doTasks.getTaskName() + "已完成." + meg, doTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
...@@ -252,52 +243,52 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -252,52 +243,52 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
synchronized (this) { synchronized (this) {
if (redisUtils.hasKey("TAKS_" + role)) { if (redisUtils.hasKey("TAKS_" + role)) {
String id = redisUtils.get("TAKS_" + role).toString(); String id = redisUtils.get("TAKS_" + role).toString();
System.out.println(role+"角色人员"+id); System.out.println(role + "角色人员" + id);
List<TasksRole> listd = toDoTasksMapper.getTasksRole(role,toDoTasks.getAmosOrgCode()); List<TasksRole> listd = toDoTasksMapper.getTasksRole(role, toDoTasks.getAmosOrgCode());
if (listd != null && !listd.isEmpty()) { if (listd != null && !listd.isEmpty()) {
List<String> idList=listd.stream().map(TasksRole::getAmosUserId).collect(Collectors.toList()); List<String> idList = listd.stream().map(TasksRole::getAmosUserId).collect(Collectors.toList());
if(idList.indexOf(id)>-1){ if (idList.indexOf(id) > -1) {
if(idList.indexOf(id)+1>idList.size()-1){ if (idList.indexOf(id) + 1 > idList.size() - 1) {
toDoTasks.setAmosUserId(idList.get(0)); toDoTasks.setAmosUserId(idList.get(0));
redisUtils.set("TAKS_" + role, idList.get(0)); redisUtils.set("TAKS_" + role, idList.get(0));
}else{ } else {
toDoTasks.setAmosUserId(idList.get(idList.indexOf(id)+1)); toDoTasks.setAmosUserId(idList.get(idList.indexOf(id) + 1));
redisUtils.set("TAKS_" + role, idList.get(idList.indexOf(id)+1)); redisUtils.set("TAKS_" + role, idList.get(idList.indexOf(id) + 1));
} }
}else{ } else {
toDoTasks.setAmosUserId(idList.get(0)); toDoTasks.setAmosUserId(idList.get(0));
redisUtils.set("TAKS_" + role, idList.get(0)); redisUtils.set("TAKS_" + role, idList.get(0));
} }
}else { } else {
System.out.println(role+"没有此角色人员"); System.out.println(role + "没有此角色人员");
log.info("没有此角色人员!"); log.info("没有此角色人员!");
} }
} else { } else {
List<TasksRole> listd = toDoTasksMapper.getTasksRole(role,toDoTasks.getAmosOrgCode()); List<TasksRole> listd = toDoTasksMapper.getTasksRole(role, toDoTasks.getAmosOrgCode());
if (listd != null && !listd.isEmpty()) { if (listd != null && !listd.isEmpty()) {
List<String> idList=listd.stream().map(TasksRole::getAmosUserId).collect(Collectors.toList()); List<String> idList = listd.stream().map(TasksRole::getAmosUserId).collect(Collectors.toList());
toDoTasks.setAmosUserId(idList.get(0)); toDoTasks.setAmosUserId(idList.get(0));
redisUtils.set("TAKS_" + role, idList.get(0)); redisUtils.set("TAKS_" + role, idList.get(0));
} else { } else {
System.out.println(role+"没有此角色人员"); System.out.println(role + "没有此角色人员");
log.info("没有此角色人员!"); log.info("没有此角色人员!");
} }
} }
toDoTasksMapper.insert(toDoTasks); toDoTasksMapper.insert(toDoTasks);
emqKeeper.getMqttClient().publish("TASK_MESSAGE" ,JSON.toJSONString(toDoTasks).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("TASK_MESSAGE", JSON.toJSONString(toDoTasks).getBytes(), 2, false);
UserMessage userMessage= new UserMessage( toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName()+"待完成", toDoTasks.getAmosOrgCode()); UserMessage userMessage = new UserMessage(toDoTasks.getType(), toDoTasks.getBusinessId(), toDoTasks.getAmosUserId(), new Date(), toDoTasks.getTaskName() + "待完成", toDoTasks.getAmosOrgCode());
userMessageMapper.insert(userMessage); userMessageMapper.insert(userMessage);
emqKeeper.getMqttClient().publish("MY_MESSAGE" ,JSON.toJSONString(userMessage).getBytes(), 2 ,false); emqKeeper.getMqttClient().publish("MY_MESSAGE", JSON.toJSONString(userMessage).getBytes(), 2, false);
} }
}catch(Exception e){ } catch (Exception e) {
log.info("生成待办任务失败!"); log.info("生成待办任务失败!");
e.printStackTrace(); e.printStackTrace();
...@@ -309,25 +300,63 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD ...@@ -309,25 +300,63 @@ public class ToDoTasksServiceImpl extends BaseService<ToDoTasksDto,ToDoTasks,ToD
} }
public List<String> getTodoUserIds(String companyOrgCode, String roleId) { public List<String> getTodoUserIds(String companyOrgCode, String roleId) {
return toDoTasksMapper.getTodoUserIds(companyOrgCode,roleId); if (StringUtils.isNotEmpty(companyOrgCode)) {
companyOrgCode = "%" + companyOrgCode + "%";
}
return toDoTasksMapper.getTodoUserIds(companyOrgCode, roleId);
}
/**
* 根据区域公司、角色、经销商获取待办的人员
* @param companyOrgCode
* @param roleId
* @param amosDealerId
* @return
*/
public List<String> getTodoUserIds(String companyOrgCode,String roleId,String amosDealerId){
if (StringUtils.isNotEmpty(companyOrgCode)) {
companyOrgCode = "%" + companyOrgCode + "%";
}
if (StringUtils.isNotEmpty(roleId)) {
roleId = "%" + roleId + "%";
}
return toDoTasksMapper.getTodoUserIdsByAmosDealer(companyOrgCode, roleId,amosDealerId);
} }
//获取路由地址 //获取路由地址
public String getRouthPath(String type,Object model) { public String getRouthPath(String type, Object model) {
List<Map> urlList = JsonUtils.getResourceList(urlInfo); List<Map> urlList = JsonUtils.getResourceList(urlInfo);
String routhPath=""; return getRouthPath(type, urlList, model);
String urlParams = "";
try {
urlParams = "&" + toQueryParams(model);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} }
//获取微信路由地址
public String getWxRouthPath(String type, Object model) {
List<Map> urlList = JsonUtils.getResourceList(wxUrlInfo);
return getRouthPath(type, urlList, model);
}
private String getRouthPath(String type, List<Map> urlList, Object model) {
String routhPath = "";
try {
for (Map map : urlList) { for (Map map : urlList) {
if (map.get("type").equals(type)) { if (map.get("type").equals(type)) {
routhPath = (map.get("url").toString() + urlParams); routhPath = map.get("url").toString();
if (StringUtils.isNotEmpty(routhPath)) {
// 检查 URL 是否已有参数
if (routhPath.contains("?")) {
// 如果 URL 已经包含参数,使用 '&' 来拼接新的参数
routhPath = routhPath + "&" + toQueryParams(model);
} else {
// 如果 URL 没有参数,使用 '?' 来开始拼接
routhPath = routhPath + "?" + toQueryParams(model);
}
}
break; break;
} }
} }
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return routhPath; return routhPath;
} }
......
...@@ -215,6 +215,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -215,6 +215,15 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
} }
constructionRecordsServiceImpl.saveBatch(constructionRecordlist); constructionRecordsServiceImpl.saveBatch(constructionRecordlist);
//新增待办
RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(model.getSequenceNbr()));
String routhPath = toDoTasksService.getRouthPath(HygfRouthTypeEnum.HYGF_DSG.getCode(), routhPathVO);
String wxRouthPath = toDoTasksService.getWxRouthPath(HygfRouthTypeEnum.HYGF_DSG.getCode(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.派工发料.getCode(), model.getSequenceNbr(), "有一个派单编号"+model.getWorkOrderNum()+"待施工",model.getRegionCode(),routhPath,wxRouthPath);
String roleId = toDoTasksService.getRoleIdByName("户用光伏-经销商-施工");
List<String> todoUserIds = toDoTasksService.getTodoUserIds(model.getRegionCode(), roleId, String.valueOf(model.getAmosDealerId()));
toDoTasksService.addToDoTasksByUserIds(todoUserIds,toDoTasks);
return model; return model;
} }
...@@ -385,13 +394,14 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -385,13 +394,14 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
String taskName="派工发料提交完成,需处理"; String taskName="派工发料提交完成,需处理";
String regionalCompaniesCode=""; String regionalCompaniesCode="";
if(Objects.nonNull(workOrder)){ if(Objects.nonNull(workOrder)){
taskName="制单人"+workOrder.getPreparer() +"派工单"+ workOrder.getWorkOrderStatus(); taskName="工程负责人"+workOrder.getPreparer() +"派工单"+ WorkOrderEnum.待登记.getCode();
regionalCompaniesCode=workOrder.getRegionCode(); regionalCompaniesCode=workOrder.getRegionCode();
} }
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(powerStationConstructionData.getWorkOrderId())); routhPathVO.setRouthPathId(String.valueOf(powerStationConstructionData.getWorkOrderPowerStationId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.施工完工.getCode(), powerStationConstructionData.getWorkOrderPowerStationId(), taskName, regionalCompaniesCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.施工完工.getCode(), powerStationConstructionData.getWorkOrderPowerStationId(), taskName, regionalCompaniesCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks); toDoTasksService.addToDoTasksByUserIds(userIds,toDoTasks);
}else { }else {
...@@ -544,13 +554,14 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -544,13 +554,14 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
String taskName=""; String taskName="";
String regionalCompaniesCode=""; String regionalCompaniesCode="";
if(Objects.nonNull(workOrder)){ if(Objects.nonNull(workOrder)){
taskName="制单人"+workOrder.getPreparer() +"派工单"+ workflowResultDto.getNextNodeName(); taskName="工程负责人"+workOrder.getPreparer() +"派工单"+ workflowResultDto.getNextNodeName();
regionalCompaniesCode=workOrder.getRegionCode(); regionalCompaniesCode=workOrder.getRegionCode();
} }
RouthPathVO routhPathVO = new RouthPathVO(); RouthPathVO routhPathVO = new RouthPathVO();
routhPathVO.setRouthPathId(String.valueOf(hygfWorkOrderStationAuditing.getWorkOrderPowerStationId())); routhPathVO.setRouthPathId(String.valueOf(hygfWorkOrderStationAuditing.getWorkOrderPowerStationId()));
String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO); String routhPath = toDoTasksService.getRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.施工完工.getCode(), hygfWorkOrderStationAuditing.getWorkOrderPowerStationId(), taskName,regionalCompaniesCode,routhPath); String wxRouthPath = toDoTasksService.getWxRouthPath(workflowResultDto.getNextNodeKey(), routhPathVO);
ToDoTasks toDoTasks= new ToDoTasks (TaskTypeStationEnum.施工完工.getCode(), hygfWorkOrderStationAuditing.getWorkOrderPowerStationId(), taskName,regionalCompaniesCode,routhPath,wxRouthPath);
List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(",")); List<String> userIds = Arrays.asList(Optional.ofNullable(workflowResultDto.getNextExecuteUserIds()).orElse("").split(","));
toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,""); toDoTasksService.completeAndAddToDoTask(userIds,toDoTasks,"");
} }
...@@ -1430,6 +1441,9 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -1430,6 +1441,9 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
upq.set(WorkOrder::getWorkOrderStatus, WorkOrderEnum.已完工.getCode()); upq.set(WorkOrder::getWorkOrderStatus, WorkOrderEnum.已完工.getCode());
workOrderMapper.update(null, upq); workOrderMapper.update(null, upq);
//完成待办
ToDoTasks toDoTasks = new ToDoTasks(TaskTypeStationEnum.派工发料.getCode(), workOrderPowerStation.getWorkOrderId());
toDoTasksService.completeToDoTasks(toDoTasks,"");
} }
......
...@@ -78,10 +78,16 @@ ...@@ -78,10 +78,16 @@
"url": "/mixuap?appId=1677158789557547009&id=1808437079118450689" "url": "/mixuap?appId=1677158789557547009&id=1808437079118450689"
}, },
{ {
"type": "hygf_dsg",
"pageType": "",
"name": "待施工",
"url": ""
},
{
"type": "Activity_0bs6t4g", "type": "Activity_0bs6t4g",
"pageType": "", "pageType": "",
"name": "施工完成提交", "name": "施工完成提交",
"url": "/mixuap?appId=1677158789557547009&id=1742435224567967746" "url": ""
}, },
{ {
"type": "Activity_1spujef", "type": "Activity_1spujef",
...@@ -114,7 +120,7 @@ ...@@ -114,7 +120,7 @@
"url": "/mixuap?appId=1678340647909617665&id=1823622039500492802" "url": "/mixuap?appId=1678340647909617665&id=1823622039500492802"
}, },
{ {
"type": "hygf_bw1", "type": "Activity_0bs6t4g",
"pageType": "", "pageType": "",
"name": "并网登记提交", "name": "并网登记提交",
"url": "/mixuap?appId=1677158789557547009&id=1747137335817957378" "url": "/mixuap?appId=1677158789557547009&id=1747137335817957378"
...@@ -189,7 +195,7 @@ ...@@ -189,7 +195,7 @@
"type": "AuditPass", "type": "AuditPass",
"pageType": "", "pageType": "",
"name": "放款确认", "name": "放款确认",
"url": "/mixuap?appId=1678340647909617665&id=1831228592361574401" "url": "/mixuap?appId=1678340647909617665&id=1831226627237875713"
}, },
{ {
"type": "hygf_repayment", "type": "hygf_repayment",
......
[
{
"type": "jxs_03",
"pageType": "",
"name": "经销商管理员审核",
"url": ""
},
{
"type": "hygf_dzkc",
"pageType": "",
"name": "电站勘察",
"url": "/view/mine/minepage/PeasantManage"
},
{
"type": "hygf_02",
"pageType": "",
"name": "经销商确认",
"url": "/view/mine/minepage/SurveyList"
},
{
"type": "hygf_03",
"pageType": "",
"name": "设计审核",
"url": "/view/mine/minepage/SurveyListgld"
},
{
"type": "hygf_05",
"pageType": "",
"name": "投融审核",
"url": "/view/mine/minepage/SurveyListgld"
},
{
"type": "hygf_07",
"pageType": "",
"name": "法务审核",
"url": "/view/mine/minepage/SurveyListgld"
},
{
"type": "hygf_09",
"pageType": "",
"name": "设计上传典型图库",
"url": "/view/mine/minepage/SurveyListgld"
},
{
"type": "hygf_10",
"pageType": "",
"name": "经销商设计人员上传设计图",
"url": "/view/mine/minepage/SurveyList"
},
{
"type": "hygf_11",
"pageType": "",
"name": "设计图纸审核",
"url": "/view/mine/minepage/SurveyListgld"
},
{
"type": "fh_dtj",
"pageType": "",
"name": "待发货",
"url": ""
},
{
"type": "fh_dyr",
"pageType": "",
"name": "待确认",
"url": "/view/mine/subPackageA/menus/shippingOrder/shippingOrderList/index"
},
{
"type": "fh_dsh",
"pageType": "",
"name": "待审核",
"url": "/view/mine/subPackageA/menus/shippingOrder/shippingOrderList/index"
},
{
"type": "fh_sqbh",
"pageType": "",
"name": "申请补货",
"url": "/view/mine/subPackageA/menus/shippingOrder/shippingOrderList/index"
},
{
"type": "hygf_dsg",
"pageType": "",
"name": "待施工",
"url": ""
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "施工完成提交",
"url": "/view/mine/sggl/SgglList"
},
{
"type": "Activity_1spujef",
"pageType": "",
"name": "完工登记提交",
"url": "/view/mine/wgdj/WgdjList"
},
{
"type": "Activity_16r1828",
"pageType": "",
"name": "完工自审",
"url": "/view/mine/wgzs/WgzsList"
},
{
"type": "Activity_1bldcno",
"pageType": "",
"name": "完工自审-片区运营中心",
"url": "/view/mine/subPackageA/menus/constructionAcceptance/index"
},
{
"type": "Activity_1yftt2k",
"pageType": "",
"name": "工程审核",
"url": "/view/mine/subPackageA/menus/constructionAcceptance/index"
},
{
"type": "Activity_095if3p",
"pageType": "",
"name": "设计审核",
"url": "/view/mine/subPackageA/menus/constructionAcceptance/index"
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "并网登记提交",
"url": "/view/mine/bwgl/BwglList"
},
{
"type": "Activity_0r2x1es",
"pageType": "",
"name": "经销商管理审核",
"url": "/view/mine/bwgl/BwglList"
},
{
"type": "Activity_05nlkey",
"pageType": "",
"name": "片区审核",
"url": "/view/mine/subPackageA/menus/onGridAcceptance/index"
},
{
"type": "Activity_0k4o46e",
"pageType": "",
"name": "设计审核/工程审核",
"url": "/view/mine/subPackageA/menus/onGridAcceptance/index"
},
{
"type": "Activity_0bs6t4g",
"pageType": "",
"name": "验收提交",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/ysgl"
},
{
"type": "Activity_0ojajec",
"pageType": "",
"name": "经销商管理员审核",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/ysgl"
},
{
"type": "Activity_0edftmv",
"pageType": "",
"name": "片区审核",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/index"
},
{
"type": "Activity_1rjn5s1",
"pageType": "",
"name": "投融/法务审核",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/index"
},
{
"type": "Activity_0rbc0gc",
"pageType": "",
"name": "资产审核",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/index"
},
{
"type": "AbarbeitungWaitPush",
"pageType": "",
"name": "推送融资",
"url": "/view/mine/subPackageA/InvestmentAndFinancing/investment/index"
},
{
"type": "WaitAbarbeitung",
"pageType": "",
"name": "经销商重新提交验收/退回建档",
"url": "/view/mine/subPackageA/menus/acceptanceCheck/ysgl"
},
{
"type": "FinancingAudit",
"pageType": "",
"name": "融资审核",
"url": "/view/mine/subPackageA/InvestmentAndFinancing/financing/index"
},
{
"type": "AuditPass",
"pageType": "",
"name": "放款确认",
"url": "/view/mine/subPackageA/InvestmentAndFinancing/investment/index"
},
{
"type": "hygf_repayment",
"pageType": "",
"name": "还款管理",
"url": ""
}
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment