|
|
|
@ -3,7 +3,6 @@ package com.ruoyi.tcZz.controller;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.exception.base.BaseException;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.tcZz.domain.TcYqzs;
|
|
|
|
|
import com.ruoyi.tcZz.service.ITcYqzsService;
|
|
|
|
@ -59,15 +58,21 @@ public class TcYqzsController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 新增校验
|
|
|
|
|
*/
|
|
|
|
|
//根据area_id + cy_name判断如果已存在,则调修改
|
|
|
|
|
TcYqzs tcYqzs1 = new TcYqzs();
|
|
|
|
|
tcYqzs1.setAreaId(tcYqzs.getAreaId());
|
|
|
|
|
tcYqzs1.setDateTime(tcYqzs.getDateTime());
|
|
|
|
|
List<TcYqzs> list = tcYqzsService.selectTcYqzsList(tcYqzs1);
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
throw new BaseException("同一天内不得新增多条太仓数据");
|
|
|
|
|
for (TcYqzs a : list) {
|
|
|
|
|
tcYqzs.setId(a.getId());
|
|
|
|
|
tcYqzsService.updateTcYqzs(tcYqzs);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
tcYqzsService.insertTcYqzs(tcYqzs);
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success();
|
|
|
|
|
|
|
|
|
|
return toAjax(tcYqzsService.insertTcYqzs(tcYqzs));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|