Browse Source

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

zhongwei
yang_shj 4 months ago
parent
commit
f434a20a47
  1. 1
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareOutServiceFallback.java
  2. 42
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpWarehouseInExportVO.java
  3. 1
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpWarehouseInVO.java
  4. 14
      hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/WtSpToolBasicVO.java
  5. 3
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmDefinitionEntity.java
  6. 1
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java
  7. 1
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java
  8. 2
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java
  9. 3
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SystemFileEntity.java
  10. 10
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java
  11. 8
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java
  12. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpToolBasicController.java
  13. 32
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/dto/WtSpBasicDto.java
  14. 1
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpToolBasicMapper.java
  15. 9
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/ISpWarehouseInService.java
  16. 3
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpBasicService.java
  17. 3
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/IWtSpToolBasicService.java
  18. 1
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpAllocationServiceImpl.java
  19. 15
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java
  20. 123
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseInServiceImpl.java
  21. 86
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java
  22. 93
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpToolBasicServiceImpl.java
  23. 36
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/WtSpBasicExportVO.java
  24. 83
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/WtSpToolBasicExportVO.java
  25. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java
  26. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java
  27. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
  28. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java
  29. 34
      hzims-service/hzims-basic/pom.xml
  30. 8
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java
  31. 1
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  32. 8
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java
  33. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/CameraInfoServiceImpl.java
  34. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java
  35. 6
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectTemplateMapper.xml
  36. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java
  37. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java
  38. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java
  39. 28
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskRecordServiceImpl.java
  40. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HiKUtil.java
  41. 1
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java
  42. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java
  43. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/utils/ZXingGenCode.java
  44. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java
  45. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  46. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java
  47. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java
  48. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java
  49. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  50. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  51. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java
  52. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java
  53. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java
  54. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java
  55. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java
  56. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java
  57. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java
  58. 27
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java
  59. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java
  60. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java
  61. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml
  62. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml
  63. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java
  64. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java
  65. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java
  66. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java
  67. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/HtmltoPdf.java
  68. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/ZXingGenCode.java
  69. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/SystemFileVO.java
  70. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/SystemFileWrapper.java
  71. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
  72. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
  73. 1
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  74. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  75. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java
  76. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java
  77. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java
  78. 9
      hzims-service/ticket/src/main/resources/db/3.0.0.sql
  79. 1
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java

1
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/feign/ISpareOutServiceFallback.java

@ -12,7 +12,6 @@ public class ISpareOutServiceFallback implements ISpareOutServiceClient {
Long tenantId,
Integer current,
Integer size){
System.out.println("熔断了");
return null;
}

42
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpWarehouseInExportVO.java

@ -0,0 +1,42 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 入库单导出VO类
*
* @author liwen
*/
@Data
@ExcelIgnoreUnannotated
public class SpWarehouseInExportVO {
@ExcelProperty(value = "单据号", index = 0)
@ApiModelProperty(value = "单据号")
private String code;
@ExcelProperty(value = "仓库库房", index = 1)
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
@ApiModelProperty(value = "入库类型")
private Long type;
@ExcelProperty(value = "入库类型", index = 2)
@ApiModelProperty(value = "入库类型名")
private String typeName;
@ExcelProperty(value = "入库人", index = 3)
@ApiModelProperty(value = "入库人")
private String userName;
@ExcelProperty(value = "制单时间", index = 4)
@ApiModelProperty(value = "创建时间")
private Date createTime;
}

1
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/SpWarehouseInVO.java

@ -46,6 +46,7 @@ public class SpWarehouseInVO extends SpWarehouseInEntity {
@ApiModelProperty(value = "结束时间")
private String endDate;
/**
* 备品备件列表
*/

14
hzims-service-api/assets-api/src/main/java/com/hnac/hzims/spare/vo/WtSpToolBasicVO.java

@ -1,5 +1,6 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.hnac.hzims.spare.entity.WtSpToolBasicEntity;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
import io.swagger.annotations.ApiModelProperty;
@ -19,47 +20,60 @@ public class WtSpToolBasicVO extends WtSpToolBasicEntity {
* 名称
*/
@ApiModelProperty(value = "名称")
@ExcelProperty(value = "工具名称",index = 1)
private String name;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
@ExcelProperty(value = "工具台账",index = 0)
private String code;
/**
* 规格
*/
@ApiModelProperty(value = "规格")
@ExcelProperty(value = "规格/型号",index = 2)
private String specifications;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
@ExcelProperty(value = "单位",index = 3)
private String unit;
/**
* 总数量
*/
@ApiModelProperty(value = "总数量")
@ExcelProperty(value = "总数量",index = 4)
private Long totalAmount;
/**
* 在库数量
*/
@ApiModelProperty(value = "在库数量")
@ExcelProperty(value = "在库数量",index = 5)
private Integer notUseAmount;
/**
* 已领数量
*/
@ApiModelProperty(value = "已领数量")
@ExcelProperty(value = "已领数量",index = 6)
private Integer useAmount;
/**
* 所属仓库
*/
@ApiModelProperty(value = "所属仓库")
@ExcelProperty(value = "仓库",index = 9)
private String warehouseName;
/**
* 入库人
*/
@ApiModelProperty(value = "入库人")
@ExcelProperty(value = "领用人",index = 8)
private String userName;
@ApiModelProperty(value = "最近领用时间")
@ExcelProperty(value = "最近领用时间",index = 7)
private String lastNeckTime;
/**
* 单位名称
*/

3
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/EmDefinitionEntity.java

@ -34,9 +34,6 @@ public class EmDefinitionEntity extends TenantEntity {
@ApiModelProperty(value = "模型名称")
private String modelName;
@ApiModelProperty(value = "创建用户")
private Long createUser;
@ApiModelProperty(value = "创建用户名称")
@TableField(exist = false)
private String createUserName;

1
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/util/HttpRequestUtil.java

@ -122,7 +122,6 @@ public class HttpRequestUtil {
result += str;
}
log.info(url+"-------------------------{}"+result);
System.out.println(result);
//关闭流
is.close();
//断开连接,disconnect是在底层tcp socket链接空闲时才切断,如果正在被其他线程使用就不切断。

1
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java

@ -29,6 +29,7 @@ public class OperMaintenancePlanEntity extends TenantEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "站点编号")
@QueryField(condition = SqlCondition.EQUAL)
private String stationCode;
@ApiModelProperty(value = "站点名称")

2
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarMaintenanceEntity.java

@ -40,7 +40,7 @@ public class CarMaintenanceEntity extends BaseEntity {
@NotNull
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("维保开始时间")
@ApiModelProperty("维保时间")
private Date startTime;
// @NotNull

3
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/SystemFileEntity.java

@ -50,7 +50,4 @@ public class SystemFileEntity extends TenantEntity {
@ApiModelProperty(value = "工作流ID")
private String flowId;
@ApiModelProperty("创建人")
private Long createUser;
}

10
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseInController.java

@ -24,9 +24,9 @@ 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;
/**
* 控制器
*
@ -126,6 +126,14 @@ public class SpWarehouseInController extends BladeController {
return R.status(sp_warehouse_inService.removeBatchByIds(Func.toLongList(ids)));
}
@GetMapping("/exportSpWarehouseData")
@ApiOperationSupport(order = 8)
@ApiOperation(value = "入库单导出")
@Operate(label = "入库单导出", type = com.hnac.hzinfo.log.contants.BusinessType.EXPORT)
public void exportSpWarehouseData(SpWarehouseInVO warehouseInVO, HttpServletResponse response) {
sp_warehouse_inService.exportSpWarehouseData(warehouseInVO, response);
}
/**
* 完成流程 修改状态
*/

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

@ -7,6 +7,7 @@ import com.hnac.hzims.AssetsConstants;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.spare.dto.WtSpBasicDto;
import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.SpTemporaryStockEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity;
@ -117,6 +118,13 @@ public class WtSpBasicController extends BladeController {
return R.data(pages);
}
@GetMapping("/export")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "导出工具台账", notes = "传入SP_BASIC")
public void export(WtSpBasicDto request, HttpServletResponse response) {
SP_BASICService.export(request,response);
}
@GetMapping("/getlist")
@ApiImplicitParams({
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataType = "string"),

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpToolBasicController.java

@ -24,6 +24,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;
import java.util.List;
@ -82,6 +83,12 @@ public class WtSpToolBasicController extends BladeController {
return R.data(pages);
}
@GetMapping("/exportWtSpToolBasic")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "导出工具台账", notes = "传入toolBasicEntity")
public void exportWtSpToolBasic(WtSpToolBasicVO toolBasicVO, HttpServletResponse response) {
SP_TOOL_BASICService.exportWtSpToolBasic(toolBasicVO,response);
}
/**
* 新增 代码自定义代号
*/

32
hzims-service/assets/src/main/java/com/hnac/hzims/spare/dto/WtSpBasicDto.java

@ -0,0 +1,32 @@
package com.hnac.hzims.spare.dto;
import com.hnac.hzinfo.api.annotation.ApiInterface;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @Author: huangxing
* @Date: 2024/08/05 18:48
*/
@Data
@ApiModel(value = "工具台账查询DTO",description = "工具台账查询DTO")
@EqualsAndHashCode
public class WtSpBasicDto implements Serializable {
@ApiModelProperty(value = "仓库ID")
private Long warehouseId;
@ApiModelProperty(value = "工具名称")
private String nameQuery;
@ApiModelProperty(value = "制单时间查询开始时间")
private String startDate;
@ApiModelProperty(value = "制单时间查询结束时间")
private String endDate;
}

1
hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpToolBasicMapper.java

@ -26,4 +26,5 @@ public interface WtSpToolBasicMapper extends UserDataScopeBaseMapper<WtSpToolBas
*/
@UserDataAuth
List<WtSpToolBasicVO> selectPageList(IPage<WtSpToolBasicVO> page,@Param(value = "params") Map<String,Object> params);
}

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

@ -7,6 +7,8 @@ import com.hnac.hzims.spare.vo.SpWarehouseInVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
/**
* 服务类
*
@ -34,6 +36,13 @@ public interface ISpWarehouseInService extends IService<SpWarehouseInEntity> {
* @return
*/
IPage<SpWarehouseInVO> selectPageList(IPage<SpWarehouseInVO> page, SpWarehouseInVO warehouseInVO) ;
/**
* 入库单导出
* @param warehouseInVO
* @param response
*/
void exportSpWarehouseData(SpWarehouseInVO warehouseInVO, HttpServletResponse response);
/**
*完成流程
* @param flow

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

@ -2,6 +2,7 @@ package com.hnac.hzims.spare.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.spare.dto.WtSpBasicDto;
import com.hnac.hzims.spare.entity.SpTemporaryStockDetailEntity;
import com.hnac.hzims.spare.entity.SpTemporaryStockEntity;
import com.hnac.hzims.spare.entity.WtSpBasicEntity;
@ -29,6 +30,8 @@ public interface IWtSpBasicService extends IService<WtSpBasicEntity> {
* @return
*/
IPage<WtSpBasicVO> selectPage(WtSpBasicEntity SP_BASIC, Query query, Long warehouseId, String sign);
void export(WtSpBasicDto request,HttpServletResponse response);
/**
* 根据备件id和库存id查询备件已使用总数量
* @param params

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

@ -7,6 +7,7 @@ import com.hnac.hzims.spare.vo.WtSpToolBasicVO;
import org.springblade.core.mp.support.Query;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -36,4 +37,6 @@ public interface IWtSpToolBasicService extends IService<WtSpToolBasicEntity> {
* @return
*/
IPage<WtSpToolBasicVO> selectPageList(IPage<WtSpToolBasicVO> page, WtSpToolBasicVO toolBasicVO) ;
void exportWtSpToolBasic(WtSpToolBasicVO toolBasicVO, HttpServletResponse response);
}

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

@ -86,7 +86,6 @@ public class SpAllocationServiceImpl extends ServiceImpl<SpAllocationMapper, SpA
code = code.concat(dateStr).concat(AssetsNumCache.getCodeNum());
entity.setCode(code);
super.save(entity);
System.out.println(entity.getId());
for (int i = 0; i < basicEntityList.size(); i++) {
if(basicEntityList.get(i).getAmount()<=0){
throw new ServiceException("数量必须大于0");

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

@ -27,6 +27,7 @@ import org.springblade.core.tool.utils.Func;
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;
@ -34,10 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
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.*;
/**
* 服务实现类
@ -170,13 +168,8 @@ public class SpReceiveServiceImpl extends ServiceImpl<SpReceiveMapper, SpReceive
receiveVO.setWarehouseName(warehouseEntity.getName());
receiveVO.setAffiliatedName(warehouseEntity.getAffiliatedName());
}
if(null!=detail.getCreateUser()){
R<User> user = userClient.userInfoById(detail.getCreateUser());
if(null!=user){
receiveVO.setUserName(user.getData().getName());
}
}
String userName = Optional.ofNullable(detail.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null);
receiveVO.setUserName(userName);
List<SpRecordEntity> basicList = spRecordMapper.selectByBusinessId(detail.getId());
List<WtSpBasicVO> basicVOList = new ArrayList<>();
for (int i = 0; i < basicList.size(); i++) {

123
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseInServiceImpl.java

@ -1,5 +1,11 @@
package com.hnac.hzims.spare.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.converters.longconverter.LongStringConverter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -12,10 +18,12 @@ import com.hnac.hzims.spare.mapper.SpRecordMapper;
import com.hnac.hzims.spare.mapper.SpWarehouseInMapper;
import com.hnac.hzims.spare.mapper.WtSpWarehouseMapper;
import com.hnac.hzims.spare.service.*;
import com.hnac.hzims.spare.vo.SpWarehouseInExportVO;
import com.hnac.hzims.spare.vo.SpWarehouseInVO;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.spare.vo.WtSpManagementVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.log.exception.ServiceException;
@ -23,21 +31,24 @@ 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.BeanUtil;
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.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
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.stream.Collectors;
import java.util.*;
/**
* 服务实现类
@ -46,6 +57,7 @@ import java.util.stream.Collectors;
*/
@Service
@AllArgsConstructor
@Slf4j
public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, SpWarehouseInEntity> implements ISpWarehouseInService {
private static final Logger logger = LoggerFactory.getLogger(SpWarehouseInServiceImpl.class);
@ -78,7 +90,6 @@ public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, S
public synchronized boolean save(SpWarehouseInEntity entity) {
List<SpRecordEntity> basicEntityList = entity.getBasicList();
super.save(entity);
System.out.println(entity.getId());
for (int i = 0; i < basicEntityList.size(); i++) {
if(basicEntityList.get(i).getAmount()<=0){
throw new ServiceException("数量必须大于0");
@ -252,6 +263,106 @@ public class SpWarehouseInServiceImpl extends ServiceImpl<SpWarehouseInMapper, S
return page.setRecords(result);
}
/**
* 入库单导出
*/
@Override
public void exportSpWarehouseData(SpWarehouseInVO warehouseInVO, HttpServletResponse response) {
ServletOutputStream outputStream = null;
try {
outputStream = response.getOutputStream();
Map<String,Object> params = new HashMap<>();
if (null !=warehouseInVO.getCode()) {
params.put("code",warehouseInVO.getCode());
}
if (null !=warehouseInVO.getType()) {
params.put("type",warehouseInVO.getType());
}
if (null !=warehouseInVO.getStatus()) {
params.put("status",warehouseInVO.getStatus());
}
if (null !=warehouseInVO.getStartDate()) {
params.put("startDate",warehouseInVO.getStartDate());
}
if (null !=warehouseInVO.getEndDate()) {
params.put("endDate",warehouseInVO.getEndDate());
}
List<Long> longList = new ArrayList<>();
if (null!=warehouseInVO.getDeptId()) {
R<List<Dept>> deptList = sysClient.getDeptChild(warehouseInVO.getDeptId());
for (int i = 0; i < deptList.getData().size(); i++) {
longList.add(deptList.getData().get(i).getId());
}
longList.add(warehouseInVO.getDeptId());
}
if (longList.size()>0) {
params.put("deptList",longList);
}
if (null!=warehouseInVO.getStorageRoom()) {
params.put("warehouseId",warehouseInVO.getStorageRoom());
}
params.put("tenantId", AuthUtil.getTenantId());
List<SpWarehouseInVO> warehouseInPage = baseMapper.selectPageList(null, params);
// 导入列表
List<SpWarehouseInExportVO> warehouseInExportList = new ArrayList<>();
// 数据处理
warehouseInPage.forEach(warehouse -> {
new SpWarehouseInExportVO();
int type = warehouse.getType().intValue();
// 入库类型
String typeName;
if (type == WarehouseInType.BUY.getType()) {
typeName = WarehouseInType.BUY.getName();
} else if (type == WarehouseInType.BACK.getType()) {
typeName = WarehouseInType.BACK.getName();
} else if (type == WarehouseInType.ALLOT.getType()) {
typeName = WarehouseInType.ALLOT.getName();
} else {
typeName = WarehouseInType.OLD.getName();
}
warehouse.setTypeName(typeName);
String userName = Optional.ofNullable(warehouse.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null);
warehouse.setUserName(userName);
log.info("入库数据为:{}", JSON.toJSONString(warehouse));
SpWarehouseInExportVO exportVO = BeanUtil.copy(warehouse,SpWarehouseInExportVO.class);
warehouseInExportList.add(exportVO);
});
// 设置响应头
// URLEncoder.encode防止中文乱码
String fileName = URLEncoder.encode("入库单", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
// ExcelWriter初始化
ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream())
.autoCloseStream(Boolean.TRUE)
.registerConverter(new LongStringConverter())
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25))
.build();
WriteSheet writeSheet = EasyExcel.writerSheet(1, "入库单").head(SpWarehouseInExportVO.class)
.build();
excelWriter.write(warehouseInExportList, writeSheet);
excelWriter.finish();
} catch (Exception e) {
// 重置response
response.reset();
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
throw new ServiceException("入库单数据导出异常: " + e.getMessage());
} finally {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error("入库单数据导出输出流关闭异常: " + e.getMessage());
}
}
}
}
// @Override
// public boolean completeTask(BladeFlow flow) {
// ComleteTask task = new ComleteTask();

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

@ -1,11 +1,13 @@
package com.hnac.hzims.spare.service.impl;
import ch.qos.logback.classic.jmx.MBeanUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.converters.longconverter.LongStringConverter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -17,6 +19,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.operational.maintenance.vo.MaintenanceTaskQueryVO;
import com.hnac.hzims.spare.dto.WtSpBasicDto;
import com.hnac.hzims.spare.entity.*;
import com.hnac.hzims.spare.enume.WarehouseInType;
import com.hnac.hzims.spare.enume.WarehouseOutType;
@ -33,16 +37,20 @@ 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.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.TicketInfoStatisticVO;
import com.hnac.hzinfo.exception.HzServiceException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.log.exception.ServiceException;
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.IResultCode;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
@ -57,10 +65,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@ -171,7 +176,6 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
List<WtSpBasicVO> voList = new ArrayList<>();
IPage<WtSpBasicVO> voPages = new Page<>();
if (Func.isNotEmpty(spBasicEntity.getName()) && "工具".equals(spBasicEntity.getName())) {
// if(Func.isNotEmpty(spBasicEntity.getName())){
List<WtSpManagementEntity> list = managementService.list(Wrappers.<WtSpManagementEntity>query().lambda().
eq(WtSpManagementEntity::getName, spBasicEntity.getName()));
if (list.size() == 0) {
@ -218,13 +222,6 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
basicVO.setStock(0L);
}
BeanUtils.copyProperties(basicEntity, basicVO);
List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketStatistic("2022-02");
// R<Dept> deptR = sysClient.getDept(basicEntity.getWaterPlantId());
// if(Func.isNotEmpty(deptR.getData())){
// basicVO.setWaterPlantName(deptR.getData().getDeptName());
// }
voList.add(basicVO);
} else {
WtSpBasicVO basicVO = new WtSpBasicVO();
@ -240,16 +237,11 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
if (null != totalEntity) {
List<WtSpTotalEntity> totalList = totalService.list(Wrappers.<WtSpTotalEntity>query().lambda().eq(WtSpTotalEntity::getSpBasicId, basicEntity.getId()));
if (totalList.size() > 0) {
// basicVO.setStock(totalList.get(0).getStock());
basicVO.setStock(totalEntity.getStock());
} else {
basicVO.setStock(0L);
}
BeanUtils.copyProperties(basicEntity, basicVO);
// R<Dept> deptR = sysClient.getDept(basicEntity.getWaterPlantId());
// if(Func.isNotEmpty(deptR.getData())){
// basicVO.setWaterPlantName(deptR.getData().getDeptName());
// }
voList.add(basicVO);
}
List<WtSpTotalEntity> totalEntities = totalMapper.selectByWarehouseId(warehouseId);
@ -274,6 +266,61 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
}
@Override
public void export(WtSpBasicDto request, HttpServletResponse response) {
LambdaQueryWrapper<WtSpBasicEntity> basicWrapper = Wrappers.<WtSpBasicEntity>lambdaQuery()
.like(StringUtils.isNotEmpty(request.getNameQuery()),WtSpBasicEntity::getName, request.getNameQuery());
List<WtSpBasicEntity> wtBasicList = this.list(basicWrapper);
Assert.isTrue(CollectionUtil.isNotEmpty(wtBasicList),() -> {
throw new HzServiceException(ResultCode.FAILURE,"暂无数据!");
});
List<WtSpBasicVO> basicVOList = wtBasicList.stream().map(b -> this.getBasicVO(b, request.getWarehouseId())).collect(Collectors.toList());
String fileName;
try {
fileName = URLEncoder.encode("工具台账报表", "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(), WtSpBasicVO.class)
.registerWriteHandler(new HorizontalCellStyleStrategy(new WriteCellStyle(), contentWriteCellStyle))
.autoCloseStream(Boolean.FALSE).sheet("工具台账")
.doWrite(basicVOList);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private WtSpBasicVO getBasicVO(WtSpBasicEntity basicEntity,Long warehouseId) {
WtSpBasicVO basicVO = BeanUtil.copy(basicEntity,WtSpBasicVO.class);
if(Func.isEmpty(warehouseId)) {
WtSpManagementEntity managementEntity = managementMapper.selectById(basicEntity.getManagementId());
basicVO.setSparePartsName(Optional.ofNullable(managementEntity).map(WtSpManagementEntity::getName).orElse(null));
List<WtSpTotalEntity> totalList = totalService.list(Wrappers.<WtSpTotalEntity>query().lambda().eq(WtSpTotalEntity::getSpBasicId, basicEntity.getId()));
basicVO.setStock(CollectionUtil.isNotEmpty(totalList) ? totalList.get(0).getStock() : 0L);
} else {
WtSpManagementEntity managementEntity = managementMapper.selectById(basicEntity.getManagementId());
basicVO.setSparePartsName(Optional.ofNullable(managementEntity).map(WtSpManagementEntity::getName).orElse(null));
LambdaQueryWrapper<WtSpTotalEntity> totalWrapper = Wrappers.<WtSpTotalEntity>lambdaQuery()
.eq(Func.isNotEmpty(basicEntity.getId()), WtSpTotalEntity::getSpBasicId, basicEntity.getId())
.eq(WtSpTotalEntity::getWarehouseId, warehouseId);
if(CollectionUtil.isNotEmpty(totalMapper.selectList(totalWrapper))) {
List<WtSpTotalEntity> totalList = totalService.list(Wrappers.<WtSpTotalEntity>query().lambda().eq(WtSpTotalEntity::getSpBasicId, basicEntity.getId()));
basicVO.setStock(CollectionUtil.isNotEmpty(totalList) ? totalList.get(0).getStock() : 0L);
}
}
return basicVO;
}
@Override
public Integer selectTotal(Map<String, Object> params) {
return baseMapper.selectTotal(params);
}
@ -508,7 +555,6 @@ public class WtSpBasicServiceImpl extends ServiceImpl<WtSpBasicMapper, WtSpBasic
// .doWrite(list);
// response.getOutputStream().close();
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

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

@ -1,5 +1,8 @@
package com.hnac.hzims.spare.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -8,22 +11,29 @@ import com.hnac.hzims.spare.enume.BusinessType;
import com.hnac.hzims.spare.mapper.*;
import com.hnac.hzims.spare.service.IWtSpBasicService;
import com.hnac.hzims.spare.service.IWtSpToolBasicService;
import com.hnac.hzims.spare.vo.WtSpBasicVO;
import com.hnac.hzims.spare.vo.WtSpToolBasicExportVO;
import com.hnac.hzims.spare.vo.WtSpToolBasicVO;
import lombok.AllArgsConstructor;
import org.apache.poi.ss.usermodel.BorderStyle;
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.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.system.entity.Dept;
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 java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.*;
/**
* 服务实现类
@ -160,4 +170,79 @@ public class WtSpToolBasicServiceImpl extends ServiceImpl<WtSpToolBasicMapper, W
}
return page.setRecords(result);
}
@Override
public void exportWtSpToolBasic(WtSpToolBasicVO toolBasicVO, HttpServletResponse response) {
Map<String,Object> params = new HashMap<>();
if(null !=toolBasicVO.getCode()){
params.put("code",toolBasicVO.getCode());
}
if(null !=toolBasicVO.getNameQuery()){
params.put("name",toolBasicVO.getNameQuery());
}
if(null !=toolBasicVO.getStartDate()){
params.put("startDate",toolBasicVO.getStartDate());
}
if(null !=toolBasicVO.getEndDate()){
params.put("endDate",toolBasicVO.getEndDate());
}
List<Long> longList = new ArrayList<>();
if(null!=toolBasicVO.getDeptId()){
R<List<Dept>> deptList = sysClient.getDeptChild(toolBasicVO.getDeptId());
for (int i = 0; i < deptList.getData().size(); i++) {
longList.add(deptList.getData().get(i).getId());
}
longList.add(toolBasicVO.getDeptId());
}
if(!longList.isEmpty()){
params.put("deptList",longList);
}
if(null!=toolBasicVO.getWarehouseId()){
params.put("warehouseId",toolBasicVO.getWarehouseId());
}
params.put("tenantId", AuthUtil.getTenantId());
List<WtSpToolBasicVO> list = baseMapper.selectPageList(null,params);
List<WtSpToolBasicExportVO> result = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
WtSpToolBasicVO wtSpToolBasicVO = list.get(i);
WtSpToolBasicExportVO exportVO = BeanUtil.copy(list.get(i), WtSpToolBasicExportVO.class);
String userName = Optional.ofNullable(wtSpToolBasicVO.getCreateUser()).map(UserCache::getUser).map(User::getName).orElse(null);
exportVO.setUserName(userName);
Map<String,Object> map = new HashMap<>();
map.put("spBasicId",wtSpToolBasicVO.getSpBasicId());
map.put("warehouseId",wtSpToolBasicVO.getWarehouseId());
Integer res = spBasicService.selectTotal(map);
wtSpToolBasicVO.setUseAmount(res);
WtSpTotalEntity spTotalEntity = spTotalMapper.selectByBasicId(map);
Long stock = Optional.ofNullable(spTotalEntity).map(WtSpTotalEntity::getStock).orElse(0L);
Long amount = Optional.ofNullable(wtSpToolBasicVO).map(WtSpToolBasicVO::getUseAmount).map(Long::valueOf).orElse(0L);
exportVO.setTotalAmount(stock + amount);
exportVO.setNotUseAmount(Optional.ofNullable(spTotalEntity).map(WtSpTotalEntity::getStock).map(s -> s.intValue()).orElse(0));
exportVO.setLastNeckTime(DateUtil.format(wtSpToolBasicVO.getCreateTime(),DateUtil.PATTERN_DATETIME));
result.add(exportVO);
}
String fileName;
try {
fileName = URLEncoder.encode("工具台账报表", "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(), WtSpToolBasicExportVO.class)
.registerWriteHandler(new HorizontalCellStyleStrategy(new WriteCellStyle(), contentWriteCellStyle))
.autoCloseStream(Boolean.FALSE).sheet("工具台账")
.doWrite(result);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

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

@ -0,0 +1,36 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @Author: huangxing
* @Date: 2024/08/05 19:44
*/
@Data
@EqualsAndHashCode
public class WtSpBasicExportVO implements Serializable {
@ExcelProperty(value = "物品编码",index = 0)
@ApiModelProperty(value = "编码")
private String code;
@ExcelProperty(value = "工具名称",index = 1 )
@ApiModelProperty(value = "名称")
private String name;
@ExcelProperty(value = "规格/型号",index = 2 )
@ApiModelProperty(value = "规格")
private String specifications;
@ExcelProperty(value = "单位",index = 3)
@ApiModelProperty(value = "单位")
private String unit;
}

83
hzims-service/assets/src/main/java/com/hnac/hzims/spare/vo/WtSpToolBasicExportVO.java

@ -0,0 +1,83 @@
package com.hnac.hzims.spare.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @Author: huangxing
* @Date: 2024/08/05 20:50
*/
@Data
@EqualsAndHashCode
public class WtSpToolBasicExportVO implements Serializable {
/**
* 名称
*/
@ApiModelProperty(value = "名称")
@ExcelProperty(value = "工具名称",index = 1)
@ColumnWidth(15)
private String name;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
@ExcelProperty(value = "工具台账",index = 0)
@ColumnWidth(15)
private String code;
/**
* 规格
*/
@ApiModelProperty(value = "规格")
@ExcelProperty(value = "规格/型号",index = 2)
@ColumnWidth(20)
private String specifications;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
@ExcelProperty(value = "单位",index = 3)
private String unit;
/**
* 总数量
*/
@ApiModelProperty(value = "总数量")
@ExcelProperty(value = "总数量",index = 4)
private Long totalAmount;
/**
* 在库数量
*/
@ApiModelProperty(value = "在库数量")
@ExcelProperty(value = "在库数量",index = 5)
@ColumnWidth(15)
private Integer notUseAmount;
/**
* 已领数量
*/
@ApiModelProperty(value = "已领数量")
@ColumnWidth(15)
@ExcelProperty(value = "已领数量",index = 6)
private Integer useAmount;
/**
* 所属仓库
*/
@ApiModelProperty(value = "所属仓库")
@ExcelProperty(value = "仓库",index = 9)
@ColumnWidth(15)
private String warehouseName;
/**
* 入库人
*/
@ApiModelProperty(value = "入库人")
@ExcelProperty(value = "领用人",index = 8)
private String userName;
@ApiModelProperty(value = "最近领用时间")
@ExcelProperty(value = "最近领用时间",index = 7)
@ColumnWidth(20)
private String lastNeckTime;
}

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

@ -92,7 +92,7 @@ public class EmDefinitionController extends BladeController {
@ApiOperation(value = "新增", notes = "传入EmDefinitionDTO")
public R save(@Valid @RequestBody EmDefinitionDTO emDefinitionDTO) {
EmDefinitionEntity definition = BeanUtil.copy(emDefinitionDTO, EmDefinitionEntity.class);
definition.setCreateUser(AuthUtil.getUserId());
// definition.setCreateUser(AuthUtil.getUserId());
return R.data(emDefinitionService.save(definition));
}

16
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -14,10 +14,14 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -40,6 +44,8 @@ import java.util.Map;
public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Resource
private IStationClient stationClient;
@Resource
private ISysClient sysClient;
@Value("${url.getNeoFaultPropertyList}")
private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}")
@ -57,18 +63,20 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
List<StationEntity> list = new ArrayList<>();
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
});
StationEntity condition = new StationEntity();
R<List<StationEntity>> stationR = stationClient.list(condition);
if (!stationR.isSuccess()||CollectionUtil.isEmpty(stationR.getData())){
return R.data(list);
}
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
R<List<StationEntity>> listAll = stationClient.getListAll();
if (listAll.isSuccess() && ObjectUtil.isNotEmpty(listAll.getData())) {
for (String s : res.getData()) {
for (StationEntity station : listAll.getData()) {
for (StationEntity station : stationR.getData()) {
if (station.getCode().equals(s)) {
list.add(station);
}
}
}
}
}
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list);
}

3
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java

@ -423,7 +423,6 @@ public class FdpMonitorServiceImpl extends ServiceImpl<FdpMonitorMapper, FdpMoni
key = taskDTO.getId().toString();
redisTemplate.opsForValue().set(KEY_FOR_FDP_TASK_ID + "_" + key, key);
Boolean expire = redisTemplate.expire(KEY_FOR_FDP_TASK_ID + "_" + key,3, TimeUnit.DAYS);
System.out.println(expire);
}
} else {
//没有未完成的任务,新增一个任务
@ -554,7 +553,6 @@ public class FdpMonitorServiceImpl extends ServiceImpl<FdpMonitorMapper, FdpMoni
key = taskDTO.getId().toString();
redisTemplate.opsForValue().set(KEY_FOR_FDP_TASK_ID + "_" + key, key);
Boolean expire = redisTemplate.expire(KEY_FOR_FDP_TASK_ID + "_" + key,3, TimeUnit.DAYS);
System.out.println(expire);
}
} else {
//没有未完成的任务,新增一个任务
@ -615,7 +613,6 @@ public class FdpMonitorServiceImpl extends ServiceImpl<FdpMonitorMapper, FdpMoni
diagnoseFaultReq.setLifeTime(24*3);//一旦用户进行修改,智能诊断时效性刷新为3天
faultAllReq.setManualData(diagnoseFaultReq);
String jsonString = JSONObject.toJSONString(faultAllReq);
System.out.println(jsonString);
HttpResponse r = HttpClientUtils.post(updateFaultStateAll, JSONObject.toJSONString(faultAllReq));
if(StringUtil.isNotBlank(diagnoseFaultReq.getTaskId())) {
redisTemplate.expire(KEY_FOR_FDP_TASK_ID + "_" + diagnoseFaultReq.getTaskId(), 3, TimeUnit.DAYS);

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/DroolsMqttConsumer.java

@ -36,7 +36,6 @@ public class DroolsMqttConsumer implements SubscribeCallBack {
alarmSaveService.save(alarmEntities);
}catch (Exception e){
log.error("规则引擎告警数据处理报错(DroolsAlarm):"+e);
System.out.println("规则引擎告警数据处理报错(DroolsAlarm):"+e);
}
}
}

34
hzims-service/hzims-basic/pom.xml

@ -49,6 +49,40 @@
<artifactId>hzims-operational-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.3.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>

8
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/controller/PresonManagementController.java

@ -97,7 +97,7 @@ public class PresonManagementController extends BladeController {
@OperationAnnotation(moduleName = "档案管理",title = "档案管理",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,action
= "档案管理")
public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) {
public void exportPersonManagemetVo(HttpServletResponse response,PersonManagemetVo personManagemetVo) throws IOException {
try {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("UTF-8");
@ -111,8 +111,9 @@ public class PresonManagementController extends BladeController {
EasyExcel.write(response.getOutputStream(), PersonManagemetExportVo.class).autoCloseStream(Boolean.FALSE).sheet("档案管理报表")
.doWrite(list);
}
response.getOutputStream().close();
} catch (Exception e) {
System.out.println("exportExcel = " + e);
e.printStackTrace();
// 重置response
response.reset();
response.setContentType("application/json");
@ -122,9 +123,12 @@ public class PresonManagementController extends BladeController {
map.put("msg", "档案管理报表导出失败" + e.getMessage());
try {
response.getWriter().println(JSONUtil.toJsonStr(map));
response.getOutputStream().close();
} catch (IOException e3) {
response.getOutputStream().close();
throw new ServiceException( "发生异常 :" + e);
}
}
}

1
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -38,6 +38,7 @@ public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonMan
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "depetIds")List<Long> depetIds,
@Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
@UserDataAuth
List<PersonManagemetExportVo> exportPersonManagemet(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,

8
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

@ -45,8 +45,10 @@ public abstract class ProcessAbstractService implements ProcessService {
@Override
public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) {
log.info("开启流程.....");
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
R r = new R();
try {
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
r.setSuccess(result.isSuccess());
r.setCode(result.getCode());
r.setMsg(result.getMsg());
// 更新任务流程Id
@ -61,6 +63,10 @@ public abstract class ProcessAbstractService implements ProcessService {
pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg());
}
return r;
}catch (Exception e){
log.error(e.toString()) ;
}
return R.fail("开启流程失败");
}
// public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map<String, Object> variables) {
// R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/ai/service/impl/CameraInfoServiceImpl.java

@ -28,7 +28,6 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
public void testSms(){
// 发送短信
R<SmsResponse> success = smsClient.sendMessage("aliyun-task-end", "{\"two\":\"2021-03-24 16:41:26\",\"one\":\"测试短信3\"}", "18229968652");
System.out.println("msg -- 用户手机号:18229968652 ; 返回信息 = " + (Func.isNotEmpty(success)?success.toString(): "返回为空"));
}
@Override

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/config/XxlJobConfig.java

@ -44,7 +44,6 @@ public class XxlJobConfig {
xxlJobSpringExecutor.setAppname(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
System.out.println(">>>>>>>>>>> xxl-rpc, port " + port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);

6
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ObjectTemplateMapper.xml

@ -6,7 +6,11 @@
SELECT t.id,o.code,o.name,o.SUPPORT_AUTO_VIDEO,t.template_id,t.object_id
from hz_st_re_object_template t
left JOIN hz_st_re_template o on (t.template_id=o.id)
left join hz_st_re_template_project p on o.id = p.template_id
left join hz_st_re_project_content c on p.project_id = c.project_id
where t.object_id=#{objectId} AND t.is_deleted=0
and o.is_deleted = 0 and p.is_deleted = 0 and c.is_deleted = 0
and p.id is not null and c.id is not null
<if test="type != null and type !='' ">
and o.support_auto_video = #{type}
</if>
@ -17,7 +21,7 @@
SELECT o.*, t.id as OBJ_TEMP_ID
from hz_st_re_object_template t
left JOIN hz_st_re_template o on (t.template_id=o.id)
where t.object_id=#{objectId} AND t.is_deleted=0
where t.object_id=#{objectId} AND t.is_deleted=0 and o.is_deleted = 0
order by t.UPDATE_TIME desc
</select>
</mapper>

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/CompressUtils.java

@ -79,7 +79,6 @@ public class CompressUtils {
in.close();
}
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
@ -244,7 +243,6 @@ public class CompressUtils {
in.close();
}
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) +" ms");
result = true;
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils",e);

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/controller/InspectReportController.java

@ -75,13 +75,11 @@ public class InspectReportController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<InspectMonthReportExcel> datas = irs.getExcelByMonth(month, routId, userId);
if(datas!=null && datas.size()>0){
System.out.println("---------------- size = " + datas.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), InspectMonthReportExcel.class).autoCloseStream(Boolean.FALSE).sheet(month +"巡检详情")
.doWrite(datas);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");
@ -118,13 +116,11 @@ public class InspectReportController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<InspectMonthReportExcel> datas = irs.getExcelByMonthGather(vo);
if(datas!=null && datas.size()>0){
System.out.println("---------------- size = " + datas.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), InspectMonthReportExcel.class).autoCloseStream(Boolean.FALSE).sheet(vo.getMonth() +"巡检详情")
.doWrite(datas);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/controller/TaskController.java

@ -180,13 +180,11 @@ public class TaskController extends BladeController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<InspectTaskExportVO> list = taskService.exportTaskList(task);
if(list!=null && list.size()>0){
System.out.println("---------------- size = " + list.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), InspectTaskExportVO.class).autoCloseStream(Boolean.FALSE).sheet("巡检任务报表")
.doWrite(list);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

28
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskRecordServiceImpl.java

@ -1,7 +1,10 @@
package com.hnac.hzinfo.inspect.task.service.impl;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.hnac.hzinfo.inspect.task.TaskContants;
import com.hnac.hzinfo.inspect.task.TaskContants.ClaimStatusEnum;
import com.hnac.hzinfo.inspect.task.TaskContants.TaskRecordTypeEnum;
@ -19,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 巡检报备服务实现类
@ -36,11 +41,9 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
@Override
public Boolean addTaskRecord(TaskRecordEntity itr) {
TaskEntity task = taskService.getById(itr.getTaskId());
if(TaskContants.TaskStatusEnum.UNFINISH_STATUS.getStatus().equals(task.getStatus())){
throw new ServiceException("未完成的任务不能报备");
}
if(TaskContants.TaskStatusEnum.FINISH_STATUS.getStatus().equals(task.getStatus())){
throw new ServiceException("已完成的任务不能报备");
// 只有未开始的任务可进行报备操作
if(!TaskContants.TaskStatusEnum.INIT_STATUS.getStatus().equals(String.valueOf(task.getStatus()))) {
throw new ServiceException("只有未开始的任务可进行报备操作");
}
if(TaskRecordTypeEnum.people.getType().equals(itr.getType())) {
// 人员报备(删除此任务以前的所属人,然后将任务指派给新的人)
@ -48,22 +51,9 @@ public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRec
// 领取任务
TaskUserEntity itu = TaskUserEntity.builder().taskId(itr.getTaskId()).userId(itr.getExecutor()).claimStatus(ClaimStatusEnum.COLLECT.getStatus()).claimTime(LocalDateTime.now()).build();
taskUserService.save(itu);
}else{//任务报备(谁第一个登录任务谁就领取任务)
// //领取任务(抢占任务取第一个人员领取该任务,并发任务,一个任务对应的一个人也是取第一个人)
// TaskUserEntity itu = taskUserService.getOne(Wrappers.<TaskUserEntity>query().lambda().eq(TaskUserEntity::getTaskId, itr.getTaskId()).eq(TaskUserEntity::getClaimStatus,ClaimStatusEnum.UN_COLLECT.getStatus()).last("limit 1"));
// if(itu!=null){
// itu.setClaimStatus(ClaimStatusEnum.COLLECT.getStatus());
// itu.setClaimTime(LocalDateTime.now());
// taskUserService.updateById(itu);
// //如果是抢占任务,删除能够抢占此任务的其他人
// if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(task.getMethod())) {
// taskUserService.remove(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId,task.getId()).ne(TaskUserEntity::getId,itu.getUserId()));
// }
// }
}
// 报备后任务默认为进行中
UpdateWrapper<TaskEntity> uwTask = new UpdateWrapper<>();
uwTask.lambda()
LambdaUpdateWrapper<TaskEntity> uwTask = Wrappers.<TaskEntity>lambdaUpdate()
.set(TaskEntity::getKeepOnRecord, keepOnRecordEnum.yes.getType())
.set(TaskEntity::getStartTime, LocalDateTime.now())
.set(TaskEntity::getStatus, TaskContants.TaskStatusEnum.UNDERWAY_STATUS.getStatus())

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HiKUtil.java

@ -117,7 +117,6 @@ public class HiKUtil {
put("https://", url);
}};
final String contentType = "application/json";
System.out.println("海康调用传参"+ JSON.toJSONString(variable));
String result = ArtemisHttpUtil.doPostStringArtemis(path, JSON.toJSONString(variable), null, null, contentType , null);
Assert.isTrue("0".equals(JSONObject.parseObject(result).getString("code")),() -> {
throw new ServiceException("调用海康URL失败,报错信息为:" + result);

1
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/HtmltoPdf.java

@ -128,7 +128,6 @@ public class HtmltoPdf {
public static String getCurrentOperatingSystem(){
String os = System.getProperty("os.name").toLowerCase();
System.out.println("---------当前操作系统是-----------" + os);
return os;
}

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/utils/ZxingGenCode.java

@ -54,9 +54,6 @@ public class ZxingGenCode {
Result result = null;
try {
image = ImageIO.read(new File(imgPath));
if (image == null) {
System.out.println("the decode image may be not exit.");
}
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

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

@ -47,9 +47,6 @@ public class ZXingGenCode {
Result result = null;
try {
image = ImageIO.read(new File(imgPath));
if (image == null) {
System.out.println("the decode image may be not exit.");
}
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java

@ -133,7 +133,6 @@ public class StAlamRecordServiceImpl extends ServiceImpl<StAlarmRecordMapper, St
Set<String> stationIds = station.stream().map(StationEntity::getCode).collect(Collectors.toSet());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date2 = new Date();
System.out.println("开始:" + sdf.format(date2));
//查询出用户所拥有的数据权限站点下的所有属性
List<StFocusPropertiesEntity> list = stFocusPropertiesService.list(new LambdaQueryWrapper<StFocusPropertiesEntity>() {{
in(StFocusPropertiesEntity::getStationId, stationIds);

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -112,6 +112,11 @@ public class DefectCheckServiceImpl extends ServiceImpl<OperPhenomenonMapper, Op
if (StringUtils.isNotBlank(AuthUtil.getNickName())){
entity.setCreateUserName(AuthUtil.getNickName());
}
if (StringUtils.isNotBlank(entity.getInitResult())){
entity.setInitResult( entity.getInitResult().replaceAll("\n",""));
entity.setInitResult( entity.getInitResult().replaceAll("</p>",""));
entity.setInitResult( entity.getInitResult().replaceAll("<p>",""));
}
R r=new R();
//加锁
Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + entity.getCreateDept(), entity.getCreateDept(), 30, TimeUnit.SECONDS);
@ -368,7 +373,9 @@ public class DefectCheckServiceImpl extends ServiceImpl<OperPhenomenonMapper, Op
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && 1==(operPhenomenonEntity.getIsWarehousing())) {
OperDefectEntity operDefectEntity = new OperDefectEntity();
BeanUtil.copy(operPhenomenonEntity, operDefectEntity);
operDefectEntity.setProcessInstanceId(operPhenomenonEntity.getHandleTaskId().toString());
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getHandleTaskId())){
operDefectEntity.setHandleTaskId(operPhenomenonEntity.getHandleTaskId());
}
if(ObjectUtil.isNotEmpty(operPhenomenonEntity.getCheckHours())){
operDefectEntity.setActHours(operPhenomenonEntity.getCheckHours());
}

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

@ -169,7 +169,6 @@ public class ImsAnalyseExampleServiceImpl extends ServiceImpl<ImsAnalyseExampleM
arrayData.addAll(dataBefore);
data.add(arrayData);
}
System.out.println("---------------- 数据详情 = " + records);
//ExcelWriter初始化
ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream())
@ -185,7 +184,6 @@ public class ImsAnalyseExampleServiceImpl extends ServiceImpl<ImsAnalyseExampleM
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/common/ExcelData.java

@ -55,10 +55,8 @@ public class ExcelData {
String operateSteps="";
//获取行数
int rows = XSSfSheet.getPhysicalNumberOfRows();
System.out.println(rows);
for(int i=0;i<rows;i++){
XSSFRow row = XSSfSheet.getRow(i);
System.out.println("行数为:"+i+";列数为:"+currentColumn);
XSSFCell cell = row.getCell(currentColumn);
String cellValue = cell.toString();
if(cellValue.equals(caseName)){
@ -79,7 +77,6 @@ public class ExcelData {
int columns = row.getPhysicalNumberOfCells();
for(int j=0;j<columns;j++){
String cell = row.getCell(j).toString();
System.out.println(cell);
}
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java

@ -156,13 +156,11 @@ public class OperMaintenanceTaskController extends BladeController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<MaintenanceExportVO> list = taskService.exportMaintenance(req);
if(list!=null && list.size()>0){
System.out.println("---------------- size = " + list.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), MaintenanceExportVO.class).autoCloseStream(Boolean.FALSE).sheet("日常维护记录统计")
.doWrite(list);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java

@ -165,6 +165,7 @@ public class OperMaintenanceTaskServiceImpl extends ServiceImpl<OperMaintenanceT
if(ObjectUtil.isNotEmpty(req.getPlanId())){
eq(OperMaintenanceTaskEntity::getPlanId,req.getPlanId());
}
eq(StringUtil.isNotBlank(req.getStationCode()),OperMaintenanceTaskEntity::getStationCode,req.getStationCode());
}};
return queryWrapper;
}

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java

@ -356,7 +356,6 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
log.info("电站发电量总览"+reportVOS.toString());
}catch (Exception e){
log.error("getStationMonthReportV2电站发电量报错", e);
System.out.println(e);
}finally {
countDownLatch.countDown();
log.info("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms");

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/utils/ArtemisPostUtils.java

@ -129,10 +129,8 @@ public class ArtemisPostUtils {
String body = jsonBody.toJSONString();
String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);
} catch (InterruptedException e) {
System.out.println("Runnable is error");
Thread.currentThread().interrupt();
}
System.out.println("Runnable running");
}
};
Thread thread = new Thread(myRunnable);

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/CommonUtils.java

@ -186,9 +186,6 @@ public class CommonUtils {
cell1.setCellStyle(valStyle);
Map dataMap = avgList.get(i).getDataMap();
for (Object o : dataMap.keySet()) {
System.out.println("测试打印:" + o + "===" + dataMap.get(o));
}
//第2格为上月平均值
Cell cell2 = row.createCell(2);
if (dataMap.get(preMonthStr) != null) {

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ExcelUtil.java

@ -96,8 +96,6 @@ public class ExcelUtil {
if(resources.length == 1) {
InputStream inputStream = resources[0].getInputStream();
inputStreamToFile(inputStream, file);
}else {
System.out.println("请检查模板文件是否存在");
}
return file;
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/ZpiUtil.java

@ -49,7 +49,6 @@ public class ZpiUtil {
out = new FileOutputStream(file.getPath());
workbook.write(out);
} catch (Exception e) {
System.out.println("出现异常");
e.printStackTrace();
}
fileList.add(file);
@ -123,7 +122,6 @@ public class ZpiUtil {
zipOut.closeEntry();
}
} catch (Exception e) {
System.out.println("压缩ZIP包出现异常");
e.printStackTrace();
} finally {
in.close();
@ -152,7 +150,6 @@ public class ZpiUtil {
}
response.flushBuffer();
} catch (IOException e) {
System.out.println("下载出现异常");
e.printStackTrace();
} finally {
fis.close();

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/config/XxlJobConfig.java

@ -45,7 +45,6 @@ public class XxlJobConfig {
xxlJobSpringExecutor.setAppname(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
System.out.println(">>>>>>>>>>> xxl-rpc, port " + port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/SafetyToolController.java

@ -1,5 +1,6 @@
package com.hnac.hzims.safeproduct.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
@ -26,6 +27,7 @@ import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil;
import org.springframework.web.bind.annotation.*;
@ -84,18 +86,13 @@ public class SafetyToolController extends BladeController {
return safetyToolService.doUpdate(safetyTool);
}
/**
* 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 40)
@ApiOperation(value = "详情", notes = "传入safetyTool")
@Operate(label = "详情", type = com.hnac.hzinfo.log.contants.BusinessType.QUERY, ignore = false)
public R<SafetyToolVO> detail(@RequestParam("id") Long id) {
SafetyToolEntity detail = safetyToolService.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{
setId(id);
}}));
return R.data(SafetyToolWrapper.build().entityVO(detail));
SafetyToolVO safetyToolVO = safetyToolService.detail(id);
return R.data(safetyToolVO);
}
/**

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java

@ -31,7 +31,7 @@ public class DangerSourceClient implements IDangerSourceClient {
@Override
@GetMapping(DETAILS)
public List<DangerSourceEntity> details(@RequestParam String[] ids) {
public List<DangerSourceEntity> details(@RequestParam("ids") String[] ids) {
List<DangerSourceEntity> resp = service.listByIds(Arrays.asList(ids));
//未查到数据返回空集合
if (CollectionUtils.isEmpty(resp)) {

27
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java

@ -69,24 +69,18 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
return this.baseMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(innerDangerEntity));
}
@Transactional(rollbackFor = Exception.class)
// @Transactional(rollbackFor = Exception.class)
@Override
public R startHiddenDanger(InnerDangerVo hiddenDangerVo) {
InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
BeanUtil.copy(hiddenDangerVo, innerDangerEntity);
saveEntity(JSONObject.toJSONString(innerDangerEntity));
InnerDangerEntity saveEntity = this.getOne(new LambdaQueryWrapper<InnerDangerEntity>() {{
eq(InnerDangerEntity::getCode, innerDangerEntity.getCode());
last("limit 1");
}});
BeanUtil.copy(saveEntity,hiddenDangerVo);
R r = this.startProcess(JSONObject.toJSONString(hiddenDangerVo), HIDDEN_DANGER_CHECK);
String saved = saveEntity(JSONObject.toJSONString(hiddenDangerVo));
R r = this.startProcess(saved, HIDDEN_DANGER_CHECK);
return r;
}
@Override
@Transactional
public String saveEntity(String entity) {
InnerDangerEntity innerDangerEntity= JSONObject.parseObject(entity, InnerDangerEntity.class);
InnerDangerVo hiddenDangerVo= JSONObject.parseObject(entity, InnerDangerVo.class);
InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
BeanUtil.copy(hiddenDangerVo, innerDangerEntity);
if (Func.isEmpty(innerDangerEntity.getCode())) {
innerDangerEntity.setCode(UUID.randomUUID().toString());
}
@ -114,7 +108,8 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
if (!save) {
throw new ServiceException("隐患保存失败,请稍后重试!");
}
return JSON.toJSONString(innerDangerEntity);
BeanUtil.copy(innerDangerEntity, hiddenDangerVo);
return JSON.toJSONString(hiddenDangerVo);
}
@Override
@ -134,15 +129,15 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
// 隐患处理名字
String userName = Optional.ofNullable(AuthUtil.getUserName()).orElse("");
// 流程名称
String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerVo.getHiddenDangerName();
String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerEntity.getHiddenDangerName();
// 开启新的隐患处理流程
Map<String, Object> variable = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(innerDangerVo, DateUtil.PATTERN_DATETIME), Map.class);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(HIDDEN_DANGER_CHECK, innerDangerVo.getId().toString(), processName, variable);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(dictValue, innerDangerVo.getId().toString(), processName, variable);
// 流程开启失败
if (!result.isSuccess()) {
innerDangerEntity.setIsNormal(false);
innerDangerEntity.setRemark(JSONObject.toJSONString(variable));
this.baseMapper.updateById(innerDangerEntity);
this.baseMapper.updateById(innerDangerVo);
log.error("隐患处理流程开启失败,错误描述 : {}", result);
R r=new R();
r.setCode(result.getCode());

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/util/ExcelConvertPdf.java

@ -43,7 +43,6 @@ public class ExcelConvertPdf {
Sheet sheet = workbook.getSheetAt(0);
int column = sheet.getRow(1).getLastCellNum();
int row = sheet.getPhysicalNumberOfRows();
System.out.println(row);
//下面是找出表格中的空行和空列
List nullCol = new ArrayList<>();
List nullRow = new ArrayList<>();
@ -76,7 +75,6 @@ public class ExcelConvertPdf {
PdfPTable table = new PdfPTable(column-sheet.getRow(1).getFirstCellNum());
List<CellRangeAddress> ranges = new ArrayList();
int sheetMergeCount = sheet.getNumMergedRegions();
System.out.println("sheetMergeCount"+sheetMergeCount);
for (int i = 0; i < sheetMergeCount; i++) {
CellRangeAddress range = sheet.getMergedRegion(i);
ranges.add(range);
@ -104,10 +102,6 @@ public class ExcelConvertPdf {
} else {
str = cell.getStringCellValue();
}
System.out.println("i ::"+i + "j::"+j);
System.out.println(str);
for (CellRangeAddress range : ranges) { //合并的单元格判断和处理
if (j >= range.getFirstColumn() && j <= range.getLastColumn() && i >= range.getFirstRow()
@ -125,7 +119,6 @@ public class ExcelConvertPdf {
rowNum = range.getLastRow() - range.getFirstRow() + 1;
colNum = range.getLastColumn() - range.getFirstColumn() + 1;
cell1 = mergeCell(str, font, rowNum, colNum);
System.out.println("合并"+rowNum+"、"+colNum);
table.addCell(cell1);
flag = false;
mergeFlag = ranges.size() > 1;

6
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hiddenDanger/service/impl/HiddenDangerPlanServiceImpl.java

@ -9,15 +9,19 @@ import com.hnac.hzims.safeproduct.hiddenDanger.mapper.HiddenDangerPlanMapper;
import com.hnac.hzims.safeproduct.hiddenDanger.service.IHiddenDangerPlanService;
import com.hnac.hzims.safeproduct.hiddenDanger.service.IPlanCheckItemService;
import com.hnac.hzims.safeproduct.hiddenDanger.vo.HDPlanVO;
import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.HDPlanWrapper;
import com.hnac.hzims.safeproduct.hiddenDanger.wrapper.PlanCheckItemWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@Service
@ -65,7 +69,7 @@ public class HiddenDangerPlanServiceImpl extends ServiceImpl<HiddenDangerPlanMap
@Override
public HDPlanVO detail(Long id) {
HDPlanEntity plan = this.getById(id);
HDPlanVO planVO = BeanUtil.copy(plan, HDPlanVO.class);
HDPlanVO planVO = HDPlanWrapper.build().entityVO(plan);
List<PlanCheckItemEntity> checkItemList = planCheckItemService.list(Wrappers.<PlanCheckItemEntity>lambdaQuery().eq(PlanCheckItemEntity::getPlanId, id));
planVO.setCheckItemVOS(PlanCheckItemWrapper.build().listVO(checkItemList));
return planVO;

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarMaintenanceMapper.xml

@ -35,7 +35,7 @@
AND t1.start_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND t1.end_time &lt;= #{param.startTime}
AND t1.start_time &lt;= #{param.endTime}
</if>
<if test="param.carId != null and param.carId != ''">
AND t1.car_id = #{param.carId}

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml

@ -27,11 +27,11 @@
<if test="param.conferencePlanId != null and param.conferencePlanId != ''">
AND t2.id = #{param.conferencePlanId}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND t1.actualStartTime >= #{param.startTime}
<if test="param.actualStartTime != null and param.actualStartTime != ''">
AND t1.actual_start_time >= #{param.actualStartTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND t1.actualEndTime &lt;= #{param.endTime}
<if test="param.actualEndTime != null and param.actualEndTime != ''">
AND t1.actual_end_time &lt;= #{param.actualEndTime}
</if>
<if test="param.unit != null and param.unit != ''">
AND t2.unit like concat('%', #{param.unit}, '%')

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ISafetyToolService.java

@ -45,4 +45,11 @@ public interface ISafetyToolService extends IService<SafetyToolEntity> {
* @return
*/
R remove(List<Long> idList);
/**
* 详情
* @param id 安全工器具id
* @return 安全工器具VO类
*/
SafetyToolVO detail(Long id);
}

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarMaintenanceServiceImpl.java

@ -16,7 +16,6 @@ import com.hnac.hzims.safeproduct.enums.CarMaintenanceTypeEnum;
import com.hnac.hzims.safeproduct.mapper.CarMaintenanceMapper;
import com.hnac.hzims.safeproduct.mapper.CarMapper;
import com.hnac.hzims.safeproduct.service.ICarMaintenanceService;
import com.hnac.hzims.safeproduct.service.ICarService;
import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarMaintenanceDetailVO;
import com.hnac.hzims.safeproduct.vo.CarMaintenancePageVO;

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java

@ -29,10 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -254,7 +251,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
.registerConverter(new LongStringConverter())
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25))
.build();
// 排除时间字段
Set<String> excludeSets = new HashSet<>();
excludeSets.add("createTime");
WriteSheet writeSheet = EasyExcel.writerSheet(1, "年度里程统计表").head(CarMilesYearVO.class)
.excludeColumnFieldNames(excludeSets)
.build();
excelWriter.write(list, writeSheet);
excelWriter.finish();

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/SafetyToolServiceImpl.java

@ -38,6 +38,7 @@ 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.api.ResultCode;
import org.springblade.core.tool.utils.*;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
@ -275,6 +276,20 @@ public class SafetyToolServiceImpl extends ServiceImpl<SafetyToolMapper, SafetyT
return R.status(removeByIds(idList));
}
/**
* 详情
*/
@Override
public SafetyToolVO detail(Long id) {
SafetyToolEntity detail = this.getOne(Condition.getQueryWrapper(new SafetyToolEntity() {{
setId(id);
}}));
if (cn.hutool.core.util.ObjectUtil.isEmpty(detail)) {
throw new ServiceException(ResultCode.REQ_REJECT, "没有访问该安全工器具的权限");
}
return SafetyToolWrapper.build().entityVO(detail);
}
/**
* 工器具Code唯一性校验

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/HtmltoPdf.java

@ -111,7 +111,6 @@ public class HtmltoPdf {
public static String getCurrentOperatingSystem(){
String os = System.getProperty("os.name").toLowerCase();
System.out.println("---------当前操作系统是-----------" + os);
return os;
}

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/ZXingGenCode.java

@ -47,9 +47,6 @@ public class ZXingGenCode {
Result result = null;
try {
image = ImageIO.read(new File(imgPath));
if (image == null) {
System.out.println("the decode image may be not exit.");
}
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

3
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/vo/SystemFileVO.java

@ -15,6 +15,9 @@ public class SystemFileVO extends SystemFileEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("创建人ID")
private Long createUserId;
@ApiModelProperty("创建人名称")
private String createUserName;

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/SystemFileWrapper.java

@ -24,6 +24,7 @@ public class SystemFileWrapper extends BaseEntityWrapper<SystemFileEntity, Syste
SystemFileVO vo = BeanUtil.copy(entity, SystemFileVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserId(entity.getCreateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));
vo.setUpdateUserName(Optional.ofNullable(updateUser).map(User::getName).orElse(null));
return vo;

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java

@ -123,13 +123,9 @@ public class OperationTicketController {
businessMessageDTO.setUserIds(userIds);
businessMessageDTO.setCreateUser(1522897714092781569L);
System.out.println("businessMessageDTO = " + businessMessageDTO);
R<Boolean> booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败");
}else {
System.out.println("推送成功");
}
}

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java

@ -123,14 +123,11 @@ public class StandardTicketInfoController extends BladeController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<StandardTicketExportVO> list = standardTicketInfoService.exportStandardTicket(req);
if(list!=null && list.size()>0){
System.out.println("---------------- size = " + list.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), StandardTicketExportVO.class).autoCloseStream(Boolean.FALSE).sheet("操作票统计报表")
.doWrite(list);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");

1
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -901,7 +901,6 @@ public class StandardTicketInfoServiceImpl extends ServiceImpl<StandardTicketInf
}
} catch (Exception e) {
log.error("转换失败----》" + e + standardTicketInfoEntity.toString());
System.out.println("转换失败----》" + e + standardTicketInfoEntity);
}
return exportVO;
}).collect(Collectors.toList());

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

@ -469,8 +469,6 @@ public class TicketProcessServiceImpl implements TicketProcessService, StartProc
item.setTicketId(workTicketInfo.getId());
return item;
}).collect(Collectors.toList());
System.out.println("工作票危险点分析及控制措施票 : " + collect);
ticketInfoDangerService.saveBatch(collect);
}
}
@ -497,9 +495,6 @@ public class TicketProcessServiceImpl implements TicketProcessService, StartProc
String userIds = response.getUserId();
businessMessageDTO.setUserIds(userIds);
businessMessageDTO.setCreateUser(workTicketInfo.getCreateUser());
System.out.println("======================================================");
System.out.println("businessMessageDTO = " + businessMessageDTO);
System.out.println("======================================================");
R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败");

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ExcelUtil.java

@ -97,8 +97,6 @@ public class ExcelUtil {
if(resources.length == 1) {
InputStream inputStream = resources[0].getInputStream();
inputStreamToFile(inputStream, file);
}else {
System.out.println("请检查模板文件是否存在");
}
return file;
}

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/controller/WorkTicketInfoController.java

@ -155,13 +155,11 @@ public class WorkTicketInfoController {
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<WorkTicketExportVO> list = workTicketInfoService.exportWorkTicket(req);
if(list!=null && list.size()>0){
System.out.println("---------------- size = " + list.size());
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), WorkTicketExportVO.class).autoCloseStream(Boolean.FALSE).sheet("工作票统计报表")
.doWrite(list);
}
} catch (Exception e) {
System.out.println("exportExcel = " + e);
// 重置response
response.reset();
response.setContentType("application/json");

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

@ -1018,7 +1018,6 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
// System.out.println("获取classGroupMembers ==> " + classGroupMembers);
String[] split = classGroupMembers.split(",");
for (String classGroupMember : split) {
System.out.println(classGroupMember);
if (StringUtils.isNoneBlank(classGroupMember)) {
boolean matches = classGroupMember.matches("[0-9]+");
if (matches) {
@ -1314,7 +1313,6 @@ public class WorkTicketInfoServiceImpl extends ServiceImpl<WorkTicketInfoMapper,
}
return resEntity;
} catch (Exception e) {
System.out.println(e);
log.error("数据转换失败,参数:"+workTicketInfoVO+"报错信息:"+e);
return new WorkTicketExportVO();
}

9
hzims-service/ticket/src/main/resources/db/3.0.0.sql

@ -11,3 +11,12 @@ ALTER TABLE `hzims_work_ticket_info`
ALTER TABLE `hzims_standard_ticket_info`
ADD COLUMN `em_code` varchar(255) NULL COMMENT '设备编号' ,
ADD COLUMN `em_name` varchar(255) NULL COMMENT '设备名称' ;
ALTER TABLE `hzims_oper_defect`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT NULL COMMENT '工作票ID';
ALTER TABLE `hzims_oper_defect_statistics`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT '' COMMENT '工作票ID' ;
ALTER TABLE `hzims_oper_appearance`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT NULL COMMENT '工作票ID';

1
hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/XxlJobConfig.java

@ -45,7 +45,6 @@ public class XxlJobConfig {
xxlJobSpringExecutor.setAppname(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
System.out.println(">>>>>>>>>>> xxl-rpc, port " + port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);

Loading…
Cancel
Save