Browse Source

新增票据模板浏览及站点编号唯一效验

zhongwei
段飞宇 1 year ago
parent
commit
f7d13453dd
  1. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java
  2. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java
  3. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java
  4. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java
  5. 2
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java
  6. 0
      hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql
  7. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
  8. 311
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  9. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  10. 29
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  11. 20
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java
  12. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java
  13. 973
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/impl/TicketMatterGroupServiceImpl.java
  14. 24
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  15. 10
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java
  16. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  17. 0
      hzims-service/ticket/src/main/resources/db/1.0.0.sql

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java

@ -47,7 +47,7 @@ public class DefectProcessServiceImpl extends ProcessAbstractService {
log.info("已执行消缺工作流程环节操作~~~~"); log.info("已执行消缺工作流程环节操作~~~~");
return true; return true;
} }
log.error("未是否执行消缺工作流流程环节操作,请联系管理员~~~~"); log.error("未执行消缺工作流流程环节操作,请联系管理员~~~~");
return false; return false;
} }

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java

@ -50,7 +50,7 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
log.info("已执行水力机械工作票流程环节操作~~~~"); log.info("已执行水力机械工作票流程环节操作~~~~");
return true; return true;
} }
log.error("未是否执行水力机械工作票流程环节操作,请联系管理员~~~~"); log.error("未执行水力机械工作票流程环节操作,请联系管理员~~~~");
return false; return false;
} }

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java

@ -47,7 +47,7 @@ public class MaintenanceProcessServiceImpl extends ProcessAbstractService {
log.info("已执行日常维护流程环节操作~~~~"); log.info("已执行日常维护流程环节操作~~~~");
return true; return true;
} }
log.error("未是否执行日常维护流程环节操作,请联系管理员~~~~"); log.error("未执行日常维护流程环节操作,请联系管理员~~~~");
return false; return false;
} }

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java

@ -55,7 +55,7 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService {
log.info("已执行工作票流程环节操作~~~~"); log.info("已执行工作票流程环节操作~~~~");
return true; return true;
} }
log.error("未是否执行工作票流程环节操作,请联系管理员~~~~"); log.error("未执行工作票流程环节操作,请联系管理员~~~~");
return false; return false;
} }

2
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java

@ -51,7 +51,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
log.info("已执行操作票流程环节操作~~~~"); log.info("已执行操作票流程环节操作~~~~");
return true; return true;
} }
log.error("未是否执行操作票流程环节操作,请联系管理员~~~~"); log.error("未执行操作票流程环节操作,请联系管理员~~~~");
return false; return false;
} }

0
hzims-service/hzims-middle/src/main/resources/db/newsql.sql → hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql

27
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.maintenance.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -128,7 +129,10 @@ public class MaintenanceServiceImpl implements MaintenanceService {
OperMaintenanceTaskEntityVo standardTicketInfoVo = null; OperMaintenanceTaskEntityVo standardTicketInfoVo = null;
try { try {
JSONObject jsonObject = JSONObject.parseObject(formData); JSONObject jsonObject = JSONObject.parseObject(formData);
standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class); standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("operMaintenanceTaskEntityVo"),
new TypeReference<OperMaintenanceTaskEntityVo>(){});
// standardTicketInfoVo = (OperMaintenanceTaskEntityVo) jsonObject.get("operMaintenanceTaskEntityVo");
// standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class);
} catch (Exception e) { } catch (Exception e) {
log.error("获取表单出现异常了~~~~"); log.error("获取表单出现异常了~~~~");
throw new IllegalArgumentException(e.getMessage()); throw new IllegalArgumentException(e.getMessage());
@ -140,8 +144,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
log.error("获取日常维护数据不存在"); log.error("获取日常维护数据不存在");
return; return;
} }
OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity(); OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity();
BeanUtils.copyProperties(standardTicketInfoVo,entity); BeanUtils.copyProperties(standardTicketInfoVo, entity);
entity.setId(id); entity.setId(id);
//填充日常维护信息 //填充日常维护信息
saveOperMaintenanceTaskEntity(entity, response); saveOperMaintenanceTaskEntity(entity, response);
@ -211,7 +215,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
log.info("================================================"); log.info("================================================");
R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) { if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败"); throw new ServiceException("消息推送失败");
} }
log.info("推送成功~"); log.info("推送成功~");
} }
@ -220,6 +224,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
/** /**
* 填充日常维护信息 * 填充日常维护信息
*
* @param entity * @param entity
* @param response * @param response
*/ */
@ -228,7 +233,9 @@ public class MaintenanceServiceImpl implements MaintenanceService {
//如果response.getHandleType() 是0使用户 //如果response.getHandleType() 是0使用户
entity.setFlowUserId(response.getUserId()); entity.setFlowUserId(response.getUserId());
entity.setNextStepOperator(response.getNextStepOperator()); entity.setNextStepOperator(response.getNextStepOperator());
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); if (response.getNextStepOperator() != null) {
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批");
}
//如果taskId为空 //如果taskId为空
String taskId = response.getTaskId(); String taskId = response.getTaskId();
if (StringUtils.isEmpty(taskId)) { if (StringUtils.isEmpty(taskId)) {
@ -319,7 +326,6 @@ public class MaintenanceServiceImpl implements MaintenanceService {
} }
/** /**
* 开启一个流程实例 * 开启一个流程实例
* *
@ -327,8 +333,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
**/ **/
private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) { private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) {
OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo(); OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo();
BeanUtils.copyProperties(taskEntity,operMaintenanceTaskEntityVo); BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo);
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("taskId", taskEntity.getId()); params.put("taskId", taskEntity.getId());
List<String> userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); List<String> userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList());
String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> { String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> {
@ -338,16 +344,15 @@ public class MaintenanceServiceImpl implements MaintenanceService {
params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo);
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey,
String.valueOf(taskEntity.getId()),taskEntity.getTitle(), params) String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params)
.getData() .getData()
.getProcessInstanceId(); .getProcessInstanceId();
} }
/** /**
* 推送日常维护任务消息 * 推送日常维护任务消息
*
* @return void * @return void
* @Param taskEntity 日常维护任务 * @Param taskEntity 日常维护任务
**/ **/

311
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.controller; package com.hnac.hzims.operational.station.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -13,6 +13,7 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.vo.StationVO; import com.hnac.hzims.operational.station.vo.StationVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -44,47 +45,47 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("/station") @RequestMapping("/station")
@AllArgsConstructor @AllArgsConstructor
@Api(value = "站点",tags = "站点管理") @Api(value = "站点", tags = "站点管理")
@Slf4j @Slf4j
public class StationController extends BladeController { public class StationController extends BladeController {
private final IStationService stationService; private final IStationService stationService;
private final HzimsDataService dataServicel; private final HzimsDataService dataServicel;
private final IMainSystemMonitoringService mainSystemMonitoringService; private final IMainSystemMonitoringService mainSystemMonitoringService;
/** /**
* 分页 代码自定义代号 * 分页 代码自定义代号
*/ */
@ApiLog @ApiLog
@RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
@ApiOperation(value = "分页", notes = "传入StationEntity") @ApiOperation(value = "分页", notes = "传入StationEntity")
@OperationAnnotation( @OperationAnnotation(
moduleName = "站点管理", moduleName = "站点管理",
title = "水电站点管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, title = "水电站点管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,
action = "分页查询") action = "分页查询")
public R<IPage<StationVO>> list(StationEntity entity, Query query) { public R<IPage<StationVO>> list(StationEntity entity, Query query) {
IPage<StationVO> vos = stationService.list(entity,query); IPage<StationVO> vos = stationService.list(entity, query);
return R.data(vos); return R.data(vos);
} }
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
// @ApiOperationSupport(order = 60) // @ApiOperationSupport(order = 60)
@ApiOperation(value = "查看详情", notes = "查看详情") @ApiOperation(value = "查看详情", notes = "查看详情")
public R<StationEntity> detail(@PathVariable @ApiParam("主键ID") Long id) { public R<StationEntity> detail(@PathVariable @ApiParam("主键ID") Long id) {
return R.data(stationService.getById(id)); return R.data(stationService.getById(id));
} }
/** /**
* 新增 * 新增
*/ */
@PostMapping("/save") @PostMapping("/save")
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation(value = "新增") @ApiOperation(value = "新增")
public R save(@Valid @RequestBody StationEntity req) { public R save(@Valid @RequestBody StationEntity req) {
stationService.buildStation(req); stationService.buildStation(req);
return R.success("保存成功!"); return R.success("保存成功!");
// List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>(){{ // List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>(){{
// eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()); // eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName());
// }}); // }});
@ -96,124 +97,136 @@ public class StationController extends BladeController {
// return "success"; // return "success";
// }); // });
// return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.save(req)); // return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.save(req));
} }
/** /**
* 修改 代码自定义代号 * 修改 代码自定义代号
*/ */
@PostMapping("/update") @PostMapping("/update")
@ApiOperationSupport(order = 30) @ApiOperationSupport(order = 30)
@ApiOperation(value = "修改", notes = "传入StationEntity") @ApiOperation(value = "修改", notes = "传入StationEntity")
public R update(@Valid @RequestBody StationEntity req) { public R update(@Valid @RequestBody StationEntity req) {
stationService.buildStation(req); stationService.buildStation(req);
return R.success("修改成功!"); return R.success("修改成功!");
// LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<StationEntity>(); // LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<StationEntity>();
// queryWrapper.ne(StationEntity::getId,req.getId()); // queryWrapper.ne(StationEntity::getId,req.getId());
// queryWrapper.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName())); // queryWrapper.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()));
// List<StationEntity> list = stationService.list(queryWrapper); // List<StationEntity> list = stationService.list(queryWrapper);
// return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.updateById(req)); // return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.updateById(req));
} }
@PostMapping("/instanceProject") @PostMapping("/instanceProject")
@ApiOperationSupport(order = 60) @ApiOperationSupport(order = 60)
@ApiOperation(value = "实例化实时画面项目", notes = "站点信息") @ApiOperation(value = "实例化实时画面项目", notes = "站点信息")
public R<Boolean> instanceProject(@RequestBody StationEntity req) { public R<Boolean> instanceProject(@RequestBody StationEntity req) {
return R.status(stationService.instanceProject(req)); return R.status(stationService.instanceProject(req));
} }
@PostMapping("/updateBatch") @PostMapping("/updateBatch")
@ApiOperationSupport(order = 30) @ApiOperationSupport(order = 30)
@ApiOperation(value = "批量修改", notes = "传入站点列表") @ApiOperation(value = "批量修改", notes = "传入站点列表")
public R updateBatch(@RequestBody List<StationEntity> req) { public R updateBatch(@RequestBody List<StationEntity> req) {
for (StationEntity stationEntity : req) { for (StationEntity stationEntity : req) {
if(StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) { if (StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) {
List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>(){{ List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getCode,stationEntity.getCode()).or().eq(StationEntity::getName,stationEntity.getName()); eq(StationEntity::getCode, stationEntity.getCode()).or().eq(StationEntity::getName, stationEntity.getName());
}}); }});
Assert.isTrue(CollectionUtil.isEmpty(list),()->{ Assert.isTrue(CollectionUtil.isEmpty(list), () -> {
throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理"); throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理");
}); });
} }
} }
return R.status(stationService.updateBatchById(req)); return R.status(stationService.updateBatchById(req));
} }
/** /**
* 删除 代码自定义代号 * 删除 代码自定义代号
*/ */
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "逻辑删除", notes = "传入id") @ApiOperation(value = "逻辑删除", notes = "传入id")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(stationService.removeStation(ids)); return R.status(stationService.removeStation(ids));
} }
@GetMapping("/getStationByCode") @GetMapping("/getStationByCode")
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation(value = "通过站点编码获取站点", notes = "传入站点code") @ApiOperation(value = "通过站点编码获取站点", notes = "传入站点code")
public R<StationVO> getStationByCode(@RequestParam("code") String code){ public R<StationVO> getStationByCode(@RequestParam("code") String code) {
return R.data(stationService.getStationByCode(code)); return R.data(stationService.getStationByCode(code));
} }
@ApiLog @ApiLog
@GetMapping(value = "/getList") @GetMapping(value = "/getList")
@ApiOperationSupport(order = 70) @ApiOperationSupport(order = 70)
@ApiOperation(value = "获取站点列表(不分页查询)", notes = "传入StationEntity") @ApiOperation(value = "获取站点列表(不分页查询)", notes = "传入StationEntity")
public R<List<StationEntity>> getList(StationEntity entity) { public R<List<StationEntity>> getList(StationEntity entity) {
LambdaQueryWrapper<StationEntity> lwq = Condition.getQueryWrapper(new StationEntity(),entity); LambdaQueryWrapper<StationEntity> lwq = Condition.getQueryWrapper(new StationEntity(), entity);
if(Func.isNotEmpty(entity.getStatus())) { if (Func.isNotEmpty(entity.getStatus())) {
lwq.eq(StationEntity::getStatus,entity.getStatus()); lwq.eq(StationEntity::getStatus, entity.getStatus());
} }
return R.data(stationService.list(lwq)); return R.data(stationService.list(lwq));
} }
@ApiLog @ApiLog
@GetMapping("/list/all") @GetMapping("/list/all")
@ApiOperationSupport(order = 80) @ApiOperationSupport(order = 80)
@ApiOperation(value = "查询所有", notes = "") @ApiOperation(value = "查询所有", notes = "")
public R<List<StationEntity>> listAll(){ public R<List<StationEntity>> listAll() {
return R.data(stationService.getAll()); return R.data(stationService.getAll());
} }
@ApiLog @ApiLog
@GetMapping("/listByServeType") @GetMapping("/listByServeType")
@ApiOperationSupport(order = 90) @ApiOperationSupport(order = 90)
@ApiOperation(value = "根据服务类型查询站点", notes = "") @ApiOperation(value = "根据服务类型查询站点", notes = "")
public R<List<StationEntity>> listByServeType(@RequestParam("serveType") Integer serveType){ public R<List<StationEntity>> listByServeType(@RequestParam("serveType") Integer serveType) {
return R.data(stationService.doListByServeType(serveType)); return R.data(stationService.doListByServeType(serveType));
} }
@ApiLog @ApiLog
@GetMapping("/listByType") @GetMapping("/listByType")
@ApiOperationSupport(order = 90) @ApiOperationSupport(order = 90)
@ApiOperation(value = "根据服务类型查询站点", notes = "") @ApiOperation(value = "根据服务类型查询站点", notes = "")
public R<List<StationEntity>> listByType(){ public R<List<StationEntity>> listByType() {
//获取水电站及泵站 //获取水电站及泵站
String type = "0,2"; String type = "0,2";
List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
in(StationEntity::getType, Func.toStrList(type)); in(StationEntity::getType, Func.toStrList(type));
}}); }});
/*BladeUser user = AuthUtil.getUser(); /*BladeUser user = AuthUtil.getUser();
if(user.getAccount().equals("admin")){ if(user.getAccount().equals("admin")){
return R.data(stationService.doListByTypes()); return R.data(stationService.doListByTypes());
} }
List<StationEntity> list = mainSystemMonitoringService.classifyUserDataScopeType(null, null, Func.toStrList(type));*/ List<StationEntity> list = mainSystemMonitoringService.classifyUserDataScopeType(null, null, Func.toStrList(type));*/
return R.data(list); return R.data(list);
} }
@ApiLog
@GetMapping("/getHomeStationList") @ApiLog
@ApiOperationSupport(order = 91) @GetMapping("/getHomeStationList")
@ApiOperation(value = "获取首页站点列表", notes = "") @ApiOperationSupport(order = 91)
public R<List<StationEntity>> getHomeStationList(@RequestParam(value = "deptId",required = false) Long deptId,@RequestParam(value = "types",required = false) List<Integer> types,@RequestParam(value = "serveType",required = false) Integer serveType){ @ApiOperation(value = "获取首页站点列表", notes = "")
return R.data(stationService.getHomeStationList(deptId,types,serveType)); public R<List<StationEntity>> getHomeStationList(@RequestParam(value = "deptId", required = false) Long deptId, @RequestParam(value = "types", required = false) List<Integer> types, @RequestParam(value = "serveType", required = false) Integer serveType) {
} return R.data(stationService.getHomeStationList(deptId, types, serveType));
}
@ApiLog
@GetMapping("/select") @ApiLog
@ApiOperationSupport(order = 1) @GetMapping("/select")
@ApiOperation(value = "下拉站点列表", notes = "") @ApiOperationSupport(order = 1)
public R<List<StationEntity>> select(@RequestParam(value = "type",required = false) Integer type,@RequestParam(value = "serveType",required = false) Integer serveType){ @ApiOperation(value = "下拉站点列表", notes = "")
return R.data(stationService.select(type,serveType)); public R<List<StationEntity>> select(@RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "serveType", required = false) Integer serveType) {
} return R.data(stationService.select(type, serveType));
}
/**
* 两票编号抬头唯一效验
*/
@ApiModelProperty("两票编号抬头唯一效验")
@GetMapping("/uniqueStationByStation")
public R uniqueStationByStation(@RequestParam(value = "signage") String signage) {
stationService.uniqueStationByStation(signage);
return R.success("两票编号抬头不存在,可以创建");
}
} }

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java

@ -125,4 +125,13 @@ public interface IStationService extends BaseService<StationEntity> {
* @return 站点 * @return 站点
*/ */
StationEntity getOne(StationEntity request); StationEntity getOne(StationEntity request);
/**
* 两票编号抬头唯一效验
* @param signage 站点编号
* @return
*/
void uniqueStationByStation(String signage);
} }

29
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.service.impl; package com.hnac.hzims.operational.station.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -98,8 +98,8 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
}); });
// 如果设备数据来源未选定其他 则进行站点初始化操作 // 如果设备数据来源未选定其他 则进行站点初始化操作
if (!StationConstants.HZ3000_OTHER.equals(req.getDataSource())) { if (!StationConstants.HZ3000_OTHER.equals(req.getDataSource())) {
new Thread(()->questionClient.submitStationInfo(req.getCode(), ""),"智能诊断站点推送").start(); new Thread(() -> questionClient.submitStationInfo(req.getCode(), ""), "智能诊断站点推送").start();
new Thread(()->this.instanceProject(req),"新建项目").start(); new Thread(() -> this.instanceProject(req), "新建项目").start();
} }
} }
@ -138,21 +138,21 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
R<Dept> deptResult = sysClient.getDept(stationEntity.getRefDept()); R<Dept> deptResult = sysClient.getDept(stationEntity.getRefDept());
if (deptResult.isSuccess() && ObjectUtil.isNotEmpty(deptResult.getData())) { if (deptResult.isSuccess() && ObjectUtil.isNotEmpty(deptResult.getData())) {
R<Void> projectResult = deptClient.deleteDeptById(stationEntity.getRefDept()); R<Void> projectResult = deptClient.deleteDeptById(stationEntity.getRefDept());
if(!projectResult.isSuccess()) { if (!projectResult.isSuccess()) {
logger.info("hzims-operational:station:removeStation", stationEntity.getRefDept() + "所属机构删除失败,报错信息为:" + projectResult.getMsg()); logger.info("hzims-operational:station:removeStation", stationEntity.getRefDept() + "所属机构删除失败,报错信息为:" + projectResult.getMsg());
} }
} }
// 清空 // 清空
} }
new Thread(()-> { new Thread(() -> {
// 删除站点下集中监控属性配置 // 删除站点下集中监控属性配置
stationAttributeService.removeByStationCode(stationEntity.getCode()); stationAttributeService.removeByStationCode(stationEntity.getCode());
// 删除智能诊断站点 // 删除智能诊断站点
questionClient.deleteStationInfo(stationEntity.getCode()); questionClient.deleteStationInfo(stationEntity.getCode());
// 删除智能诊断实例图信息 // 删除智能诊断实例图信息
questionClient.deleteStationAnswer(stationEntity.getCode()); questionClient.deleteStationAnswer(stationEntity.getCode());
},"删除站点集中监控属性").start(); }, "删除站点集中监控属性").start();
return saveFlag; return saveFlag;
} }
@ -692,4 +692,21 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
// stationEntityList.stream().map(StationEntity::getCode).forEach(code -> projectClient.delete()); // stationEntityList.stream().map(StationEntity::getCode).forEach(code -> projectClient.delete());
// } // }
} }
/**
* 两票编号抬头唯一效验
*
* @param signage 站点编号
* @return
*/
@Override
public void uniqueStationByStation(String signage) {
LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StationEntity::getSignage, signage);
Integer count = baseMapper.selectCount(queryWrapper);
if (count > 0){
throw new ServiceException("两票编号抬头已存在");
}
}
} }

20
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java

@ -13,10 +13,7 @@ import com.hnac.hzims.ticket.library.vo.TicketMatterGroupVO;
import com.hnac.hzims.ticket.library.wrapper.TicketMatterGroupWrapper; import com.hnac.hzims.ticket.library.wrapper.TicketMatterGroupWrapper;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
import io.swagger.annotations.Api; import io.swagger.annotations.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
@ -114,4 +111,19 @@ public class TicketMatterGroupController extends BladeController {
public void preview(@RequestParam("id") Long id, @RequestParam("type") String type , HttpServletResponse response) throws Exception { public void preview(@RequestParam("id") Long id, @RequestParam("type") String type , HttpServletResponse response) throws Exception {
service.preview(id, type, response); service.preview(id, type, response);
} }
/**
* 票据模板预览
*/
@GetMapping(value = "/newPreview/{id}/{type}/{status}")
@ApiOperationSupport(order = 70)
@ApiOperation(value = "票据模板预览")
public void newPreview(@ApiParam(name = "id",value = "编号") @PathVariable Long id,
@ApiParam(name = "type",value = "模板类型:2为工作票;1为操作票") @PathVariable Integer type,
@ApiParam(name = "status",value = "具体的模板") @PathVariable Integer status,
HttpServletResponse response){
service.newPreview(id, type,status, response);
}
} }

10
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java

@ -52,4 +52,14 @@ public interface ITicketMatterGroupService extends BaseService<TicketMatterGroup
* @param id * @param id
*/ */
void preview(Long id, String type, HttpServletResponse response) throws Exception; void preview(Long id, String type, HttpServletResponse response) throws Exception;
/**
* 票据模板预览
* @param id 编号
* @param type 模板类型2为工作票1为操作票
* @param status 模板状态
* @param response
*/
void newPreview(Long id, Integer type, Integer status, HttpServletResponse response);
} }

973
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/impl/TicketMatterGroupServiceImpl.java

File diff suppressed because it is too large Load Diff

24
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -3,12 +3,12 @@ package com.hnac.hzims.ticket.standardTicket.service.impl;
import cn.afterturn.easypoi.word.WordExportUtil; import cn.afterturn.easypoi.word.WordExportUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.BusinessMessageDTO; import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.feign.ProcessDictFeignService; import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
@ -39,8 +39,6 @@ import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.entity.BladeFlow;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
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.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -50,7 +48,10 @@ import javax.servlet.http.HttpServletResponse;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -166,7 +167,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
StandardTicketInfoVo standardTicketInfoVo = null; StandardTicketInfoVo standardTicketInfoVo = null;
try { try {
JSONObject jsonObject = JSONObject.parseObject(formData); JSONObject jsonObject = JSONObject.parseObject(formData);
standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class);
standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"),
new TypeReference<StandardTicketInfoVo>(){});
} catch (Exception e) { } catch (Exception e) {
log.error("获取表单出现异常了~~~~"); log.error("获取表单出现异常了~~~~");
e.printStackTrace(); e.printStackTrace();
@ -182,7 +185,8 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//设置id //设置id
StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity(); StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity();
BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity); // BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity);
BeanUtil.copy(standardTicketInfoVo, newStandardTicketInfoEntity);
newStandardTicketInfoEntity.setId(id); newStandardTicketInfoEntity.setId(id);
newStandardTicketInfoEntity.setCreateUser(standardTicketInfoEntity.getCreateUser()); newStandardTicketInfoEntity.setCreateUser(standardTicketInfoEntity.getCreateUser());
//填充操作票信息 //填充操作票信息
@ -258,12 +262,12 @@ public class OperationTicketServiceImpl implements OperationTicketService {
businessMessageDTO.setUserIds(userIds); businessMessageDTO.setUserIds(userIds);
businessMessageDTO.setCreateUser(newStandardTicketInfoEntity.getCreateUser()); businessMessageDTO.setCreateUser(newStandardTicketInfoEntity.getCreateUser());
System.out.println("================================================"); log.info("================================================");
System.out.println("businessMessageDTO = " + businessMessageDTO); log.info("businessMessageDTO = " + businessMessageDTO);
System.out.println("================================================"); log.info("================================================");
R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
if (!booleanR.isSuccess()) { if (!booleanR.isSuccess()) {
throw new ServiceException("消息推送失败"); throw new ServiceException("消息推送失败");
} }
log.info("推送成功~"); log.info("推送成功~");
} }

10
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java

@ -4,6 +4,7 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/** /**
* 开票处理流程接口 * 开票处理流程接口
@ -36,4 +37,13 @@ public interface TicketProcessService {
* @return * @return
*/ */
void newPreview(Long ticketId, Integer status, HttpServletResponse response); void newPreview(Long ticketId, Integer status, HttpServletResponse response);
/**
* * value true转 false转
* @param dataConversion
* @param key
* @param value
*/
public void getDataConversion(Map<String, Object> dataConversion, String key, Object value);
} }

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

@ -1284,8 +1284,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if (StringUtils.isNoneBlank(newValue)) { if (StringUtils.isNoneBlank(newValue)) {
dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□"); dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□");
} }
} }
/** /**

0
hzims-service/ticket/src/main/resources/db/newsql.sql → hzims-service/ticket/src/main/resources/db/1.0.0.sql

Loading…
Cancel
Save