Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
yang_shj 4 months ago
parent
commit
fb0a77b92f
  1. 3
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpReceiveVO.java
  2. 8
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java
  3. 8
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java
  4. 2
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml
  5. 9
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/ISpAllocationService.java
  6. 5
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/ISpReceiveService.java
  7. 93
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
  8. 116
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java
  9. 42
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/utils/ExcelUtil.java
  10. 43
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/SpAllocationExportVO.java
  11. 36
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/SpReceiveExportVO.java
  12. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java
  13. 11
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/EventController.java
  14. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  15. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java
  16. 135
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java
  17. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/dto/WorkTicketInfoDto.java
  18. 13
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

3
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpReceiveVO.java

@ -42,6 +42,9 @@ public class SpReceiveVO extends SpReceiveEntity {
@ApiModelProperty(value = "结束时间")
private String endDate;
@ApiModelProperty(value = "领用人ID")
private Long userId;
private Long sign;
/**
* 备品备件列表

8
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpAllocationController.java

@ -23,6 +23,7 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@ -80,6 +81,13 @@ public class SpAllocationController extends BladeController {
return R.data(pages);
}
@GetMapping("/export")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "导出", notes = "传入sp_allocation")
public void export(SpAllocationVO allocationVO, HttpServletResponse response) {
sp_allocationService.export(allocationVO,response);
}
/**
* 新增 代码自定义代号
*/

8
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpReceiveController.java

@ -23,6 +23,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@ -67,6 +68,13 @@ public class SpReceiveController extends BladeController {
return R.data(pages);
}
@GetMapping("/export")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "导出", notes = "传入sp_receive")
public void export(HttpServletResponse response, SpReceiveVO receiveVO) {
sp_receiveService.export(response, receiveVO);
}
/**
* 新增 代码自定义代号
*/

2
hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml

@ -61,7 +61,7 @@
<if test="params.endDate!=null">
and wr.CREATE_TIME <![CDATA[ <= ]]> #{params.endDate}
</if>
<if test="params.deptList!=null">
<if test="params.deptList != null and params.deptList.size > 0">
and sw.AFFILIATED_UNIT in
<foreach collection="params.deptList" item="item" open="(" close=")" separator="," >
#{item}

9
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/ISpAllocationService.java

@ -6,6 +6,8 @@ import com.hnac.hzims.spare.entity.SpAllocationEntity;
import com.hnac.hzims.spare.vo.SpAllocationVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
/**
* 服务类
*
@ -34,6 +36,13 @@ public interface ISpAllocationService extends IService<SpAllocationEntity> {
IPage<SpAllocationVO> selectPageList(IPage<SpAllocationVO> page, SpAllocationVO allocationVO) ;
/**
* 搭配调拨单
* @param allocationVO 查询条件
* @param response 响应
*/
void export(SpAllocationVO allocationVO, HttpServletResponse response);
/**
* 修改状态
* @param bladeFlow
* @return

5
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/ISpReceiveService.java

@ -7,6 +7,8 @@ import com.hnac.hzims.spare.vo.SpReceiveVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
/**
* 服务类
*
@ -34,6 +36,9 @@ public interface ISpReceiveService extends IService<SpReceiveEntity> {
* @return
*/
IPage<SpReceiveVO> selectPageList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) ;
void export(HttpServletResponse response, SpReceiveVO receiveVO);
/**
* 修改状态
* @param bladeFlow

93
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java

@ -1,8 +1,11 @@
package com.hnac.hzims.spare.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.hnac.hzims.spare.chche.AssetsNumCache;
import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.enume.BusinessType;
@ -10,6 +13,8 @@ import com.hnac.hzims.spare.mapper.SpAllocationMapper;
import com.hnac.hzims.spare.mapper.SpRecordMapper;
import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper;
import com.hnac.hzims.spare.service.*;
import com.hnac.hzims.spare.utils.ExcelUtil;
import com.hnac.hzims.spare.vo.SpAllocationExportVO;
import com.hnac.hzims.spare.vo.SpAllocationVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
import lombok.AllArgsConstructor;
@ -21,23 +26,25 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDictBizClient;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* 服务实现类
@ -202,55 +209,47 @@ public class SpAllocationServiceImpl extends ServiceImpl<SpAllocationMapper, SpA
@Override
public IPage<SpAllocationVO> selectPageList(IPage<SpAllocationVO> page, SpAllocationVO allocationVO) {
return page.setRecords(this.selectList(page,allocationVO));
}
private List<SpAllocationVO> selectList(IPage<SpAllocationVO> page, SpAllocationVO allocationVO) {
Map<String,Object> params = new HashMap<>();
if(null !=allocationVO.getCode()){
params.put("code",allocationVO.getCode());
}
if(null !=allocationVO.getStatus()){
params.put("status",allocationVO.getStatus());
}
if(null !=allocationVO.getStartDate()){
params.put("startDate",allocationVO.getStartDate());
}
if(null !=allocationVO.getEndDate()){
params.put("endDate",allocationVO.getEndDate());
}
List<Long> longList = new ArrayList<>();
if(null!=allocationVO.getDeptId()){
R<List<Dept>> deptList = sysClient.getDeptChild(allocationVO.getDeptId());
for (int i = 0; i < deptList.getData().size(); i++) {
longList.add(deptList.getData().get(i).getId());
params.put("code",allocationVO.getCode());
params.put("status",allocationVO.getStatus());
params.put("startDate",allocationVO.getStartDate());
params.put("endDate",allocationVO.getEndDate());
if(Func.isNotEmpty(allocationVO.getDeptId())){
List<Long> deptIdList = new ArrayList<>();
deptIdList.add(allocationVO.getDeptId());
R<List<Dept>> deptListR = sysClient.getDeptChild(allocationVO.getDeptId());
if(deptListR.isSuccess() && CollectionUtil.isNotEmpty(deptListR.getData())) {
deptIdList.addAll(deptListR.getData().stream().map(Dept::getId).collect(Collectors.toList()));
}
longList.add(allocationVO.getDeptId());
}else{
// longList = personClient.getShuiChangId(AuthUtil.getDeptId());
}
if(longList.size()>0){
params.put("deptList",longList);
}
if(null!=allocationVO.getOutWarehouseId()){
params.put("outWarehouseId",allocationVO.getOutWarehouseId());
params.put("deptList", deptIdList);
}
params.put("outWarehouseId",allocationVO.getOutWarehouseId());
params.put("tenantId", AuthUtil.getTenantId());
List<SpAllocationVO> list = baseMapper.selectPageList(page,params);
List<SpAllocationVO> result = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
SpAllocationVO entity = list.get(i);
if(null!=entity.getCreateUser()){
R<User> user = userClient.userInfoById(entity.getCreateUser());
if(null!=user.getData()){
entity.setUserName(user.getData().getName());
}
}
WtSpWarehouseEntity inWarehouseEntity = warehouseMapper.selectById(entity.getInWarehouseId());
if(ObjectUtil.isNotEmpty(inWarehouseEntity)&&StringUtil.isNotBlank(inWarehouseEntity.getName())){
entity.setInWarehouseName(inWarehouseEntity.getName());
}else {
entity.setInWarehouseName("");
}
result.add(entity);
return list.stream().peek(this::fillWarehouseName).collect(Collectors.toList());
}
private void fillWarehouseName(SpAllocationVO entity) {
String userName = Optional.ofNullable(entity).map(SpAllocationVO::getCreateUser)
.map(UserCache::getUser).map(User::getName).orElse(null);
entity.setUserName(userName);
WtSpWarehouseEntity inWarehouseEntity = warehouseMapper.selectById(entity.getInWarehouseId());
if(ObjectUtil.isNotEmpty(inWarehouseEntity)&&StringUtil.isNotBlank(inWarehouseEntity.getName())){
entity.setInWarehouseName(inWarehouseEntity.getName());
}else {
entity.setInWarehouseName("");
}
return page.setRecords(result);
}
@Override
public void export(SpAllocationVO allocationVO, HttpServletResponse response) {
List<SpAllocationVO> allocationList = this.selectList(null, allocationVO);
List<SpAllocationExportVO> data = JSONArray.parseArray(JSON.toJSONString(allocationList), SpAllocationExportVO.class);
ExcelUtil.export(response, SpAllocationExportVO.class, data, "调拨单报表", "调拨单");
}
public synchronized boolean updateStatus(SpAllocationEntity allocationEntity) {

116
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java

@ -1,5 +1,7 @@
package com.hnac.hzims.spare.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -11,8 +13,10 @@ import com.hnac.hzims.spare.mapper.SpReceiveMapper;
import com.hnac.hzims.spare.mapper.SpRecordMapper;
import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper;
import com.hnac.hzims.spare.service.*;
import com.hnac.hzims.spare.utils.ExcelUtil;
import com.hnac.hzims.spare.vo.SpReceiveVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.spare.vo.SpReceiveExportVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -23,6 +27,7 @@ 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.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDictBizClient;
@ -33,9 +38,11 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 服务实现类
@ -191,76 +198,57 @@ public class SpReceiveServiceImpl extends ServiceImpl<SpReceiveMapper, SpReceive
@Override
public IPage<SpReceiveVO> selectPageList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) {
return page.setRecords(this.selectList(page,receiveVO));
}
private List<SpReceiveVO> selectList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) {
Map<String,Object> params = new HashMap<>();
if(null !=receiveVO.getCode()){
params.put("code",receiveVO.getCode());
}
if(null !=receiveVO.getStatus()){
params.put("status",receiveVO.getStatus());
}
if(null !=receiveVO.getStartDate()){
params.put("startDate",receiveVO.getStartDate());
}
if(null !=receiveVO.getEndDate()){
params.put("endDate",receiveVO.getEndDate());
}
List<Long> longList = new ArrayList<>();
if(null!=receiveVO.getDeptId()){
R<List<Dept>> deptList = sysClient.getDeptChild(receiveVO.getDeptId());
for (int i = 0; i < deptList.getData().size(); i++) {
longList.add(deptList.getData().get(i).getId());
}
longList.add(receiveVO.getDeptId());
}else{
// longList = personClient.getShuiChangId(AuthUtil.getDeptId());
}
if(longList.size()>0){
params.put("deptList",longList);
}
if(null!=receiveVO.getStorageRoom()){
params.put("warehouseId",receiveVO.getStorageRoom());
}
List<SpReceiveVO> result = new ArrayList<>();
BladeUser bladeUser = AuthUtil.getUser();
if(null!=receiveVO.getUserName()){
R<User> user = userClient.userByAccount(bladeUser.getTenantId(),receiveVO.getUserName());
if(null!=user){
if(null!=user.getData()){
params.put("createUser",user.getData().getId());
}else{
return page.setRecords(result);
}
params.put("code",receiveVO.getCode());
params.put("status",receiveVO.getStatus());
params.put("startDate",receiveVO.getStartDate());
params.put("endDate",receiveVO.getEndDate());
List<Long> deptIdList = new ArrayList<>();
if(Func.isNotEmpty(receiveVO.getDeptId())) {
deptIdList.add(receiveVO.getDeptId());
R<List<Dept>> deptListR = sysClient.getDeptChild(receiveVO.getDeptId());
if(deptListR.isSuccess() && CollectionUtil.isNotEmpty(deptListR.getData())) {
deptIdList.addAll(deptListR.getData().stream().map(Dept::getId).collect(Collectors.toList()));
}
}
params.put("deptList",deptIdList);
params.put("warehouseId",receiveVO.getStorageRoom());
params.put("createUser",receiveVO.getUserId());
params.put("tenantId", AuthUtil.getTenantId());
List<SpReceiveVO> list = baseMapper.selectPageList(page,params);
for (int i = 0; i < list.size(); i++) {
SpReceiveVO entity = list.get(i);
if(null!=entity.getCreateUser()){
R<User> user = userClient.userInfoById(entity.getCreateUser());
if(null!=user.getData()){
entity.setUserName(user.getData().getName());
}
}
List<SpReceivesEntity> k=new ArrayList<>();
QueryWrapper<SpReceivesEntity> queryWrapper = new QueryWrapper();
queryWrapper.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId());
queryWrapper.lambda().eq(SpReceivesEntity::getStatus,1);
List<SpReceivesEntity> byId = iSpReceivesService.list(queryWrapper);
k.addAll(byId);
QueryWrapper<SpReceivesEntity> queryWrappers = new QueryWrapper();
queryWrappers.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId());
queryWrappers.lambda().eq(SpReceivesEntity::getStatus,3);
List<SpReceivesEntity> id = iSpReceivesService.list(queryWrappers);
k.addAll(id);
if (null==k||0==k.size()){
entity.setSign(2L);
}else {
entity.setSign(1L);
}
result.add(entity);
return list.stream().peek(this::fillDetail).collect(Collectors.toList());
}
private void fillDetail(SpReceiveVO entity) {
String userName = Optional.ofNullable(entity.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null);
entity.setUserName(userName);
List<SpReceivesEntity> k=new ArrayList<>();
QueryWrapper<SpReceivesEntity> queryWrapper = new QueryWrapper();
queryWrapper.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId());
queryWrapper.lambda().eq(SpReceivesEntity::getStatus,1);
List<SpReceivesEntity> byId = iSpReceivesService.list(queryWrapper);
k.addAll(byId);
QueryWrapper<SpReceivesEntity> queryWrappers = new QueryWrapper();
queryWrappers.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId());
queryWrappers.lambda().eq(SpReceivesEntity::getStatus,3);
List<SpReceivesEntity> id = iSpReceivesService.list(queryWrappers);
k.addAll(id);
if (null==k||0==k.size()){
entity.setSign(2L);
}else {
entity.setSign(1L);
}
return page.setRecords(result);
}
@Override
public void export(HttpServletResponse response, SpReceiveVO receiveVO) {
List<SpReceiveVO> spReceiveVOS = this.selectList(null, receiveVO);
List<SpReceiveExportVO> data = JSONArray.parseArray(JSON.toJSONString(spReceiveVOS), SpReceiveExportVO.class);
ExcelUtil.export(response,SpReceiveExportVO.class,data,"工具领用报表","工具领用");
}
public synchronized boolean updateStatus(SpReceiveEntity receiveEntity) {

42
hzims-service/assets/src/main/java/com/hnac/hzims/spare/utils/ExcelUtil.java

@ -4,10 +4,18 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.write.handler.WriteHandler;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.hnac.hzims.spare.vo.WtSpToolBasicExportVO;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.BorderStyle;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -343,5 +351,37 @@ public class ExcelUtil {
EasyExcel.write(filePath, headClazz).excludeColumnFiledNames(excludeCols).sheet(sheetNo, sheetName).doWrite(data);
}
/**
* 导出excel模板
* @param response
* @param clazz 导出对象class
* @param data 导出数据
* @param fileName 文件名
* @param sheetName sheet名称
* @param <T> 数据泛型类
*/
public static <T> void export(HttpServletResponse response, Class<T> clazz, List<T> data, String fileName, String sheetName) {
try {
fileName = URLEncoder.encode(fileName, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
contentWriteCellStyle.setWrapped(true);
try {
EasyExcel.write(response.getOutputStream(), clazz)
.registerWriteHandler(new HorizontalCellStyleStrategy(new WriteCellStyle(), contentWriteCellStyle))
.autoCloseStream(Boolean.FALSE).sheet(sheetName)
.doWrite(data);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

43
hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/SpAllocationExportVO.java

@ -0,0 +1,43 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Author: huangxing
* @Date: 2024/08/06 14:21
*/
@Data
@EqualsAndHashCode
public class SpAllocationExportVO implements Serializable {
@ExcelProperty(value = "单据编码",index = 0)
@ColumnWidth(25)
private String code;
@ExcelProperty(value = "拨入库房",index = 1)
@ColumnWidth(20)
private String inWarehouseName;
@ExcelProperty(value = "拨出库房",index = 2)
@ColumnWidth(20)
private String outWarehouseName;
@ExcelProperty(value = "申请人",index = 3)
@ColumnWidth(20)
private String userName;
@ExcelProperty(value = "制单时间",index = 4, format = DateUtil.PATTERN_DATETIME)
@ColumnWidth(25)
private Date createTime;
}

36
hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/SpReceiveExportVO.java

@ -0,0 +1,36 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tool.utils.DateUtil;
import java.io.Serializable;
import java.util.Date;
/**
* @Author: huangxing
* @Date: 2024/08/06 18:58
*/
@Data
@EqualsAndHashCode
public class SpReceiveExportVO implements Serializable {
@ExcelProperty(value = "单据编码",index = 0)
@ColumnWidth(30)
private String code;
@ExcelProperty(value = "出库库房",index = 1)
@ColumnWidth(30)
private String warehouseName;
@ExcelProperty(value = "领用人",index = 2)
@ColumnWidth(20)
private String userName;
@ExcelProperty(value = "领用时间",index = 3, format = DateUtil.PATTERN_DATETIME)
@ColumnWidth(30)
private Date createTime;
}

14
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java

@ -39,18 +39,18 @@ public class RealTimeDataServerImpl implements RealTimeDataServer {
@Override
public R<List<FieldsData>> getData(RealDataSearchPO po) {
R<List<FieldsData>> res = analyseDataSearchClient.getRealDataByAnalyzeCode(po);
String msg = res.getMsg();
if ("操作成功".equals(msg)) {
if(res.isSuccess()) {
R<List<FieldsData>> realDataResult = analyseDataSearchClient.getRealDataByAnalyzeCode(po);
List<FieldsData> data = Lists.newArrayList();
if(realDataResult.isSuccess()) {
data.addAll(realDataResult.getData());
return R.data(realDataResult.getData());
}
if (CollectionUtil.isNotEmpty(data)) {
return R.data(data);
else {
return R.data(Lists.newArrayList());
}
}
return R.fail(msg);
else {
return R.data(Lists.newArrayList());
}
}
@Override

11
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/EventController.java

@ -135,9 +135,14 @@ public class EventController{
typeSmall = dictBizClient.getValue(detail.getTypeBig(),detail.getTypeSmall()).getData();
}
String problemStatus = "待处理";
R<String> result = flowClient.queryProcessInstanceStatus(detail.getProcessInstanceId());
if(result.isSuccess()){
problemStatus = ProcessConstant.ProcessInstanceStatusEnum.over.name().equals(result.getData())?"已处理":"处理中";
if(StringUtil.isNotBlank(detail.getProcessInstanceId())) {
R<String> result = flowClient.queryProcessInstanceStatus(detail.getProcessInstanceId());
if(result.isSuccess()){
problemStatus = ProcessConstant.ProcessInstanceStatusEnum.over.name().equals(result.getData())?"已处理":"处理中";
}
}
else {
problemStatus = "-";
}
v.setProblem(ProblemVO.builder().problemStatus(problemStatus).typeBig(typeBig).typeSmall(typeSmall).problemDetail(detail.getDescription()).build());
}

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

@ -1125,25 +1125,35 @@ public class ImsDutyMainServiceImpl extends ServiceImpl<ImsDutyMainMapper, ImsDu
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(collect)){
continue;
}
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(handerCollect)){
continue;
}
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
}else {
//交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(collect)){
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
}
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(handerCollect)){
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
}
}
}
}
@ -1152,25 +1162,35 @@ public class ImsDutyMainServiceImpl extends ServiceImpl<ImsDutyMainMapper, ImsDu
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(collect)){
continue;
}
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(handerCollect)){
continue;
}
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1);
}else {
//交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList());
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1);
if(CollectionUtil.isNotEmpty(collect)) {
List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts() + 1);
}
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList());
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1);
if(CollectionUtil.isNotEmpty(handerCollect)) {
List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts() + 1);
}
}
}
}

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

@ -368,7 +368,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
String powerTitle = deptName + "水电运维项目各电站发电量环比对比图(万kWh)";
String powerDomainAxis = "发电量";
String powerRangeAxis = "站点名称";
ImageEntity powerChainHistogram = JFreeUtil.iCreateBarChart(powerTitle, powerDomainAxis, powerRangeAxis, powerDataset, 500, 400);
ImageEntity powerChainHistogram = JFreeUtil.iCreateBarChart(powerTitle, powerDomainAxis, powerRangeAxis, powerDataset, 500, 500);
map.put("powerChainHistogram", powerChainHistogram);
//柱状图下添加的表格
ArrayList<HashMap<String, String>> powerMap = new ArrayList<>(powerPercentageVoList.size());

135
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/MonthReportServiceImpl.java

@ -34,69 +34,80 @@ import java.util.List;
@Slf4j
public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperMonthReportEntity> implements IMonthReportService {
private final IOperPersonalMonthReportService operPersonalMonthReportService;
private final IOperStationMonthReportService operStationMonthReportService;
private final ISysClient sysClient;
private final IOperPersonalMonthReportService operPersonalMonthReportService;
private final IOperStationMonthReportService operStationMonthReportService;
private final ISysClient sysClient;
@Override
public StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception {
StationRunReportAllVO stationReportAllVO = new StationRunReportAllVO();
Dept dept = sysClient.getDept(deptId).getData();
OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>(){{
eq(OperMonthReportEntity::getMonth,month);
eq(OperMonthReportEntity::getStationCode, dept.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
orderByDesc(OperMonthReportEntity::getObject);
last("limit 1;");
}});
//查询实时数据
if(ObjectUtil.isEmpty(operMonthReportEntity)){
stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
}
//历史查询定时任务生成的数据
else{
stationReportAllVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (StationRunReportAllVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject())
: operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
}
return stationReportAllVO;
}
@Override
public StationRunReportAllVO getStationMonthReportByStationCode(Long deptId, String month) throws Exception {
StationRunReportAllVO stationReportAllVO = new StationRunReportAllVO();
Dept dept = sysClient.getDept(deptId).getData();
OperMonthReportEntity operMonthReportEntity = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>() {{
eq(OperMonthReportEntity::getMonth, month);
eq(OperMonthReportEntity::getStationCode, dept.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
orderByDesc(OperMonthReportEntity::getCreateTime);
last("limit 1;");
}});
//查询实时数据
if (ObjectUtil.isEmpty(operMonthReportEntity)) {
stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
if (ObjectUtil.isNotEmpty(stationReportAllVO)) {
OperMonthReportEntity saved = new OperMonthReportEntity();
saved.setMonth(month);
saved.setType(DictConstant.MONTH_REPORT_STATION);
saved.setCreateDept(deptId);
saved.setStationCode(deptId.toString());
try {
saved.setObject(ObjectHelper.obj2byte(stationReportAllVO));
} catch (IOException e) {
log.error("生成统计月报失败{}", e.toString());
e.printStackTrace();
}
//修改为每运行一次,保存一次
this.save(operMonthReportEntity);
}
}
//历史查询定时任务生成的数据
else {
stationReportAllVO = ObjectUtil.isNotEmpty(operMonthReportEntity) ? (StationRunReportAllVO) ObjectHelper.byte2obj(operMonthReportEntity.getObject())
: operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class));
}
return stationReportAllVO;
}
@Override
public void setStationMonthReportByStationCode(Long deptId, String month){
Dept deptVO = sysClient.getDept(deptId).getData();
log.info("---{}机构---",deptVO.getDeptName());
//查询该电站该月报是否已生成月报
OperMonthReportEntity operMonthReportEntityByMonth = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>() {{
eq(OperMonthReportEntity::getMonth, month);
eq(OperMonthReportEntity::getType, DictConstant.MONTH_REPORT_STATION);
eq(OperMonthReportEntity::getStationCode, deptVO.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
last("limit 1;");
}});
if (ObjectUtil.isEmpty(operMonthReportEntityByMonth)||month.equals(YearMonth.now().toString())) {
if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)){
this.removeById(operMonthReportEntityByMonth.getId());
}
//按站点生成各电站运维月报
StationRunReportAllVO stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(deptVO, DeptVO.class));
if (ObjectUtil.isNotEmpty(stationReportAllVO)) {
OperMonthReportEntity operMonthReportEntity = new OperMonthReportEntity();
operMonthReportEntity.setMonth(month);
operMonthReportEntity.setType(DictConstant.MONTH_REPORT_STATION);
operMonthReportEntity.setCreateDept(deptVO.getId());
operMonthReportEntity.setStationCode(deptVO.getId().toString());
try {
operMonthReportEntity.setObject(ObjectHelper.obj2byte(stationReportAllVO));
} catch (IOException e) {
e.printStackTrace();
}
//修改为每运行一次,保存一次
this.save(operMonthReportEntity);
}
} else {
log.info("该月{}已生成月报", deptVO.getDeptName());
}
}
@Override
public void setStationMonthReportByStationCode(Long deptId, String month) {
Dept deptVO = sysClient.getDept(deptId).getData();
log.info("---{}机构---", deptVO.getDeptName());
//查询该电站该月报是否已生成月报
OperMonthReportEntity operMonthReportEntityByMonth = this.getOne(new LambdaQueryWrapper<OperMonthReportEntity>() {{
eq(OperMonthReportEntity::getMonth, month);
eq(OperMonthReportEntity::getType, DictConstant.MONTH_REPORT_STATION);
eq(OperMonthReportEntity::getStationCode, deptVO.getId());
eq(OperMonthReportEntity::getIsDeleted, 0);
last("limit 1;");
}});
if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)) {
this.removeById(operMonthReportEntityByMonth.getId());
}
//按站点生成各电站运维月报
StationRunReportAllVO stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(deptVO, DeptVO.class));
if (ObjectUtil.isNotEmpty(stationReportAllVO)) {
OperMonthReportEntity operMonthReportEntity = new OperMonthReportEntity();
operMonthReportEntity.setMonth(month);
operMonthReportEntity.setType(DictConstant.MONTH_REPORT_STATION);
operMonthReportEntity.setCreateDept(deptVO.getId());
operMonthReportEntity.setStationCode(deptVO.getId().toString());
try {
operMonthReportEntity.setObject(ObjectHelper.obj2byte(stationReportAllVO));
} catch (IOException e) {
log.error("生成统计月报失败{}", e.toString());
e.printStackTrace();
}
//修改为每运行一次,保存一次
this.save(operMonthReportEntity);
}
}
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/dto/WorkTicketInfoDto.java

@ -64,4 +64,7 @@ public class WorkTicketInfoDto extends WorkTicketInfoEntity implements Serializa
@ApiModelProperty("创建人")
private String createUserName;
@ApiModelProperty("站点机构ID")
private Long stationDeptId;
}

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

@ -62,6 +62,9 @@ import org.springblade.flow.core.entity.BladeFlow;
import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDeptClient;
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;
@ -114,6 +117,7 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
private final WorkTicketFinishServiceImpl workTicketFinishService;
private final TicketInfoDangerService ticketInfoDangerService;
private final IEmInfoClient emInfoClient;
private final ISysClient sysClient;
/**
* 生成两票编号锁
@ -264,6 +268,15 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
if (StringUtils.isNotEmpty(req.getEndTime())) {
lqw.le(WorkTicketInfoEntity::getCreateTime, req.getEndTime());
}
if (Func.isNotEmpty(req.getStationDeptId())) {
R<Dept> deptR = sysClient.getDept(req.getStationDeptId());
if(deptR.isSuccess() && Func.isNotEmpty(deptR.getData()) && Func.isNotEmpty(deptR.getData().getStationId())) {
lqw.eq(WorkTicketInfoEntity::getSignage,deptR.getData().getStationId());
}
else {
lqw.eq(WorkTicketInfoEntity::getCreateDept,req.getStationDeptId());
}
}
lqw.orderByDesc(WorkTicketInfoEntity::getCreateTime).orderByDesc(WorkTicketInfoEntity::getUpdateTime);
IPage<WorkTicketInfoEntity> pages = this.page(Condition.getPage(query), lqw);
//数据转换

Loading…
Cancel
Save