Ver Fonte

问题处理

wangming há 1 ano atrás
pai
commit
f6c336e85a

+ 6 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -704,8 +704,12 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
             //派单
             ZhcxInsideInspectionDispatchDo dispatch = new ZhcxInsideInspectionDispatchDo();
             dispatch.setId(inOper.getDispatch().getId());
-            dispatch.setCheckstarttime(DateUtil.parse(req.getStartDate(), "yyyy-MM-dd HH:mm:ss"));
-            dispatch.setCheckendtime(DateUtil.parse(req.getEndDate(), "yyyy-MM-dd HH:mm:ss"));
+            if(ObjectUtil.isNotEmpty(req.getStartDate())) {
+                dispatch.setCheckstarttime(DateUtil.parse(req.getStartDate(), "yyyy-MM-dd HH:mm:ss"));
+            }
+            if(ObjectUtil.isNotEmpty(req.getEndDate())) {
+                dispatch.setCheckendtime(DateUtil.parse(req.getEndDate(), "yyyy-MM-dd HH:mm:ss"));
+            }
 
             //报验完成,只能修改时间
             if("30".equals(inOper.getInspection().getInspectionstatus())) {

+ 9 - 2
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxInsideInspectionController.java

@@ -11,6 +11,7 @@ import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -29,6 +30,7 @@ import java.util.Map;
 @RestController
 @RequestMapping("/inside/inspection")
 @Api(tags = "内部报验")
+@Slf4j
 public class ZhcxInsideInspectionController {
 
     @Autowired
@@ -84,8 +86,13 @@ public class ZhcxInsideInspectionController {
     @ApiOperation("执行")
     @PostMapping("/execute")
     public R execute(@RequestBody InsideInspectionDispatchRequest req){
-        service.execute(req);
-        return R.ok("执行成功");
+        try {
+            service.execute(req);
+            return R.ok("执行成功");
+        } catch (Exception e) {
+            log.error("执行异常, {}", e);
+            return R.error("执行异常");
+        }
     }
 
     /**

+ 7 - 2
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxProjectManageController.java

@@ -45,8 +45,13 @@ public class ZhcxProjectManageController {
     @PostMapping("/genSummaryFiles")
     @ApiOperation("生成汇总文件")
     public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){
-        String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
-        return R.ok(files);
+        try {
+            String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
+            return R.ok(files);
+        } catch (Exception e) {
+            log.error("生成异常, {}", e);
+            return R.error("生成异常!");
+        }
     }
 
     /**