Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
liwen 11 months ago
parent
commit
4dac881ccb
  1. 6
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java
  2. 6
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java
  3. 6
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SparePartVO.java
  4. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java
  5. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java
  6. 20
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClientFallback.java
  7. 28
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/IAccessMaterialClient.java
  8. 17
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/MaterialConsumeVO.java
  9. 3
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
  10. 11
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java
  11. 3
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java
  12. 16
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml
  13. 3
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java
  14. 6
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java
  15. 4
      hzims-service/equipment/pom.xml
  16. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  17. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java
  18. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java
  19. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml
  20. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java
  21. 85
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  22. 34
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClient.java
  23. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.java
  24. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml
  25. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.java
  26. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml
  27. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessMaterialService.java
  28. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessMaterialServiceImpl.java
  29. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  30. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/RepairBillVO.java
  31. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
  32. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  33. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java
  34. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml
  35. 25
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java
  36. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkTicketBillVO.java
  37. 5
      hzims-service/ticket/src/main/resources/db/2.0.1.sql
  38. 9
      hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

6
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClient.java

@ -3,6 +3,7 @@ package com.hnac.hzims.spare.feign;
import com.hnac.hzims.operational.census.vo.AreaTimelyVo; import com.hnac.hzims.operational.census.vo.AreaTimelyVo;
import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.vo.ExceedVo; import com.hnac.hzims.spare.vo.ExceedVo;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
@ -23,6 +24,8 @@ public interface ISpareClient {
String EXCEED_LIMIT = API_PREFIX + "/exceedLimit" ; String EXCEED_LIMIT = API_PREFIX + "/exceedLimit" ;
String SPARE_PART = API_PREFIX + "/sparePart" ;
/** /**
* 保存工单与出库单关联信息 * 保存工单与出库单关联信息
* @param recordEntity * @param recordEntity
@ -33,4 +36,7 @@ public interface ISpareClient {
@PostMapping(EXCEED_LIMIT) @PostMapping(EXCEED_LIMIT)
List<AreaTimelyVo> exceedLimit(@RequestParam("deptId") Long deptId); List<AreaTimelyVo> exceedLimit(@RequestParam("deptId") Long deptId);
@GetMapping(EXCEED_LIMIT)
List<SparePartVO> sparePart(@RequestParam("basics") List<Long> basics);
} }

6
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareClientFallback.java

@ -2,6 +2,7 @@ package com.hnac.hzims.spare.feign;
import com.hnac.hzims.operational.census.vo.AreaTimelyVo; import com.hnac.hzims.operational.census.vo.AreaTimelyVo;
import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -24,4 +25,9 @@ public class ISpareClientFallback implements ISpareClient {
public List<AreaTimelyVo> exceedLimit(Long deptId) { public List<AreaTimelyVo> exceedLimit(Long deptId) {
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public List<SparePartVO> sparePart(List<Long> basics) {
return new ArrayList<>();
}
} }

6
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/vo/SparePartVO.java → hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SparePartVO.java

@ -1,4 +1,4 @@
package com.hnac.hzims.equipment.vo; package com.hnac.hzims.spare.vo;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -9,6 +9,10 @@ import lombok.Data;
*/ */
@Data @Data
public class SparePartVO { public class SparePartVO {
@ApiModelProperty(value = "物资类别编号")
private Long basicId;
@ApiModelProperty(value = "设备名称") @ApiModelProperty(value = "设备名称")
private String emName; private String emName;

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java

@ -82,6 +82,8 @@ public interface IEmInfoClient {
String GET_EM_CREATE_TABLE = API_PREFIX + "/getEmCreateTable"; String GET_EM_CREATE_TABLE = API_PREFIX + "/getEmCreateTable";
String GET_VIDEO_DEVICE_BY_EM_CODE = API_PREFIX + "/getVideoDeviceByEmCode"; String GET_VIDEO_DEVICE_BY_EM_CODE = API_PREFIX + "/getVideoDeviceByEmCode";
String DEVICE_BY_PATH = API_PREFIX + "/deviceByPath";
@PostMapping(DETAIL) @PostMapping(DETAIL)
EmInfoEntity getByCode(@RequestParam("code") String id); EmInfoEntity getByCode(@RequestParam("code") String id);
@ -161,4 +163,7 @@ public interface IEmInfoClient {
@GetMapping(value = GET_VIDEO_DEVICE_BY_EM_CODE) @GetMapping(value = GET_VIDEO_DEVICE_BY_EM_CODE)
List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo); List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo);
@GetMapping(DEVICE_BY_PATH)
List<EmInfoEntity> deviceByPath(@RequestParam("emCode") String emCode);
} }

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java

@ -104,4 +104,9 @@ public class IEmInfoClientBack implements IEmInfoClient {
public List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo) { public List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo) {
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public List<EmInfoEntity> deviceByPath(String emCode) {
return new ArrayList<>();
}
} }

20
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClientFallback.java

@ -0,0 +1,20 @@
package com.hnac.hzims.operational.access.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* @author ysj
*/
@Component
public class AccessMaterialClientFallback implements IAccessMaterialClient {
@Override
public List<MaterialConsumeVO> materialConsume(List<Long> basics) {
return new ArrayList<>();
}
}

28
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/feign/IAccessMaterialClient.java

@ -0,0 +1,28 @@
package com.hnac.hzims.operational.access.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author ysj
*/
@FeignClient(
value = OperationalConstants.APP_NAME,
fallback = AccessMaterialClientFallback.class
)
public interface IAccessMaterialClient {
String API_PREFIX = "/feign/accessMaterial";
String MATERIAL_CONSUME = API_PREFIX + "/materialConsume";
@GetMapping(MATERIAL_CONSUME)
List<MaterialConsumeVO> materialConsume(@RequestParam("basics") List<Long> basics);
}

17
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/vo/MaterialConsumeVO.java

@ -0,0 +1,17 @@
package com.hnac.hzims.operational.access.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class MaterialConsumeVO {
@ApiModelProperty(value = "物资编号")
private Long basicId;
@ApiModelProperty(value = "消耗数量")
private Integer expend;
}

3
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java

@ -497,4 +497,7 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
@TableField(exist=false) @TableField(exist=false)
private Integer isQualified; private Integer isQualified;
@ApiModelProperty("是否线下 : 1-线下,0-线上")
private Boolean isOffline;
} }

11
hzims-service/assets/src/main/java/com/hnac/hzims/spare/feign/SpareClient.java

@ -6,6 +6,7 @@ import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.mapper.SpRecordMapper; import com.hnac.hzims.spare.mapper.SpRecordMapper;
import com.hnac.hzims.spare.mapper.SpWarehouseOutMapper; import com.hnac.hzims.spare.mapper.SpWarehouseOutMapper;
import com.hnac.hzims.spare.service.*; import com.hnac.hzims.spare.service.*;
import com.hnac.hzims.spare.vo.SparePartVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -129,4 +130,14 @@ public class SpareClient implements ISpareClient{
} }
return exceeds; return exceeds;
} }
/**
* 备品备件台账
* @param basics
* @return
*/
@Override
public List<SparePartVO> sparePart(List<Long> basics) {
return wtSpBasicService.sparePart(basics);
}
} }

3
hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.java

@ -2,9 +2,11 @@ package com.hnac.hzims.spare.mapper;
import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity; import com.hnac.hzims.spare.entity.WtSpBasicEntity;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -46,4 +48,5 @@ public interface WtSpBasicMapper extends UserDataScopeBaseMapper<WtSpBasicEntity
@UserDataAuth @UserDataAuth
List<SpTemporaryStockDetailEntity> getInList(Long spBasicId); List<SpTemporaryStockDetailEntity> getInList(Long spBasicId);
List<SparePartVO> sparePart(@RequestParam("basics") List<Long> basics);
} }

16
hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpBasicMapper.xml

@ -94,4 +94,20 @@
AND b.type = 5 AND b.type = 5
</select> </select>
<select id="sparePart" resultType="com.hnac.hzims.spare.vo.SparePartVO">
SELECT basic.ID as basicId,house.`NAME` as houseName,basic.`NAME` as basicName,basic.UPPER_LIMIT,basic.LOWER_LIMIT,total.stock
FROM WT_SP_BASIC basic
LEFT JOIN WT_SP_TOTAL total ON basic.id = total.SP_BASIC_ID
LEFT JOIN WT_SP_WAREHOUSE house ON total.WAREHOUSE_ID = house.id
<where>
1 = 2 OR
<if test="basics != null">
and basic.ID in
<foreach collection="basics" item="basic" index="index" open="(" close=")" separator=",">
#{basic}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>

3
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.SpTemporaryStockEntity; import com.hnac.hzims.spare.entity.SpTemporaryStockEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity; import com.hnac.hzims.spare.entity.WtSpBasicEntity;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -73,6 +74,8 @@ public interface IWtSpBasicService extends BaseService<WtSpBasicEntity> {
R importExcel(MultipartFile file) throws Exception; R importExcel(MultipartFile file) throws Exception;
List<SparePartVO> sparePart(List<Long> basics);
/** /**
* 获取流程中的用户 * 获取流程中的用户
* @param deptId * @param deptId

6
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java

@ -29,6 +29,7 @@ import com.hnac.hzims.spare.service.IWtSpTotalService;
import com.hnac.hzims.spare.service.IWtSpWarehouseService; import com.hnac.hzims.spare.service.IWtSpWarehouseService;
import com.hnac.hzims.spare.utils.ExcelToolListener; import com.hnac.hzims.spare.utils.ExcelToolListener;
import com.hnac.hzims.spare.utils.SheetWriteStyleHandler; import com.hnac.hzims.spare.utils.SheetWriteStyleHandler;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient; import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO; import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
@ -580,6 +581,11 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl<WtSpBasicMapper, WtSpB
} }
@Override
public List<SparePartVO> sparePart(List<Long> basics) {
return this.basicMapper.sparePart(basics);
}
private InputStream copyStream(InputStream source) throws IOException { private InputStream copyStream(InputStream source) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];

4
hzims-service/equipment/pom.xml

@ -98,6 +98,10 @@
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>inspect-api</artifactId> <artifactId>inspect-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>assets-api</artifactId>
</dependency>
</dependencies> </dependencies>

3
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -10,14 +10,13 @@ import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.equipment.dto.DeviceTreeDTO; import com.hnac.hzims.equipment.dto.DeviceTreeDTO;
import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.entity.EmTreeEntity;
import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.equipment.service.IEmInfoService;
import com.hnac.hzims.equipment.vo.EmInfoAddVo; import com.hnac.hzims.equipment.vo.EmInfoAddVo;
import com.hnac.hzims.equipment.vo.EmInfoContentVO; import com.hnac.hzims.equipment.vo.EmInfoContentVO;
import com.hnac.hzims.equipment.vo.EmInfoVO; import com.hnac.hzims.equipment.vo.EmInfoVO;
import com.hnac.hzims.equipment.vo.SparePartVO;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.util.MemoryPagination; import com.hnac.hzims.util.MemoryPagination;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;

16
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/feign/EmInfoClient.java

@ -9,11 +9,16 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.equipment.service.IEmInfoService;
import com.hnac.hzims.equipment.vo.DeviceVO; import com.hnac.hzims.equipment.vo.DeviceVO;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.vo.CreateTableVO; import org.springblade.system.vo.CreateTableVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -131,6 +136,17 @@ public class EmInfoClient implements IEmInfoClient {
public List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo) { public List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo) {
return service.getVideoDeviceByEmCode(emInfo); return service.getVideoDeviceByEmCode(emInfo);
} }
/**
* 获取设备路径下的设备
* @param emCode
* @return
*/
@Override
public List<EmInfoEntity> deviceByPath(String emCode) {
return service.deviceByPath(emCode);
}
@PostMapping(GET_EM_CREATE_TABLE) @PostMapping(GET_EM_CREATE_TABLE)
@Override @Override
public List<CreateTableVO> getEmCreateTable(List<String> tableNames) { public List<CreateTableVO> getEmCreateTable(List<String> tableNames) {

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java

@ -4,7 +4,7 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.vo.EmInfoExtendVo; import com.hnac.hzims.equipment.vo.EmInfoExtendVo;
import com.hnac.hzims.equipment.vo.DeviceVO; import com.hnac.hzims.equipment.vo.DeviceVO;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.equipment.vo.SparePartVO; import com.hnac.hzims.spare.vo.SparePartVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth; import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml

@ -120,7 +120,7 @@
select max(em_index) from hzims_em_info where DEPARTMENT = #{department} and em_grade = #{emGrade} and is_deleted = 0 select max(em_index) from hzims_em_info where DEPARTMENT = #{department} and em_grade = #{emGrade} and is_deleted = 0
</select> </select>
<select id="getSparePart" resultType="com.hnac.hzims.equipment.vo.SparePartVO"> <select id="getSparePart" resultType="com.hnac.hzims.spare.vo.SparePartVO">
select info.`NAME` as emName,house.`NAME` as houseName,basic.`NAME` as basicName, select info.`NAME` as emName,house.`NAME` as houseName,basic.`NAME` as basicName,
mat.number as expend,basic.UPPER_LIMIT,basic.LOWER_LIMIT,total.stock mat.number as expend,basic.UPPER_LIMIT,basic.LOWER_LIMIT,total.stock
from hzims_em_info info from hzims_em_info info

3
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.equipment.dto.DeviceTreeDTO; import com.hnac.hzims.equipment.dto.DeviceTreeDTO;
import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.vo.*; import com.hnac.hzims.equipment.vo.*;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -91,4 +92,6 @@ public interface IEmInfoService extends BaseService<EmInfoEntity> {
List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo); List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo);
List<EmInfoEntity> hkVideoDevices(); List<EmInfoEntity> hkVideoDevices();
List<EmInfoEntity> deviceByPath(String emCode);
} }

85
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -17,9 +17,13 @@ import com.hnac.hzims.equipment.mapper.EmInfoNoScopeMapper;
import com.hnac.hzims.equipment.service.*; import com.hnac.hzims.equipment.service.*;
import com.hnac.hzims.equipment.vo.*; import com.hnac.hzims.equipment.vo.*;
import com.hnac.hzims.fdp.service.IFdpQuestionService; import com.hnac.hzims.fdp.service.IFdpQuestionService;
import com.hnac.hzims.operational.access.feign.IAccessMaterialClient;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.spare.feign.ISpareClient;
import com.hnac.hzims.spare.vo.SparePartVO;
import com.hnac.hzims.util.TableJsonUtils; import com.hnac.hzims.util.TableJsonUtils;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
@ -87,12 +91,17 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
@Autowired @Autowired
private IEmTreeInspectService emTreeInspectService; private IEmTreeInspectService emTreeInspectService;
@Autowired @Autowired
private IEmTreeBasicService emTreeBasicService;
@Autowired
private IEmDefinitionService emDefinitionService; private IEmDefinitionService emDefinitionService;
@Autowired @Autowired
private IAccessMaterialClient accessMaterialClient;
@Autowired
private IStationClient stationClient; private IStationClient stationClient;
@Autowired @Autowired
private IAnalyseDataSearchClient searchClient; private IAnalyseDataSearchClient searchClient;
@Autowired
private ISpareClient spareClient;
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@ -563,10 +572,61 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
return emInfoContentList; return emInfoContentList;
} }
/**
* 备品备件台账
* @param emCode
* @param startTime
* @param endTime
* @return
*/
@Override @Override
public List<SparePartVO> getSparePart(String emCode, String startTime, String endTime) { public List<SparePartVO> getSparePart(String emCode, String startTime, String endTime) {
EmInfoEntity emInfo = this.getEmInfoByEmCode(emCode); // 查询路径设备
return baseMapper.getSparePart(emInfo.getPath(), startTime, endTime); List<EmInfoEntity> devices = deviceByPath(emCode);
if(CollectionUtil.isEmpty(devices)){
return new ArrayList<>();
}
// 物资台账记录
List<Long> trees = devices.stream().map(EmInfoEntity::getTreeId).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
if(CollectionUtil.isEmpty(trees)){
return new ArrayList<>();
}
List<EmTreeBasicEntity> treeBasics = emTreeBasicService.list(Wrappers.<EmTreeBasicEntity>lambdaQuery()
.in(EmTreeBasicEntity::getTreeId,trees));
if(CollectionUtil.isEmpty(treeBasics)){
return new ArrayList<>();
}
List<Long> basics = treeBasics.stream().map(EmTreeBasicEntity::getBasicId).filter(ObjectUtil::isNotEmpty).filter(ObjectUtil::isNotEmpty).collect(Collectors.toList());
if(CollectionUtil.isEmpty(basics)){
return new ArrayList<>();
}
// 仓库、物资种类、库存上限、库存下限、物资库存
List<SparePartVO> spares = spareClient.sparePart(basics);
if(CollectionUtil.isEmpty(spares)){
return new ArrayList<>();
}
// 物资消耗
List<MaterialConsumeVO> consumes = accessMaterialClient.materialConsume(basics);
return spares.stream().peek(spare -> {
List<MaterialConsumeVO> spareConsumes = consumes.stream().filter(consume->consume.getBasicId().equals(spare.getBasicId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(spareConsumes)){
spare.setExpend(0);
}else{
spare.setExpend(spareConsumes.get(0).getExpend());
}
// 设备名称
List<EmTreeBasicEntity> deviceBasics = treeBasics.stream().filter(tree->tree.getBasicId().equals(spare.getBasicId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(deviceBasics)){
spare.setEmName("未知设备");
}else{
List<EmInfoEntity> deivceEntitys = devices.stream().filter(device->device.getTreeId().equals(deviceBasics.get(0).getTreeId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(deivceEntitys)){
spare.setEmName("未知设备");
}else{
spare.setEmName(deivceEntitys.get(0).getName());
}
}
}).collect(Collectors.toList());
} }
@Override @Override
@ -911,4 +971,23 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
.eq(EmInfoEntity::getEmType,4)); .eq(EmInfoEntity::getEmType,4));
} }
/**
* 符合设备路径的设备
* @param emCode
* @return
*/
@Override
public List<EmInfoEntity> deviceByPath(String emCode) {
EmInfoEntity device = this.getOne(Wrappers.<EmInfoEntity>lambdaQuery().
eq(EmInfoEntity::getNumber,emCode));
if(ObjectUtil.isEmpty(device)){
return new ArrayList<>();
}
if(StringUtil.isEmpty(device.getPath())){
return Collections.singletonList(device);
}
String[] deviceCodes = device.getPath().split("/");
return this.list(Wrappers.<EmInfoEntity>lambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes)));
}
} }

34
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/AccessMaterialClient.java

@ -0,0 +1,34 @@
package com.hnac.hzims.operational.access.feign;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.service.AccessPlanV4Service;
import com.hnac.hzims.operational.access.service.IOperAccessMaterialService;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author ysj
*/
@RestController
@RequestMapping("/feign/accessMaterial")
@Slf4j
@RequiredArgsConstructor
public class AccessMaterialClient implements IAccessMaterialClient {
private final IOperAccessMaterialService accessMaterialService;
/**
* 备品备件台账-物资消耗
* @param basics
* @return
*/
@Override
public List<MaterialConsumeVO> materialConsume(@RequestParam("basics") List<Long> basics) {
return accessMaterialService.materialConsume(basics);
}
}

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

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.access.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
@ -17,4 +18,6 @@ import java.util.List;
public interface OperAccessMaterialMapper extends BaseMapper<OperAccessMaterialEntity> { public interface OperAccessMaterialMapper extends BaseMapper<OperAccessMaterialEntity> {
List<OperAccessMaterialEntity> getList(@Param(value = "planId") String planId,@Param(value = "taskId") String taskId); List<OperAccessMaterialEntity> getList(@Param(value = "planId") String planId,@Param(value = "taskId") String taskId);
List<MaterialConsumeVO> materialConsume(@Param(value = "basics") List<Long> basics);
} }

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessMaterialMapper.xml

@ -39,4 +39,19 @@
</if> </if>
</select> </select>
<select id="materialConsume" resultType="com.hnac.hzims.operational.access.vo.MaterialConsumeVO">
SELECT SP_BASIC_ID AS basicId,sum(NUMBER) FROM HZIMS_OPER_ACCESS_MATERIAL
<where>
NOT SP_BASIC_ID IS NULL AND
1 = 2 OR
<if test="basics != null">
and basic.ID in
<foreach collection="basics" item="basic" index="index" open="(" close=")" separator=",">
#{basic}
</foreach>
</if>
</where>
GROUP BY SP_BASIC_ID
</select>
</mapper> </mapper>

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

@ -41,5 +41,5 @@ public interface OperAccessTaskMapper extends UserDataScopeBaseMapper<OperAccess
List<OperAccessTaskEntity> selectAccessTask(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("list")List<Long> list); List<OperAccessTaskEntity> selectAccessTask(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("list")List<Long> list);
List<RepairBillVO> getRepairBill(@Param("path") String path, @Param("startTime") String startTime, @Param("endTime") String endTime); List<RepairBillVO> getRepairBill(@Param("deviceCodes") List<String> deviceCodes,@Param("startTime") String startTime, @Param("endTime") String endTime);
} }

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

@ -207,15 +207,17 @@
</select> </select>
<select id="getRepairBill" resultType="com.hnac.hzims.operational.access.vo.RepairBillVO"> <select id="getRepairBill" resultType="com.hnac.hzims.operational.access.vo.RepairBillVO">
SELECT e.`NAME` AS emName,p.`GRADE_CODE`,count(t.ID) AS frequency, SELECT t.EM_CODE AS emCode,p.`GRADE_CODE`,count(t.ID) AS frequency,
sum(m.NUMBER) AS amount,t.ACT_HOURS,max(t.PLAN_START_TIME) AS recently sum(m.NUMBER) AS amount,t.ACT_HOURS,max(t.PLAN_START_TIME) AS recently
FROM hzims_oper_access_task t FROM hzims_oper_access_task t
LEFT JOIN hzims_oper_access_plan p ON t.PLAN_ID = p.ID LEFT JOIN hzims_oper_access_plan p ON t.PLAN_ID = p.ID
LEFT JOIN hzims_oper_access_material m ON t.ID = m.TASK_ID LEFT JOIN hzims_oper_access_material m ON t.ID = m.TASK_ID
LEFT JOIN equipment.hzims_em_info e ON t.EM_CODE = e.NUMBER
<where> <where>
<if test="path != null"> <if test="deviceCodes != null">
e.path like CONCAT(#{path},'%') and t.EM_CODE in
<foreach collection="deviceCodes" item="code" index="index" open="(" close=")" separator=",">
#{code}
</foreach>
</if> </if>
<if test="startTime != null"> <if test="startTime != null">
and t.PLAN_START_TIME &gt;= #{startTime} and t.PLAN_START_TIME &gt;= #{startTime}

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

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.access.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.access.dto.OperAccessMaterialDTO; import com.hnac.hzims.operational.access.dto.OperAccessMaterialDTO;
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import com.hnac.hzims.operational.access.vo.OperAccessMaterialVO; import com.hnac.hzims.operational.access.vo.OperAccessMaterialVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -25,4 +26,6 @@ public interface IOperAccessMaterialService extends BaseService<OperAccessMateri
R<IPage<OperAccessMaterialVO>> list(OperAccessMaterialDTO req, Query query); R<IPage<OperAccessMaterialVO>> list(OperAccessMaterialDTO req, Query query);
List<OperAccessMaterialVO> getList(String planId,String taskId); List<OperAccessMaterialVO> getList(String planId,String taskId);
List<MaterialConsumeVO> materialConsume(List<Long> basics);
} }

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessMaterialServiceImpl.java

@ -7,6 +7,7 @@ import com.hnac.hzims.operational.access.dto.OperAccessMaterialDTO;
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity;
import com.hnac.hzims.operational.access.mapper.OperAccessMaterialMapper; import com.hnac.hzims.operational.access.mapper.OperAccessMaterialMapper;
import com.hnac.hzims.operational.access.service.IOperAccessMaterialService; import com.hnac.hzims.operational.access.service.IOperAccessMaterialService;
import com.hnac.hzims.operational.access.vo.MaterialConsumeVO;
import com.hnac.hzims.operational.access.vo.OperAccessMaterialVO; import com.hnac.hzims.operational.access.vo.OperAccessMaterialVO;
import com.hnac.hzims.operational.access.wrapper.OperAccessMaterialWrapper; import com.hnac.hzims.operational.access.wrapper.OperAccessMaterialWrapper;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
@ -66,4 +67,14 @@ public class OperAccessMaterialServiceImpl extends BaseServiceImpl<OperAccessMat
} }
return OperAccessMaterialWrapper.build().listVO(list); return OperAccessMaterialWrapper.build().listVO(list);
} }
/**
* 备品备件台账
* @param basics
* @return
*/
@Override
public List<MaterialConsumeVO> materialConsume(List<Long> basics) {
return this.baseMapper.materialConsume(basics);
}
} }

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

@ -426,11 +426,32 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
return baseMapper.selectPage(dbPage, queryWrapper); return baseMapper.selectPage(dbPage, queryWrapper);
} }
/**
* 获取设备检修台账
* @param emCode
* @param startTime
* @param endTime
* @return
*/
@Override @Override
public List<RepairBillVO> getRepairBill(String emCode, String startTime, String endTime) { public List<RepairBillVO> getRepairBill(String emCode, String startTime, String endTime) {
EmInfoEntity emInfo = emInfoClient.getEmInfoByEmCode(emCode).getData(); // 查询路径设备
List<RepairBillVO> repairBillList = baseMapper.getRepairBill(emInfo.getPath(), startTime, endTime); List<EmInfoEntity> devices = emInfoClient.deviceByPath(emCode);
return repairBillList; if(CollectionUtil.isEmpty(devices)){
return new ArrayList<>();
}
List<RepairBillVO> repairs = baseMapper.getRepairBill(devices.stream().map(EmInfoEntity::getNumber).collect(Collectors.toList()),startTime, endTime);
if(CollectionUtil.isEmpty(repairs)){
return new ArrayList<>();
}
return repairs.stream().map(repair->{
List<EmInfoEntity> repairDevice = devices.stream().filter(device->device.getNumber().equals(repair.getEmCode())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(repairDevice)){
return repair;
}
repair.setEmName(repairDevice.get(0).getName());
return repair;
}).collect(Collectors.toList());
} }
@Override @Override

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/RepairBillVO.java

@ -12,6 +12,9 @@ import lombok.EqualsAndHashCode;
@Data @Data
public class RepairBillVO { public class RepairBillVO {
@ApiModelProperty("设备编码")
private String emCode;
@ApiModelProperty("设备名称") @ApiModelProperty("设备名称")
private String emName; private String emName;

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java

@ -166,6 +166,21 @@ public class WorkTicketFinish implements Serializable {
*/ */
private String otherItems; private String otherItems;
/**
* 工作终结负责人
*/
private String endPrincipalName;
/**
* 工作终结许可人
*/
private String endLicensorName;
/**
* 工作票终结许可人
*/
private String finishLicensorName;
} }

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -506,6 +506,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
workTicket.setProcessInstanceId(response.getProcessInstanceId()); workTicket.setProcessInstanceId(response.getProcessInstanceId());
this.saveWorkTicket(workTicket,response); this.saveWorkTicket(workTicket,response);
firstWorkTicketService.updateById(workTicket);
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
if(CollectionUtil.isNotEmpty(safetyMeasuresList)) { if(CollectionUtil.isNotEmpty(safetyMeasuresList)) {
workTicketSafetyMeasureService.saveOrUpdateBatch(safetyMeasuresList); workTicketSafetyMeasureService.saveOrUpdateBatch(safetyMeasuresList);
@ -1366,7 +1367,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket());
this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket());
// 开启工作流 // 开启工作流
String processInstanceId = this.startOfflineTicketProcess(workTicketVo); this.startOfflineTicketProcess(workTicketVo);
return workTicket.getId(); return workTicket.getId();
} }

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/WorkTicketInfoMapper.java

@ -67,7 +67,7 @@ public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper<WorkTicket
Page<WorkTicketInfoEntity> selectPages(Page<WorkTicketInfoEntity> pageEntity, Page<WorkTicketInfoEntity> selectPages(Page<WorkTicketInfoEntity> pageEntity,
@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper); @Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper);
List<WorkTicketBillVO> getWorkTicketBill(@Param("path") String path, @Param("startTime") String startTime, @Param("endTime") String endTime); List<WorkTicketBillVO> getWorkTicketBill(@Param("deviceCodes") List<String> deviceCodes, @Param("startTime") String startTime, @Param("endTime") String endTime);
@UserDataAuth @UserDataAuth
List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper); List<Map> selectTicketList(@Param(Constants.WRAPPER) QueryWrapper<WorkTicketInfoEntity> queryWrapper);

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/mapper/xml/WorkTicketInfoMapper.xml

@ -86,16 +86,18 @@
</select> </select>
<select id="getWorkTicketBill" resultType="com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO"> <select id="getWorkTicketBill" resultType="com.hnac.hzims.ticket.workTicket.vo.WorkTicketBillVO">
select em.`NAME` as emName,info.`type`,count(*) as payment, select info.em_code as emCode,info.`type`,count(*) as payment,
(select count(*) from hzims_work_ticket_info i where flow_description = '结束' and i.id = info.id) as finish, (select count(*) from hzims_work_ticket_info i where flow_description = '结束' and i.id = info.id) as finish,
(select count(*) from hzims_work_ticket_info i where flow_description = '作废' and i.id = info.id) as invalid, (select count(*) from hzims_work_ticket_info i where flow_description = '作废' and i.id = info.id) as invalid,
(select count(*) from hzims_ticket_info_evaluate e where evaluate = '合格!' and e.id = eval.id) as qualified (select count(*) from hzims_ticket_info_evaluate e where evaluate = '合格!' and e.id = eval.id) as qualified
from hzims_work_ticket_info info from hzims_work_ticket_info info
LEFT JOIN hzims_ticket_info_evaluate eval ON info.id = eval.ticket_id LEFT JOIN hzims_ticket_info_evaluate eval ON info.id = eval.ticket_i
LEFT JOIN `equipment`.hzims_em_info em ON info.em_code = em.NUMBER
<where> <where>
<if test="path != null"> <if test="deviceCodes != null">
em.path like CONCAT(#{path},'%') and info.em_code in
<foreach collection="deviceCodes" item="deviceCode" separator="," open="(" close=")" index="index">
#{deviceCode}
</foreach>
</if> </if>
<if test="startTime != null"> <if test="startTime != null">
and info.make_date_time &gt;= #{startTime} and info.make_date_time &gt;= #{startTime}

25
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -1127,14 +1127,23 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
@Override @Override
public List<WorkTicketBillVO> getWorkTicketBill(String emCode, String startTime, String endTime) { public List<WorkTicketBillVO> getWorkTicketBill(String emCode, String startTime, String endTime) {
R<EmInfoEntity> emInfoEntityR = emInfoClient.getEmInfoByEmCode(emCode); // 查询路径设备
if (emInfoEntityR.getCode() != 200 || Func.isEmpty(emInfoEntityR.getData())) { List<EmInfoEntity> devices = emInfoClient.deviceByPath(emCode);
throw new ServiceException("设备信息查询异常"); if(CollectionUtil.isEmpty(devices)){
} return new ArrayList<>();
EmInfoEntity emInfo = emInfoEntityR.getData(); }
List<WorkTicketBillVO> tickets = baseMapper.getWorkTicketBill(devices.stream().map(EmInfoEntity::getNumber).collect(Collectors.toList()), startTime, endTime);
List<WorkTicketBillVO> workTicketBillList = baseMapper.getWorkTicketBill(emInfo.getPath(), startTime, endTime); if(CollectionUtil.isEmpty(tickets)){
return workTicketBillList; return new ArrayList<>();
}
return tickets.stream().map(ticket->{
List<EmInfoEntity> repairDevice = devices.stream().filter(device->device.getNumber().equals(ticket.getEmCode())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(repairDevice)){
return ticket;
}
ticket.setEmName(repairDevice.get(0).getName());
return ticket;
}).collect(Collectors.toList());
} }

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/vo/WorkTicketBillVO.java

@ -10,6 +10,10 @@ import lombok.Data;
*/ */
@Data @Data
public class WorkTicketBillVO { public class WorkTicketBillVO {
@ApiModelProperty("设备编码")
private String emCode;
@ApiModelProperty("设备名称") @ApiModelProperty("设备名称")
private String emName; private String emName;

5
hzims-service/ticket/src/main/resources/db/2.0.1.sql

@ -0,0 +1,5 @@
alter table `hzims_work_ticket_finish` add column `end_principal_name` varchar(50) comment '工作终结负责人';
alter table `hzims_work_ticket_finish` add column `end_licensor_name` varchar(50) comment '工作终结许可人';
alter table `hzims_work_ticket_finish` add column `finish_licensor_name` varchar(50) comment '工作票终结许可人';
alter table `hzims_work_ticket_info` add column `is_offline` tinyint(2) default 0 comment '是否线下 : 1-线下,0-线上';

9
hzims-service/ticket/src/main/resources/file/线下工作票审批流程.bpmn20.xml

@ -4,6 +4,7 @@
<startEvent id="startEvent1"></startEvent> <startEvent id="startEvent1"></startEvent>
<userTask id="sid-194BD702-29AE-4DA6-A343-05464D12BB83" name="签发人签发" flowable:candidateGroups="signer"> <userTask id="sid-194BD702-29AE-4DA6-A343-05464D12BB83" name="签发人签发" flowable:candidateGroups="signer">
<extensionElements> <extensionElements>
<flowable:formProperty id="new_property_1" type="string" default="1"></flowable:formProperty>
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> <flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener>
</extensionElements> </extensionElements>
</userTask> </userTask>
@ -11,6 +12,7 @@
<exclusiveGateway id="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421"></exclusiveGateway> <exclusiveGateway id="sid-C055B0CF-183B-4BFF-B9CA-D5C420311421"></exclusiveGateway>
<userTask id="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" name="运行人员接收" flowable:candidateGroups="operatingCrew"> <userTask id="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" name="运行人员接收" flowable:candidateGroups="operatingCrew">
<extensionElements> <extensionElements>
<flowable:formProperty id="new_property_1" type="string" default="2"></flowable:formProperty>
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> <flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener>
</extensionElements> </extensionElements>
</userTask> </userTask>
@ -18,17 +20,20 @@
<sequenceFlow id="sid-2BD654BF-BFE4-481D-A710-185D10F7C413" sourceRef="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" targetRef="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF"></sequenceFlow> <sequenceFlow id="sid-2BD654BF-BFE4-481D-A710-185D10F7C413" sourceRef="sid-2CCB5862-1AB2-4327-9FBE-A11DC613B258" targetRef="sid-24261C82-08E4-4F0A-B069-5F2BB1E1ECEF"></sequenceFlow>
<userTask id="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" name="许可人许可" flowable:candidateGroups="licensor"> <userTask id="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" name="许可人许可" flowable:candidateGroups="licensor">
<extensionElements> <extensionElements>
<flowable:formProperty id="new_property_1" type="string" default="3"></flowable:formProperty>
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> <flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener>
</extensionElements> </extensionElements>
</userTask> </userTask>
<userTask id="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6" name="工作结束"> <userTask id="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6" name="工作结束" flowable:candidateGroups="licensor">
<extensionElements> <extensionElements>
<flowable:formProperty id="new_property_1" type="string" default="4"></flowable:formProperty>
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> <flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener>
</extensionElements> </extensionElements>
</userTask> </userTask>
<sequenceFlow id="sid-9FDA7FDD-A163-4496-B850-77C7A44C3F1F" sourceRef="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" targetRef="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6"></sequenceFlow> <sequenceFlow id="sid-9FDA7FDD-A163-4496-B850-77C7A44C3F1F" sourceRef="sid-33C2D3CB-1B69-4234-9AE9-3747F37BE8C5" targetRef="sid-1D70C4B2-A79B-4C02-AA30-9D755484C4B6"></sequenceFlow>
<userTask id="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A" name="工作票终结"> <userTask id="sid-7A6326EA-6129-47EF-88D1-0FC14033B25A" name="工作票终结" flowable:candidateGroups="licensor">
<extensionElements> <extensionElements>
<flowable:formProperty id="new_property_1" type="string" default="5"></flowable:formProperty>
<flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener> <flowable:taskListener event="create" class="org.springblade.flow.engine.listener.DynamicTaskUserListener"></flowable:taskListener>
</extensionElements> </extensionElements>
</userTask> </userTask>

Loading…
Cancel
Save