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. 69
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
  8. 72
      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. 5
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/EventController.java
  14. 20
      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. 23
      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 = "结束时间") @ApiModelProperty(value = "结束时间")
private String endDate; private String endDate;
@ApiModelProperty(value = "领用人ID")
private Long userId;
private Long sign; 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 org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
@ -80,6 +81,13 @@ public class SpAllocationController extends BladeController {
return R.data(pages); 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.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
@ -67,6 +68,13 @@ public class SpReceiveController extends BladeController {
return R.data(pages); 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"> <if test="params.endDate!=null">
and wr.CREATE_TIME <![CDATA[ <= ]]> #{params.endDate} and wr.CREATE_TIME <![CDATA[ <= ]]> #{params.endDate}
</if> </if>
<if test="params.deptList!=null"> <if test="params.deptList != null and params.deptList.size > 0">
and sw.AFFILIATED_UNIT in and sw.AFFILIATED_UNIT in
<foreach collection="params.deptList" item="item" open="(" close=")" separator="," > <foreach collection="params.deptList" item="item" open="(" close=")" separator="," >
#{item} #{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 com.hnac.hzims.spare.vo.SpAllocationVO;
import org.springblade.core.mp.support.Query; 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) ; IPage<SpAllocationVO> selectPageList(IPage<SpAllocationVO> page, SpAllocationVO allocationVO) ;
/** /**
* 搭配调拨单
* @param allocationVO 查询条件
* @param response 响应
*/
void export(SpAllocationVO allocationVO, HttpServletResponse response);
/**
* 修改状态 * 修改状态
* @param bladeFlow * @param bladeFlow
* @return * @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 org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
/** /**
* 服务类 * 服务类
* *
@ -34,6 +36,9 @@ public interface ISpReceiveService extends IService<SpReceiveEntity> {
* @return * @return
*/ */
IPage<SpReceiveVO> selectPageList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) ; IPage<SpReceiveVO> selectPageList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) ;
void export(HttpServletResponse response, SpReceiveVO receiveVO);
/** /**
* 修改状态 * 修改状态
* @param bladeFlow * @param bladeFlow

69
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; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.chche.AssetsNumCache;
import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.enume.BusinessType; 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.SpRecordMapper;
import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper; import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper;
import com.hnac.hzims.spare.service.*; 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.SpAllocationVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import lombok.AllArgsConstructor; 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.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDictBizClient; import org.springblade.system.feign.IDictBizClient;
import org.springblade.system.feign.ISysClient; 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.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* 服务实现类 * 服务实现类
@ -202,55 +209,47 @@ public class SpAllocationServiceImpl extends ServiceImpl<SpAllocationMapper, SpA
@Override @Override
public IPage<SpAllocationVO> selectPageList(IPage<SpAllocationVO> page, SpAllocationVO allocationVO) { 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<>(); Map<String,Object> params = new HashMap<>();
if(null !=allocationVO.getCode()){
params.put("code",allocationVO.getCode()); params.put("code",allocationVO.getCode());
}
if(null !=allocationVO.getStatus()){
params.put("status",allocationVO.getStatus()); params.put("status",allocationVO.getStatus());
}
if(null !=allocationVO.getStartDate()){
params.put("startDate",allocationVO.getStartDate()); params.put("startDate",allocationVO.getStartDate());
}
if(null !=allocationVO.getEndDate()){
params.put("endDate",allocationVO.getEndDate()); 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()));
} }
List<Long> longList = new ArrayList<>(); params.put("deptList", deptIdList);
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());
} }
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("outWarehouseId",allocationVO.getOutWarehouseId());
}
params.put("tenantId", AuthUtil.getTenantId()); params.put("tenantId", AuthUtil.getTenantId());
List<SpAllocationVO> list = baseMapper.selectPageList(page,params); List<SpAllocationVO> list = baseMapper.selectPageList(page,params);
List<SpAllocationVO> result = new ArrayList<>(); return list.stream().peek(this::fillWarehouseName).collect(Collectors.toList());
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());
}
} }
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()); WtSpWarehouseEntity inWarehouseEntity = warehouseMapper.selectById(entity.getInWarehouseId());
if(ObjectUtil.isNotEmpty(inWarehouseEntity)&&StringUtil.isNotBlank(inWarehouseEntity.getName())){ if(ObjectUtil.isNotEmpty(inWarehouseEntity)&&StringUtil.isNotBlank(inWarehouseEntity.getName())){
entity.setInWarehouseName(inWarehouseEntity.getName()); entity.setInWarehouseName(inWarehouseEntity.getName());
}else { }else {
entity.setInWarehouseName(""); entity.setInWarehouseName("");
} }
result.add(entity);
} }
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) { public synchronized boolean updateStatus(SpAllocationEntity allocationEntity) {

72
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; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.SpRecordMapper;
import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper; import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper;
import com.hnac.hzims.spare.service.*; 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.SpReceiveVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO; import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.spare.vo.SpReceiveExportVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Dept; import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDictBizClient; 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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
@ -191,57 +198,34 @@ public class SpReceiveServiceImpl extends ServiceImpl<SpReceiveMapper, SpReceive
@Override @Override
public IPage<SpReceiveVO> selectPageList(IPage<SpReceiveVO> page, SpReceiveVO receiveVO) { 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<>(); Map<String,Object> params = new HashMap<>();
if(null !=receiveVO.getCode()){
params.put("code",receiveVO.getCode()); params.put("code",receiveVO.getCode());
}
if(null !=receiveVO.getStatus()){
params.put("status",receiveVO.getStatus()); params.put("status",receiveVO.getStatus());
}
if(null !=receiveVO.getStartDate()){
params.put("startDate",receiveVO.getStartDate()); params.put("startDate",receiveVO.getStartDate());
}
if(null !=receiveVO.getEndDate()){
params.put("endDate",receiveVO.getEndDate()); 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()));
} }
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()); params.put("deptList",deptIdList);
}else{
// longList = personClient.getShuiChangId(AuthUtil.getDeptId());
}
if(longList.size()>0){
params.put("deptList",longList);
}
if(null!=receiveVO.getStorageRoom()){
params.put("warehouseId",receiveVO.getStorageRoom()); params.put("warehouseId",receiveVO.getStorageRoom());
} params.put("createUser",receiveVO.getUserId());
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("tenantId", AuthUtil.getTenantId()); params.put("tenantId", AuthUtil.getTenantId());
List<SpReceiveVO> list = baseMapper.selectPageList(page,params); List<SpReceiveVO> list = baseMapper.selectPageList(page,params);
for (int i = 0; i < list.size(); i++) { return list.stream().peek(this::fillDetail).collect(Collectors.toList());
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());
}
} }
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<>(); List<SpReceivesEntity> k=new ArrayList<>();
QueryWrapper<SpReceivesEntity> queryWrapper = new QueryWrapper(); QueryWrapper<SpReceivesEntity> queryWrapper = new QueryWrapper();
queryWrapper.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId()); queryWrapper.lambda().eq(SpReceivesEntity::getVeceiveId,entity.getId());
@ -258,9 +242,13 @@ public class SpReceiveServiceImpl extends ServiceImpl<SpReceiveMapper, SpReceive
}else { }else {
entity.setSign(1L); entity.setSign(1L);
} }
result.add(entity);
} }
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) { 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.EasyExcelFactory;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.write.handler.WriteHandler; 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.formula.functions.T;
import org.apache.poi.ss.usermodel.BorderStyle;
import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -343,5 +351,37 @@ public class ExcelUtil {
EasyExcel.write(filePath, headClazz).excludeColumnFiledNames(excludeCols).sheet(sheetNo, sheetName).doWrite(data); 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 @Override
public R<List<FieldsData>> getData(RealDataSearchPO po) { public R<List<FieldsData>> getData(RealDataSearchPO po) {
R<List<FieldsData>> res = analyseDataSearchClient.getRealDataByAnalyzeCode(po); R<List<FieldsData>> res = analyseDataSearchClient.getRealDataByAnalyzeCode(po);
String msg = res.getMsg(); if(res.isSuccess()) {
if ("操作成功".equals(msg)) {
R<List<FieldsData>> realDataResult = analyseDataSearchClient.getRealDataByAnalyzeCode(po); R<List<FieldsData>> realDataResult = analyseDataSearchClient.getRealDataByAnalyzeCode(po);
List<FieldsData> data = Lists.newArrayList();
if(realDataResult.isSuccess()) { if(realDataResult.isSuccess()) {
data.addAll(realDataResult.getData()); return R.data(realDataResult.getData());
}
else {
return R.data(Lists.newArrayList());
} }
if (CollectionUtil.isNotEmpty(data)) {
return R.data(data);
} }
else {
return R.data(Lists.newArrayList());
} }
return R.fail(msg);
} }
@Override @Override

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

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

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

@ -1125,49 +1125,68 @@ public class ImsDutyMainServiceImpl extends ServiceImpl<ImsDutyMainMapper, ImsDu
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){ if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1 //如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0); DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1); troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) { }else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1 //如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0); DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1); handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
}else { }else {
//交接班延迟,交接班组都+1 //交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0); DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1); troubleRunReport.setDelayChangeShifts(troubleRunReport.getDelayChangeShifts()+1);
}
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0); DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1); handerRunRepor.setDelayChangeShifts(handerRunRepor.getDelayChangeShifts()+1);
} }
} }
} }
}
if (CollectionUtil.isNotEmpty(exceptionList)) { if (CollectionUtil.isNotEmpty(exceptionList)) {
for (ImsDutyRecEntity rec : exceptionList) { for (ImsDutyRecEntity rec : exceptionList) {
if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){ if (rec.getDelayStatus().equals(CARRY_DELAY_STATUS.getStatus())){
//如果是接班,算接班的班组+1 //如果是接班,算接班的班组+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0); DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1); troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts()+1);
}else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) { }else if (rec.getDelayStatus().equals(HAND_DELAY_STATUS.getStatus())) {
//如果是交班延迟,算当前的班组+1 //如果是交班延迟,算当前的班组+1
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0); DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1); handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts()+1);
}else { }else {
//交接班延迟,交接班组都+1 //交接班延迟,交接班组都+1
List<ImsDutyMainEntity> collect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> troubleRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(collect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO troubleRunReport = troubleRunReportList.get(0); DutyRunReportVO troubleRunReport = troubleRunReportList.get(0);
troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts() + 1); troubleRunReport.setExceptionChangeShifts(troubleRunReport.getExceptionChangeShifts() + 1);
}
List<ImsDutyMainEntity> handerCollect = imsDutyMainEntityList.stream().filter(s -> rec.getDutyId().equals(s.getPreDutyId())).collect(Collectors.toList()); 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()); List<DutyRunReportVO> handerRunReportList = dutyReportVOList.stream().filter(s -> s.getGroupId().equals(handerCollect.get(0).getDutyGroupId().toString())).collect(Collectors.toList());
DutyRunReportVO handerRunRepor = handerRunReportList.get(0); DutyRunReportVO handerRunRepor = handerRunReportList.get(0);
handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts() + 1); handerRunRepor.setExceptionChangeShifts(handerRunRepor.getExceptionChangeShifts() + 1);
@ -1175,6 +1194,7 @@ public class ImsDutyMainServiceImpl extends ServiceImpl<ImsDutyMainMapper, ImsDu
} }
} }
} }
}
@Override @Override
public List<DutyRunReportVO> getDutyMainRunReport(Map<String, Object> params) { public List<DutyRunReportVO> getDutyMainRunReport(Map<String, Object> params) {

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 powerTitle = deptName + "水电运维项目各电站发电量环比对比图(万kWh)";
String powerDomainAxis = "发电量"; String powerDomainAxis = "发电量";
String powerRangeAxis = "站点名称"; 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); map.put("powerChainHistogram", powerChainHistogram);
//柱状图下添加的表格 //柱状图下添加的表格
ArrayList<HashMap<String, String>> powerMap = new ArrayList<>(powerPercentageVoList.size()); ArrayList<HashMap<String, String>> powerMap = new ArrayList<>(powerPercentageVoList.size());

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

@ -46,12 +46,27 @@ public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperM
eq(OperMonthReportEntity::getMonth, month); eq(OperMonthReportEntity::getMonth, month);
eq(OperMonthReportEntity::getStationCode, dept.getId()); eq(OperMonthReportEntity::getStationCode, dept.getId());
eq(OperMonthReportEntity::getIsDeleted, 0); eq(OperMonthReportEntity::getIsDeleted, 0);
orderByDesc(OperMonthReportEntity::getObject); orderByDesc(OperMonthReportEntity::getCreateTime);
last("limit 1;"); last("limit 1;");
}}); }});
//查询实时数据 //查询实时数据
if (ObjectUtil.isEmpty(operMonthReportEntity)) { if (ObjectUtil.isEmpty(operMonthReportEntity)) {
stationReportAllVO = operStationMonthReportService.getStationMonthReportV2(month, BeanUtil.copy(dept, DeptVO.class)); 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 { else {
@ -73,8 +88,6 @@ public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperM
eq(OperMonthReportEntity::getIsDeleted, 0); eq(OperMonthReportEntity::getIsDeleted, 0);
last("limit 1;"); last("limit 1;");
}}); }});
if (ObjectUtil.isEmpty(operMonthReportEntityByMonth)||month.equals(YearMonth.now().toString())) {
if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)) { if (ObjectUtil.isNotEmpty(operMonthReportEntityByMonth)) {
this.removeById(operMonthReportEntityByMonth.getId()); this.removeById(operMonthReportEntityByMonth.getId());
} }
@ -89,14 +102,12 @@ public class MonthReportServiceImpl extends ServiceImpl<MonthReportMapper, OperM
try { try {
operMonthReportEntity.setObject(ObjectHelper.obj2byte(stationReportAllVO)); operMonthReportEntity.setObject(ObjectHelper.obj2byte(stationReportAllVO));
} catch (IOException e) { } catch (IOException e) {
log.error("生成统计月报失败{}", e.toString());
e.printStackTrace(); e.printStackTrace();
} }
//修改为每运行一次,保存一次 //修改为每运行一次,保存一次
this.save(operMonthReportEntity); this.save(operMonthReportEntity);
} }
} else {
log.info("该月{}已生成月报", deptVO.getDeptName());
}
} }
} }

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("创建人") @ApiModelProperty("创建人")
private String createUserName; 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.feign.IFlowClient;
import org.springblade.flow.core.vo.ComleteTask; import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache; 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.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
@ -114,6 +117,7 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
private final WorkTicketFinishServiceImpl workTicketFinishService; private final WorkTicketFinishServiceImpl workTicketFinishService;
private final TicketInfoDangerService ticketInfoDangerService; private final TicketInfoDangerService ticketInfoDangerService;
private final IEmInfoClient emInfoClient; private final IEmInfoClient emInfoClient;
private final ISysClient sysClient;
/** /**
* 生成两票编号锁 * 生成两票编号锁
@ -264,6 +268,15 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
if (StringUtils.isNotEmpty(req.getEndTime())) { if (StringUtils.isNotEmpty(req.getEndTime())) {
lqw.le(WorkTicketInfoEntity::getCreateTime, 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); lqw.orderByDesc(WorkTicketInfoEntity::getCreateTime).orderByDesc(WorkTicketInfoEntity::getUpdateTime);
IPage<WorkTicketInfoEntity> pages = this.page(Condition.getPage(query), lqw); IPage<WorkTicketInfoEntity> pages = this.page(Condition.getPage(query), lqw);
//数据转换 //数据转换

Loading…
Cancel
Save