|
|
@@ -9,10 +9,12 @@ import com.ruoyi.business.mapper.BjTrackShipCompanyMapper;
|
|
|
import com.ruoyi.business.service.IBjTrackShipCompanyService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -61,12 +63,16 @@ public class BjTrackShipCompanyServiceImpl implements IBjTrackShipCompanyService
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean insertByBo(BjTrackShipCompanyBo bo) {
|
|
|
+ public Boolean insertByBo(BjTrackShipCompanyBo bo) throws ParseException {
|
|
|
BjTrackShipCompany add = BeanUtil.copyProperties(bo, BjTrackShipCompany.class);
|
|
|
String trackShipCompanyId = IdUtil.simpleUUID();
|
|
|
if (add != null) {
|
|
|
add.setTrackShipCompanyId(trackShipCompanyId);
|
|
|
}
|
|
|
+ if (bo.getAddDate() != null) {
|
|
|
+ add.setAddStartDate(DateUtils.parseDate(bo.getAddDate()[0], "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ add.setAddEndDate(DateUtils.parseDate(bo.getAddDate()[1], "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ }
|
|
|
validEntityBeforeSave(add);
|
|
|
return baseMapper.insert(add) > 0;
|
|
|
}
|
|
|
@@ -79,8 +85,12 @@ public class BjTrackShipCompanyServiceImpl implements IBjTrackShipCompanyService
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Boolean updateByBo(BjTrackShipCompanyBo bo) {
|
|
|
+ public Boolean updateByBo(BjTrackShipCompanyBo bo) throws ParseException {
|
|
|
BjTrackShipCompany update = BeanUtil.copyProperties(bo, BjTrackShipCompany.class);
|
|
|
+ if (bo.getAddDate() != null) {
|
|
|
+ update.setAddStartDate(DateUtils.parseDate(bo.getAddDate()[0], "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ update.setAddEndDate(DateUtils.parseDate(bo.getAddDate()[1], "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ }
|
|
|
validEntityBeforeSave(update);
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
}
|