|
@@ -6,6 +6,7 @@ import com.jeeplus.core.persistence.Page;
|
|
|
import com.jeeplus.core.web.BaseController;
|
|
|
import com.jeeplus.modules.cg.infrastructure.entity.ConstructionBatch;
|
|
|
import com.jeeplus.modules.cg.infrastructure.service.ConstructionBatchService;
|
|
|
+import com.jeeplus.modules.cg.infrastructure.util.ChangeTimeUtil;
|
|
|
import com.jeeplus.modules.cg.infrastructure.util.InfrastructureExcelExportUtil;
|
|
|
import com.jeeplus.modules.cg.infrastructure.util.InfrastructureExcelImportUtil;
|
|
|
import com.jeeplus.modules.sg.managementcenter.materialproject.util.ImportUtil;
|
|
@@ -23,7 +24,10 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.text.DateFormat;
|
|
|
import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -40,10 +44,18 @@ public class ConstructionBatchController extends BaseController {
|
|
|
private ConstructionBatchService batchService;
|
|
|
|
|
|
@ModelAttribute
|
|
|
- public ConstructionBatch get(@RequestParam(required = false) String id) {
|
|
|
+ public ConstructionBatch get(@RequestParam(required = false) String id) throws ParseException {
|
|
|
ConstructionBatch entity = null;
|
|
|
if (StringUtils.isNotBlank(id)) {
|
|
|
entity = batchService.get(id);
|
|
|
+ DateFormat inputFormat = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
+ DateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Date end = inputFormat.parse(entity.getEndTime());
|
|
|
+ Date open = inputFormat.parse(entity.getBidOpenTime());
|
|
|
+ String endTime = outputFormat.format(end);
|
|
|
+ String openTime = outputFormat.format(open);
|
|
|
+ entity.setEndTime(endTime);
|
|
|
+ entity.setBidOpenTime(openTime);
|
|
|
}
|
|
|
if (entity == null) {
|
|
|
entity = new ConstructionBatch();
|
|
@@ -96,7 +108,10 @@ public class ConstructionBatchController extends BaseController {
|
|
|
j.setMsg( "批次编号为" + batch.getBatchNumber() + "的施工计划批次信息已存在,不对数据进行保存!");
|
|
|
return j;
|
|
|
}
|
|
|
-
|
|
|
+ String endTime = ChangeTimeUtil.getOne().determineTimeFormat(batch.getEndTime());
|
|
|
+ batch.setEndTime(endTime);
|
|
|
+ String openTime = ChangeTimeUtil.getOne().determineTimeFormat(batch.getBidOpenTime());
|
|
|
+ batch.setBidOpenTime(openTime);
|
|
|
//新增或编辑表单保存
|
|
|
batchService.save(batch);//保存
|
|
|
j.setSuccess(true);
|
|
@@ -113,6 +128,10 @@ public class ConstructionBatchController extends BaseController {
|
|
|
@RequiresPermissions(value={"cg:infrastructure:constructionBatch:edit"},logical=Logical.OR)
|
|
|
@RequestMapping(value = "update")
|
|
|
public AjaxJson update(ConstructionBatch batch) {
|
|
|
+ String endTime = ChangeTimeUtil.getOne().determineTimeFormat(batch.getEndTime());
|
|
|
+ batch.setEndTime(endTime);
|
|
|
+ String openTime = ChangeTimeUtil.getOne().determineTimeFormat(batch.getBidOpenTime());
|
|
|
+ batch.setBidOpenTime(openTime);
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
/**
|
|
|
* 后台hibernate-validation插件校验
|