Browse Source

#设备扫码

zhongwei
yang_shj 3 months ago
parent
commit
cacaa55c73
  1. 19
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/AccessDeviceVO.java
  2. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  3. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.java
  4. 12
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml
  5. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java
  6. 10
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  7. 18
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

19
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/vo/AccessDeviceVO.java

@ -0,0 +1,19 @@
package com.hnac.hzims.equipment.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("设备树信息")
public class AccessDeviceVO {
@ApiModelProperty("设备编号")
private String deviceCode;
@ApiModelProperty("设备名称")
private String deviceName;
@ApiModelProperty("设备地址")
private String address;
}

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

@ -474,4 +474,11 @@ public class EmInfoController extends BladeController {
public R<List<EmInfoTreeVO>> getEmInfoTree(EmInfoEntity req) {
return R.data(em_infoService.getEmInfoTree(req));
}
@GetMapping("/accessDevices")
@ApiOperationSupport(order = 15)
@ApiOperation(value = "检修工作票设备查询")
public R<List<AccessDeviceVO>> accessDevices(@RequestParam(value = "alias",required = false) String alias) {
return R.data(em_infoService.accessDevices(alias));
}
}

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

@ -2,10 +2,7 @@ package com.hnac.hzims.equipment.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.vo.EmInfoExtendVo;
import com.hnac.hzims.equipment.vo.DeviceVO;
import com.hnac.hzims.equipment.vo.EmInfoTreeVO;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.equipment.vo.*;
import com.hnac.hzims.spare.vo.SparePartVO;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
@ -59,4 +56,6 @@ public interface EmInfoMapper extends UserDataScopeBaseMapper<EmInfoEntity> {
List<EmInfoTreeVO> getEmInfoTree(@Param("ew") Wrapper ew);
List<EmInfoEntity> getAllEmInfo();
List<AccessDeviceVO> accessDevices(@Param("alias") String alias);
}

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

@ -177,4 +177,16 @@
<select id="getAllEmInfo" resultType="com.hnac.hzims.equipment.entity.EmInfoEntity">
select * from `hzims_em_info` where `is_deleted` = 0
</select>
<select id="accessDevices" resultType="com.hnac.hzims.equipment.vo.AccessDeviceVO">
select info.number AS deviceCode,info.name AS deviceName,info.INS_LOCATION AS address
FROM HZIMS_EM_INFO info
LEFT JOIN HZIMS_EM_OREANIZATION ore ON info.REF_OREANIZATION = ore.id
<where>
info.IS_DELETED = 0
<if test="alias != null and alias != '' ">
AND (info.NAME LIKE CONCAT('%',#{alias},'%') or ore.NAME LIKE CONCAT('%',#{alias},'%') )
</if>
</where>
</select>
</mapper>

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

@ -105,4 +105,6 @@ public interface IEmInfoService extends IService<EmInfoEntity> {
List<StationEmInfoVO> getStationEmList();
List<DeviceLedgerVO> getDeviceLedgerList(String emCode,String date);
List<AccessDeviceVO> accessDevices(String alias);
}

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

@ -1061,6 +1061,16 @@ public class EmInfoServiceImpl extends ServiceImpl<EmInfoMapper, EmInfoEntity> i
}
/**
* 查询检修工作票-设备
* @param alias
* @return
*/
@Override
public List<AccessDeviceVO> accessDevices(String alias) {
return this.baseMapper.accessDevices(alias);
}
/**
* 根据设备编号获取设备台账列表
* @param emInfo 设备实体类
* @param date 查询日期

18
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

@ -42,6 +42,7 @@ import org.springblade.message.fegin.IMessageClient;
import org.springblade.system.cache.DictCache;
import org.springblade.system.entity.Dict;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
@ -178,7 +179,7 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
if(!"流程结束".equals(entity.getTaskName())){
String countent = "您有一条检修报单流程待处理!单据名称:".concat(DateUtil.format(entity.getCreateTime(),DateUtil.PATTERN_DATETIME) + "_" + entity.getDeviceName() + "_检修工作票")
.concat(",当前环节:")
.concat(processWorkFlowResponse.getTaskName());;
.concat(processWorkFlowResponse.getTaskName());
this.sendMessage(entity,processWorkFlowResponse.getUserId(),countent);
}
return this.updateById(entity);
@ -251,7 +252,7 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
private boolean start(AccessTicketEntity entity) {
Map<String, Object> variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(entity,DateUtil.PATTERN_DATETIME), Map.class);
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(AccessTicketConstants.ACCESS_TICKET_PROCESS_KEY,
StringUtil.format("{}:{}",AccessTicketConstants.ACCESS_TICKET_TABLE, entity.getId()), entity.getCreateTime() +"_" + entity.getDeviceName() + "_检修工作票", variables);
StringUtil.format("{}:{}",AccessTicketConstants.ACCESS_TICKET_TABLE, entity.getId()), DateUtil.format(entity.getCreateTime(),DateUtil.PATTERN_DATETIME) +"_" + entity.getDeviceName() + "_检修工作票", variables);
log.info("access_ticket : start_process_result _ {}",result);
// 更新任务流程Id
if (!result.isSuccess() || 200 != result.getCode()) {
@ -376,7 +377,18 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
if(StringUtils.isNotEmpty(access.getStudyMembers())){
String[] members = access.getStudyMembers().split(",");
params.setAccessCount(members.length);
params.setStudyMembers(access.getStudyMembers());
StringBuilder meberNames = new StringBuilder();
for(int i = 0 ; i < members.length; i++){
User user = UserCache.getUser(Long.valueOf(members[i]));
if(ObjectUtil.isNotEmpty(user)){
if(i == members.length -1){
meberNames.append(user.getRealName());
}else{
meberNames.append(user.getRealName()).append(",");
}
}
}
params.setStudyMembers(meberNames.toString());
}
// 检修工作票创建时间
Calendar create = Calendar.getInstance();

Loading…
Cancel
Save