Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
0e23c48acd
  1. 26
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java
  2. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
  3. 15
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java
  4. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java
  5. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java
  6. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java
  7. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  8. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java
  9. 44
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
  10. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessTaskService.java
  11. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  12. 31
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java
  13. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java
  14. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

26
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/controller/PlanController.java

@ -1,17 +1,12 @@
package com.hnac.hzinfo.inspect.plan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.invalid.DictInvalid;
import com.hnac.hzinfo.inspect.obj.utils.CodeUtils;
import com.hnac.hzinfo.inspect.plan.PlanContants;
import com.hnac.hzinfo.inspect.plan.entity.PlanEntity;
import com.hnac.hzinfo.inspect.plan.service.IPlanObjectTemplateService;
import com.hnac.hzinfo.inspect.plan.service.IPlanService;
@ -24,7 +19,6 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
@ -32,11 +26,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@ -83,9 +73,9 @@ public class PlanController extends BladeController {
if(plan.getEndTime()!=null){
queryWrapper.le(PlanEntity::getEndTime,plan.getEndTime());
}
if(plan.getStatus()==null){
queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
}
// if(plan.getStatus()==null){
// queryWrapper.ne(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_AUTH.getStatus());
// }
if(plan.getCreateDept()!=null){
queryWrapper.eq(PlanEntity::getCreateDept,plan.getCreateDept());
}
@ -113,7 +103,15 @@ public class PlanController extends BladeController {
public R<List<Long>> addAndChecked(@Valid @RequestBody PlanVO plan) {
return R.data(planService.addAndChecked(plan));
}
/**
* 撤销
*/
@GetMapping("/revoke")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "撤销", notes = "传入plan")
public R<Boolean> revoke(@RequestParam Long planId) {
return R.data(planService.revoke(planId));
}
/**
* 删除

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java

@ -59,4 +59,6 @@ public interface IPlanService extends BaseService<PlanEntity> {
Boolean deletePlanAndRelatives(Long id);
List<PlanOfflineVO> getPlans(List<Long> planIds);
Boolean revoke(Long planId);
}

15
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java

@ -109,6 +109,21 @@ public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanEntity> imp
}
/**
*巡检计划撤销
* @param planId
* @return
*/
@Override
public Boolean revoke(Long planId) {
boolean re;
LambdaUpdateWrapper<PlanEntity> uw = new UpdateWrapper<PlanEntity>().lambda();
uw.set(PlanEntity::getStatus, PlanContants.PlanStatusEnum.PLAN_SUBMIT.getStatus());
uw.eq(PlanEntity::getId, planId);
re = update(uw);
return re;
}
/**
* 保存巡检计划
*/
@Transactional(rollbackFor = Exception.class)

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessStatisticsController.java

@ -80,13 +80,13 @@ public class OperAccessStatisticsController extends BladeController {
* 分页
*/
@ApiLog
@PostMapping("/list")
@GetMapping("/list")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:pid,taskId,manager")
@OperationAnnotation(moduleName = "检修管理",title = "检修记录",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询检修记录列表")
public R<IPage<OperAccessStatisticsVO>> list(@RequestBody OperAccessStatisticsDTO req, Query query) {
public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, Query query) {
return service.list(req, Condition.getPage(query));
}

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessTaskController.java

@ -87,6 +87,7 @@ public class OperAccessTaskController extends BladeController {
return service.detail(id);
}
/**
* 分页
*/
@ -100,7 +101,22 @@ public class OperAccessTaskController extends BladeController {
public R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query) {
return service.list(req, query);
}
/**
* 分页
*/
@ApiLog
@PostMapping("/listByStatus")
@ApiOperationSupport(order = 50)
@OperationAnnotation(moduleName = "检修管理",title = "检修任务",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询我的检修任务列表")
@ApiOperation(value = "分页 查询参数:name,code,handler,status,planId,planCode")
public R<IPage<OperAccessTaskVO>> list(@RequestBody OperAccessTaskDTO req) {
Query query=new Query();
query.setCurrent(req.getCurrent());
query.setSize(req.getSize());
return service.listByStatus(req, query);
}
/**
* 获取检修台账

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessTaskDTO.java

@ -21,7 +21,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity {
@ApiModelProperty(value = "创建机构集合")
private List<Long> deptIds;
@ApiModelProperty(value = "ids")
private List<Long> ids;
@ApiModelProperty(value = "工作流Key")
private String procDefId;
@ -39,4 +40,8 @@ public class OperAccessTaskDTO extends OperAccessTaskEntity {
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("当前页")
private Integer current;
@ApiModelProperty("每页的数量")
private Integer size;
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -28,12 +28,6 @@
JOIN hzims_oper_access_task OT
ON OS.`TASK_ID` = OT.`ID`
WHERE OS.IS_DELETED = 0
<if test="dto.ids != null">
and OS.id in
<foreach collection="dto.ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="dto.taskName != null">
and OT.`NAME` like concat('%',#{dto.taskName},'%')
</if>

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

@ -28,6 +28,9 @@ public interface OperAccessTaskMapper extends UserDataScopeBaseMapper<OperAccess
@UserDataAuth
List<OperAccessTaskVO> pageCondition(IPage page, @Param("req") OperAccessTaskDTO req);
List<OperAccessTaskVO> pageConditionByStatus(IPage page, @Param("req") OperAccessTaskDTO req);
List<OperAccessTaskEntity> selectByEmCode(String emCode,List<String> list);
@SqlParser(filter = true)

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

@ -65,6 +65,7 @@
<if test="req.code != null and req.code != ''">
AND t.`CODE` LIKE CONCAT('%',#{req.code},'%')
</if>
<if test="req.handler != null">
AND t.`HANDLER`=#{req.handler}
</if>
@ -91,7 +92,48 @@
</if>
ORDER BY t.create_time DESC
</select>
<select id="pageConditionByStatus" resultType="com.hnac.hzims.operational.access.vo.OperAccessTaskVO">
SELECT t.*,p.name as planName
FROM hzims_oper_access_task t
left join hzims_oper_access_plan p
on t.plan_id = p.id
WHERE
t.IS_DELETED =0
<if test="req.code != null and req.code != ''">
AND t.`CODE` LIKE CONCAT('%',#{req.code},'%')
</if>
<if test="req.ids != null">
AND t.id in
<foreach collection="req.ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="req.handler != null">
AND t.`HANDLER`=#{req.handler}
</if>
<if test="req.planId != null">
AND p.ID =#{req.planId}
</if>
<if test="req.name != null and req.name != ''">
AND t.`NAME` LIKE CONCAT('%',#{req.name},'%')
</if>
<if test="req.excludeNullTicket != null and req.excludeNullTicket == 1">
and t.`TICKET_ID` is null
</if>
<if test="req.startTime != null and req.startTime != ''">
and t.`PLAN_START_TIME` &gt; #{req.startTime}
</if>
<if test="req.endTime != null and req.startTime != '' ">
and t.`PLAN_START_TIME` &lt; #{req.endTime}
</if>
<if test="req.deptIds != null">
and t.create_dept in
<foreach collection="req.deptIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
ORDER BY t.create_time DESC
</select>
<select id="selectByEmCode" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskEntity" parameterType="list">
select * from hzims_oper_access_task
where IS_DELETED = 0

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

@ -33,6 +33,7 @@ public interface IOperAccessTaskService extends BaseService<OperAccessTaskEntity
R<OperAccessTaskVO> detail(Long id);
R<IPage<OperAccessTaskVO>> list(OperAccessTaskDTO req, Query query);
R<IPage<OperAccessTaskVO>> listByStatus(OperAccessTaskDTO req, Query query);
List<OperAccessTaskEntity> getByEmCode(String emCode,List<String> list);

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

@ -228,6 +228,14 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
}
@Override
public R<IPage<OperAccessTaskVO>> listByStatus(OperAccessTaskDTO req, Query query) {
IPage<OperAccessTaskVO> page = Condition.getPage(query);
List<OperAccessTaskVO> data = mapper.pageConditionByStatus(page, req);
page.setRecords(OperAccessTaskWrapper.build().listVOExtras(data));
return R.data(page);
}
@Override
public List<OperAccessTaskEntity> getByEmCode(String emCode, List<String> list) {
return this.baseMapper.selectByEmCode(emCode, list);
}

31
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectStatisticsWrapper.java

@ -1,12 +1,10 @@
package com.hnac.hzims.operational.defect.wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import com.hnac.hzims.operational.defect.vo.OperDefectStatisticsVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Dept;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
@ -30,19 +28,22 @@ public class OperDefectStatisticsWrapper extends BaseEntityWrapper<OperDefectSta
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser == null ? "" : createUser.getName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName());
User userC = UserCache.getUser(entity.getConclusionPeople());
vo.setConclusionPeopleName(userC == null ? "" : userC.getName());
User userF = UserCache.getUser(entity.getFinder());
vo.setFinderName(userF == null ? "" : userF.getName());
User userD = UserCache.getUser(entity.getDiscriminator());
vo.setDiscriminatorName(userD == null ? "" : userD.getName());
User userHn = UserCache.getUser(entity.getHandler());
vo.setHandlerName(userHn == null ? "" : userHn.getName());
if (Func.isNotEmpty(entity.getConclusionPeople())) {
User userC = UserCache.getUser(entity.getConclusionPeople());
vo.setConclusionPeopleName(userC == null ? "" : userC.getName());
}
if (Func.isNotEmpty(entity.getFinder())) {
User userF = UserCache.getUser(entity.getFinder());
vo.setFinderName(userF == null ? "" : userF.getName());
}
if (Func.isNotEmpty(entity.getDiscriminator())) {
User userD = UserCache.getUser(entity.getDiscriminator());
vo.setDiscriminatorName(userD == null ? "" : userD.getName());
}
if (Func.isNotEmpty(entity.getHandler())) {
User userHn = UserCache.getUser(entity.getHandler());
vo.setHandlerName(userHn == null ? "" : userHn.getName());
}
// 赋值消缺处理人名称
vo.setPlanHandlerName(Optional.ofNullable(entity.getPlanHandler()).map(Long::parseLong).map(UserCache::getUser).map(User::getName).orElse(entity.getPlanHandler()));
// 赋值两票工作负责人名称

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java

@ -65,6 +65,9 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam
public R queryAnalyseExampleData(AnalyzeDataCondition analyzeDataCondition) {
//设备ID:分析实例编码
R<HzPage<AnalyzeDataList>> analyzeDataByAnalyzeCode = searchClient.getAnalyzeDataByAnalyzeCode(analyzeDataCondition);
if(!analyzeDataByAnalyzeCode.isSuccess()) {
throw new ServiceException("设备数据查询异常,请检查好配置后重试!");
}
return analyzeDataByAnalyzeCode;
}
@ -131,6 +134,9 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam
public void outPutAnalyseExampleData(HttpServletResponse response, AnalyzeDataCondition analyzeDataCondition) {
try {
R analyseExampleData =queryAnalyseExampleData(analyzeDataCondition);
if(!analyseExampleData.isSuccess()) {
throw new ServiceException("设备数据查询异常,请检查好配置后重试!");
}
String name="值班日志";
if(ObjectUtils.isEmpty(analyzeDataCondition.getBeginTime())){
String format = DateUtil.format(analyzeDataCondition.getBeginTime(), DateUtil.PATTERN_DATE);

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -1409,6 +1409,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
// 获取部门所有没有分组的组员
LambdaQueryWrapper<ImsDutyMainPersonEntity> personWrapper = new LambdaQueryWrapper();
personWrapper.eq(ImsDutyMainPersonEntity::getCreateDept, deptId);
personWrapper.like(ImsDutyMainPersonEntity::getDutyDate, yearAndMonth);
List<ImsDutyMainPersonEntity> deptPersonList = imsDutyMainPersonMapper.selectList(personWrapper);
// 获取本月天数
@ -1438,13 +1439,15 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
List<ImsDutyGroupPEntity> list = imsDutyGroupPService.list(groupPWrapper);
managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId());
personIds = list.stream().map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
personIds = list.stream()
// 过滤出组长
.filter(s->!s.getPersonId().equals(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()))
.map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
} else {
// 不存在分组id从排班人员中获取组长和组员
List<ImsDutyMainPersonEntity> personList = deptPersonList.stream().filter(var -> var.getDutyMainId().equals(imsDutyMainEntity.getId())).collect(Collectors.toList());
managerName = deptUserMap.get(personList.get(0).getDutyChargePerson());
personIds = personList.stream().map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
personIds = personList.stream().filter(s->!s.getDutyPerson().equals(personList.get(0).getDutyChargePerson())).map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
}
String personNames = "";

Loading…
Cancel
Save