| | |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | if (!Cools.isEmpty(name)) { |
| | | throw new CoolException("不可有重复项目名"); |
| | | } |
| | | if (item.getRealMonth() < 0){ |
| | | throw new CoolException("实施周期不可为负数"); |
| | | } |
| | | // if (item.getRealMonth() < 0){ |
| | | // throw new CoolException("实施周期不可为负数"); |
| | | // } |
| | | if (Cools.isEmpty(item.getCstmrUuid())) { |
| | | throw new CoolException("请选择客户"); |
| | | } |
| | |
| | | item.setStatus(1); |
| | | item.setUpdateBy(getUserId()); |
| | | item.setUpdateTime(new Date()); |
| | | Long span = (item.getEndTime().getTime() - item.getStartTime().getTime()) / 1000 / 60 / 60 / 24; |
| | | item.setRealMonth(Math.toIntExact(span)); |
| | | itemService.insertAll(item); |
| | | return R.ok(); |
| | | } |