Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
段飞宇 1 year ago
parent
commit
0fab09a6a1
  1. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
  2. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  3. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  4. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  5. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  6. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml

@ -54,10 +54,14 @@
on t.plan_id = p.id on t.plan_id = p.id
WHERE WHERE
t.IS_DELETED =0 t.IS_DELETED =0
<choose>
<when test="req.status != null and req.status != ''">
and t.status = #{req.status}
</when>
<otherwise>
and t.status != 4 and t.status != 4
<if test="req.id != null"> </otherwise>
and t.id = #{req.id} </choose>
</if>
<if test="req.code != null and req.code != ''"> <if test="req.code != null and req.code != ''">
AND t.`CODE` LIKE CONCAT('%',#{req.code},'%') AND t.`CODE` LIKE CONCAT('%',#{req.code},'%')
</if> </if>
@ -85,7 +89,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
ORDER BY t.ID DESC ORDER BY t.create_time DESC
</select> </select>
<select id="selectByEmCode" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskEntity" parameterType="list"> <select id="selectByEmCode" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskEntity" parameterType="list">

19
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -8,10 +8,7 @@ import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.dto.*; import com.hnac.hzims.operational.access.dto.*;
import com.hnac.hzims.operational.access.entity.OperAccessContentDetailEntity; import com.hnac.hzims.operational.access.entity.*;
import com.hnac.hzims.operational.access.entity.OperAccessContentEntity;
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import com.hnac.hzims.operational.access.service.*; import com.hnac.hzims.operational.access.service.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -119,6 +116,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
for (OperAccessMaterialDTO material : entity.getAccessMaterials()){ for (OperAccessMaterialDTO material : entity.getAccessMaterials()){
material.setId(null); material.setId(null);
material.setPlanId(entity.getId()); material.setPlanId(entity.getId());
material.setIsDeleted(0);
materialService.save(material); materialService.save(material);
} }
} }
@ -226,17 +224,24 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
* @param entity * @param entity
*/ */
private void startTaskProcess(AccessPlanV4DTO entity) { private void startTaskProcess(AccessPlanV4DTO entity) {
// 查询计划数据
OperAccessPlanEntity plan = planService.getById(entity.getId());
if(ObjectUtil.isEmpty(plan)){
throw new ServiceException("未查询到检修计划!");
}
for(OperAccessContentDTO item : entity.getAccessContents()){ for(OperAccessContentDTO item : entity.getAccessContents()){
//任务参数 //任务参数
AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class); AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class);
task.setStatus(1); task.setStatus(1);
task.setCreateTime(new Date()); task.setCreateTime(new Date());
task.setCreateUser(entity.getCreateUser()); task.setCreateUser(plan.getCreateUser());
task.setProcDefId(entity.getProcDefId()); task.setProcDefId(plan.getProcDefId());
task.setHandler(item.getManager()); task.setHandler(item.getManager());
task.setPlanId(entity.getId()); task.setPlanId(plan.getId());
task.setContentId(item.getId()); task.setContentId(item.getId());
task.setEmCode(item.getEmCode()); task.setEmCode(item.getEmCode());
task.setTenantId(plan.getTenantId());
task.setCreateUser(item.getManager()); task.setCreateUser(item.getManager());
// 任务详情 // 任务详情
if(CollectionUtil.isNotEmpty(item.getAccessContentDetails())){ if(CollectionUtil.isNotEmpty(item.getAccessContentDetails())){

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java

@ -20,6 +20,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.RandomUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
@ -135,6 +136,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
material.setId(null); material.setId(null);
material.setPlanId(entity.getPlanId()); material.setPlanId(entity.getPlanId());
material.setTaskId(entity.getId()); material.setTaskId(entity.getId());
material.setIsDeleted(0);
material.setTenantId(entity.getTenantId());
materialService.save(material); materialService.save(material);
} }
} }
@ -158,6 +161,7 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
for (OperAccessTaskDetailDTO detail : entity.getAccessTaskDetails()){ for (OperAccessTaskDetailDTO detail : entity.getAccessTaskDetails()){
detail.setId(null); detail.setId(null);
detail.setTaskId(entity.getId()); detail.setTaskId(entity.getId());
detail.setTenantId(entity.getTenantId());
detailService.save(detail); detailService.save(detail);
} }
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -216,7 +216,6 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
@Override @Override
public R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query) { public R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query) {
IPage<OperAccessTaskVO> page = Condition.getPage(query); IPage<OperAccessTaskVO> page = Condition.getPage(query);
req.setHandler(AuthUtil.getUserId());
List<OperAccessTaskVO> data = mapper.pageCondition(page, req); List<OperAccessTaskVO> data = mapper.pageCondition(page, req);
page.setRecords(OperAccessTaskWrapper.build().listVOExtras(data)); page.setRecords(OperAccessTaskWrapper.build().listVOExtras(data));
return R.data(page); return R.data(page);

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -1604,7 +1604,7 @@ public class HydropowerServiceImpl implements HydropowerService {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME); DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
String start = dtf.format(startDate); String start = dtf.format(startDate);
String end = dtf.format(LocalDateTime.now()); String end = dtf.format(LocalDateTime.now());
List<Long> deptList = Collections.singletonList(deptId); List<Long> deptList = Collections.singletonList(duty.getCreateDept());
// 使用多线程处理数据 // 使用多线程处理数据
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("duty_data-pool-%d").build(); ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("duty_data-pool-%d").build();
ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java

@ -194,9 +194,9 @@ public class WindHomeServiceImpl implements WindHomeService {
subordinate.setLgtd(station.getLgtd()); subordinate.setLgtd(station.getLgtd());
// 省市编码 // 省市编码
String areaCode = station.getAreaCode(); String areaCode = station.getAreaCode();
subordinate.setAreaCode(areaCode);
if (!StringUtil.isEmpty(areaCode)) { if (!StringUtil.isEmpty(areaCode)) {
String[] arrCode = areaCode.split(","); String[] arrCode = areaCode.split(",");
subordinate.setAreaCode(arrCode[arrCode.length-1]);
R<Region> R = sysClient.getRegion(arrCode[1]); R<Region> R = sysClient.getRegion(arrCode[1]);
if (R.isSuccess() && ObjectUtil.isNotEmpty(R.getData())) { if (R.isSuccess() && ObjectUtil.isNotEmpty(R.getData())) {
subordinate.setAreaName(R.getData().getName()); subordinate.setAreaName(R.getData().getName());

Loading…
Cancel
Save