diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java index 27345a2..eac70ff 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java @@ -139,4 +139,7 @@ public class OperAccessTaskEntity extends TenantEntity { @ApiModelProperty(value = "创建用户名称") private String updateUserName; + + @ApiModelProperty(value = "创建用户名称") + private Long constructionId; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java index 8c138e0..deed5fb 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperConstructionEntity.java @@ -1,5 +1,6 @@ package com.hnac.hzims.operational.access.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -80,4 +81,8 @@ public class OperConstructionEntity extends TenantEntity { @ApiModelProperty(value = "审核人名称") private String reviewerName; + @ApiModelProperty(value = "检修Id") + @TableField(exist = false) + private Long taskId; + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java index 4829bc6..d8f3950 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/ConstructionController.java @@ -16,13 +16,11 @@ import org.springblade.core.boot.ctrl.BladeController; 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.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import java.util.Date; /** @@ -41,9 +39,7 @@ public class ConstructionController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "新增") public R save(@RequestBody OperConstructionEntity entity) { - entity.setCode("SGRZ" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI)); - entity.setConstructionTime(entity.getOverhaulTime()); - return R.status(service.save(entity)); + return R.status(service.accessSave(entity)); } @PostMapping("/remove") @@ -53,15 +49,22 @@ public class ConstructionController extends BladeController { return R.status(service.deleteLogic(Func.toLongList(ids))); } - @PostMapping("/update") + @GetMapping("/detail") @ApiOperationSupport(order = 3) + @ApiOperation(value = "详情查询") + public R detail(@ApiParam(value = "主键Id", required = true) @RequestParam Long id) { + return R.data(service.getById(id)); + } + + @PostMapping("/update") + @ApiOperationSupport(order = 4) @ApiOperation(value = "修改") public R update(@Valid @RequestBody OperConstructionEntity entity) { return R.status(service.updateById(entity)); } @GetMapping("/list") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 5) @OperationAnnotation(moduleName = "施工日志",title = "施工日志",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, action = "分页查询施工日志") @@ -71,7 +74,7 @@ public class ConstructionController extends BladeController { } @GetMapping("/preview") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @ApiOperation(value = "检修施工日志预览", notes = "检修施工日志预览") public void preview(@RequestParam @ApiParam("检修施工记录Id") @NotNull @Valid Long id) { service.preview(id); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java index a70cedc..575a60a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/ConstructionService.java @@ -12,6 +12,7 @@ import org.springblade.core.tool.api.R; */ public interface ConstructionService extends BaseService { + boolean accessSave(OperConstructionEntity entity); IPage pageCondition(IPage page, ConstructionVo construction); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java index d9a0fed..b16da12 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/ConstructionServiceImpl.java @@ -4,12 +4,14 @@ import cn.afterturn.easypoi.entity.ImageEntity; import cn.afterturn.easypoi.word.WordExportUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperConstructionEntity; import com.hnac.hzims.operational.access.mapper.ConstructionMapper; import com.hnac.hzims.operational.access.service.ConstructionService; +import com.hnac.hzims.operational.access.service.IOperAccessTaskService; import com.hnac.hzims.operational.access.vo.ConstructionVo; import com.hnac.hzims.operational.util.PdfUtils; -import com.hnac.hzims.operational.util.WordUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; @@ -32,6 +34,7 @@ import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -43,6 +46,9 @@ import java.util.Map; @RequiredArgsConstructor public class ConstructionServiceImpl extends BaseServiceImpl implements ConstructionService { + + private final IOperAccessTaskService accessTaskService; + @Value("${hzims.operation.construction.save.img}") private String constructionSaveImgPath; @@ -106,6 +112,23 @@ public class ConstructionServiceImpl extends BaseServiceImpllambdaUpdate() + .set(OperAccessTaskEntity::getConstructionId,entity.getId()) + .eq(OperAccessTaskEntity::getId,entity.getTaskId()) + ); + } + return true; + } + /** * 查询施工日志记录 * @param id