|
@@ -1,6 +1,7 @@
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -144,7 +145,7 @@ public class ConstructionLedgerController extends BladeController {
|
|
|
//校验两个时间,看看哪个时间更早
|
|
|
Duration duration = org.springblade.core.tool.utils.DateUtil.between(
|
|
|
org.springblade.core.tool.utils.DateUtil.parse(recordTime, "yyyy-MM-dd HH:mm:ss"),
|
|
|
- org.springblade.core.tool.utils.DateUtil.toDate(vos.getSiteStartTime())
|
|
|
+ vos.getSiteStartTime()
|
|
|
);
|
|
|
if(duration.getSeconds() > 0){
|
|
|
//说明施工日志最早的填报时间比自定义填写的时间要晚,取客户填写的时间
|
|
@@ -192,22 +193,25 @@ public class ConstructionLedgerController extends BladeController {
|
|
|
@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改", notes = "传入constructionLedger")
|
|
|
- public R<Boolean> update(@Valid @RequestBody ConstructionLedgerVO constructionLedger) {
|
|
|
+ public R<Boolean> update(@RequestBody JSONObject json) {
|
|
|
+ ConstructionLedgerVO voLedger = JSONObject.parseObject(JSONObject.toJSONString(json), ConstructionLedgerVO.class);
|
|
|
+ ConstructionLedger ledger = JSONObject.parseObject(JSONObject.toJSONString(json), ConstructionLedger.class);
|
|
|
+
|
|
|
//施工起止时间
|
|
|
- if(StringUtils.isNotEmpty(constructionLedger.getSiteTimeStr()) && constructionLedger.getSiteTimeStr().contains("~")){
|
|
|
- String[] time = constructionLedger.getSiteTimeStr().split("~");
|
|
|
- constructionLedger.setSiteStartTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[0], "yyyy-MM-dd")));
|
|
|
- constructionLedger.setSiteEndTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[1], "yyyy-MM-dd")));
|
|
|
+ if(StringUtils.isNotEmpty(voLedger.getSiteTimeStr()) && voLedger.getSiteTimeStr().contains("~")){
|
|
|
+ String[] time = voLedger.getSiteTimeStr().split("~");
|
|
|
+ ledger.setSiteStartTime(org.springblade.core.tool.utils.DateUtil.parse(time[0], "yyyy-MM-dd"));
|
|
|
+ ledger.setSiteEndTime(org.springblade.core.tool.utils.DateUtil.parse(time[1], "yyyy-MM-dd"));
|
|
|
}
|
|
|
|
|
|
//检测起止时间
|
|
|
- if(StringUtils.isNotEmpty(constructionLedger.getDetectionTimeStr()) && constructionLedger.getDetectionTimeStr().contains("~")){
|
|
|
- String[] time = constructionLedger.getDetectionTimeStr().split("~");
|
|
|
- constructionLedger.setDetectionStartTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[0], "yyyy-MM-dd")));
|
|
|
- constructionLedger.setDetectionEndTime(DateUtil.toLocalDateTime(org.springblade.core.tool.utils.DateUtil.parse(time[1], "yyyy-MM-dd")));
|
|
|
+ if(StringUtils.isNotEmpty(voLedger.getDetectionTimeStr()) && voLedger.getDetectionTimeStr().contains("~")){
|
|
|
+ String[] time = voLedger.getDetectionTimeStr().split("~");
|
|
|
+ ledger.setDetectionStartTime(org.springblade.core.tool.utils.DateUtil.parse(time[0], "yyyy-MM-dd"));
|
|
|
+ ledger.setDetectionEndTime(org.springblade.core.tool.utils.DateUtil.parse(time[1], "yyyy-MM-dd"));
|
|
|
}
|
|
|
- setUserData(constructionLedger, false);
|
|
|
- return R.status(this.constructionLedgerService.updateById(constructionLedger));
|
|
|
+ setUserData(ledger, false);
|
|
|
+ return R.status(this.constructionLedgerService.updateById(ledger));
|
|
|
}
|
|
|
|
|
|
/**
|