|
|
@ -4,10 +4,12 @@ import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.kms.yg.df.domain.BsSgcDfJbxx; |
|
|
|
import com.kms.yg.df.service.BsSgcDfJbxxService; |
|
|
|
import com.shuili.common.core.controller.BaseController; |
|
|
|
import com.shuili.common.core.domain.SearchParam; |
|
|
|
import com.shuili.common.utils.BeanUtils; |
|
|
|
import com.shuili.common.utils.poi.ExcelUtil; |
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
|
|
|
|
@ -88,6 +90,18 @@ public class BsSgcDfJbxxController extends BaseController |
|
|
|
@ApiOperation("堤防基本信息新增") |
|
|
|
public AjaxResult add(@RequestBody BsSgcDfJbxx bsSgcDfJbxx) |
|
|
|
{ |
|
|
|
String embankmentCode = bsSgcDfJbxx.getEmbankmentCode(); |
|
|
|
|
|
|
|
QueryWrapper<BsSgcDfJbxx> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq("EBANKMENT_CODE", embankmentCode); |
|
|
|
|
|
|
|
BsSgcDfJbxx one = bsSgcDfJbxxService.getOne(queryWrapper); |
|
|
|
if (one != null) { |
|
|
|
return AjaxResult.error("该堤防编码已存在"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BaseEntityUtils.preInsert(bsSgcDfJbxx); |
|
|
|
bsSgcDfJbxx.setRecordTakeEffectTime(new Date()); |
|
|
|
return toAjax(bsSgcDfJbxxService.save(bsSgcDfJbxx)); |
|
|
@ -101,7 +115,23 @@ public class BsSgcDfJbxxController extends BaseController |
|
|
|
@PutMapping |
|
|
|
public AjaxResult edit(@RequestBody BsSgcDfJbxx bsSgcDfJbxx) |
|
|
|
{ |
|
|
|
return toAjax(bsSgcDfJbxxService.updateById(bsSgcDfJbxx)); |
|
|
|
String id = bsSgcDfJbxx.getId(); |
|
|
|
BsSgcDfJbxx byId = bsSgcDfJbxxService.getById(id); |
|
|
|
byId.setRecordLoseEfficacyTime(new Date()); |
|
|
|
bsSgcDfJbxxService.updateById(byId); |
|
|
|
|
|
|
|
|
|
|
|
bsSgcDfJbxx.setRecordTakeEffectTime(new Date()); |
|
|
|
bsSgcDfJbxx.setRecordLoseEfficacyTime(null); |
|
|
|
bsSgcDfJbxx.setId(""); |
|
|
|
|
|
|
|
BsSgcDfJbxx jbxx = new BsSgcDfJbxx(); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(bsSgcDfJbxx, jbxx); |
|
|
|
BaseEntityUtils.preInsert(jbxx); |
|
|
|
|
|
|
|
|
|
|
|
return toAjax(bsSgcDfJbxxService.save(jbxx)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|