|
|
@@ -96,68 +96,59 @@ public class TmsLineCostServiceImpl extends ServiceImpl<TmsLineCostMapper, TmsLi
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean add(TmsLineCostAddParam param) {
|
|
|
- try {
|
|
|
- TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
- BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
- boolean flag = save(tmsLineCost);
|
|
|
- if (param.getList() != null && param.getList().size() > 0) {
|
|
|
- for (TmsLineCostOther tmsLineCostOther : param.getList()) {
|
|
|
- tmsLineCostOther.setLineCostId(tmsLineCost.getId());
|
|
|
- tmsLineCostOther.setCreater(tmsLineCost.getCreater());
|
|
|
- tmsLineCostOther.setCreaterName(tmsLineCost.getCreaterName());
|
|
|
- tmsLineCostOther.setCreateDate(tmsLineCost.getCreateDate());
|
|
|
- tmsLineCostOtherService.save(tmsLineCostOther);
|
|
|
- }
|
|
|
+
|
|
|
+ TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
+ BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
+ boolean flag = save(tmsLineCost);
|
|
|
+ if (param.getList() != null && param.getList().size() > 0) {
|
|
|
+ for (TmsLineCostOther tmsLineCostOther : param.getList()) {
|
|
|
+ tmsLineCostOther.setLineCostId(tmsLineCost.getId());
|
|
|
+ tmsLineCostOther.setCreater(tmsLineCost.getCreater());
|
|
|
+ tmsLineCostOther.setCreaterName(tmsLineCost.getCreaterName());
|
|
|
+ tmsLineCostOther.setCreateDate(tmsLineCost.getCreateDate());
|
|
|
+ tmsLineCostOtherService.save(tmsLineCostOther);
|
|
|
}
|
|
|
- return flag;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("新增线路费用失败,参数:{},错误信息:{}", JSON.toJSONString(param), e);
|
|
|
- return false;
|
|
|
}
|
|
|
+ return flag;
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean update(TmsLineCostAddParam param) {
|
|
|
- try {
|
|
|
- TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
- BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
- boolean flag = updateById(tmsLineCost);
|
|
|
- if (param.getList() != null && param.getList().size() > 0) {
|
|
|
- for (TmsLineCostOther tmsLineCostOther : param.getList()) {
|
|
|
- tmsLineCostOther.setUpdater(param.getUpdater());
|
|
|
- tmsLineCostOther.setUpdaterName(param.getUpdaterName());
|
|
|
- tmsLineCostOther.setUpdateDate(param.getUpdateDate());
|
|
|
- tmsLineCostOtherService.updateById(tmsLineCostOther);
|
|
|
- }
|
|
|
+
|
|
|
+ TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
+ BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
+ boolean flag = updateById(tmsLineCost);
|
|
|
+ if (param.getList() != null && param.getList().size() > 0) {
|
|
|
+ for (TmsLineCostOther tmsLineCostOther : param.getList()) {
|
|
|
+ tmsLineCostOther.setUpdater(param.getUpdater());
|
|
|
+ tmsLineCostOther.setUpdaterName(param.getUpdaterName());
|
|
|
+ tmsLineCostOther.setUpdateDate(param.getUpdateDate());
|
|
|
+ tmsLineCostOtherService.updateById(tmsLineCostOther);
|
|
|
}
|
|
|
- return flag;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("修改线路费用失败,参数:{},错误信息:{}", JSON.toJSONString(param), e);
|
|
|
- return false;
|
|
|
}
|
|
|
+ return flag;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean delete(TmsLineCostAddParam param) {
|
|
|
- try {
|
|
|
- TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
- BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
- boolean flag = removeById(tmsLineCost);
|
|
|
-
|
|
|
- List<TmsLineCostOther> list = tmsLineCostOtherService.list(param);
|
|
|
- if (list != null && list.size() > 0) {
|
|
|
- for (TmsLineCostOther tmsLineCostOther : list) {
|
|
|
- tmsLineCostOtherService.removeById(tmsLineCostOther);
|
|
|
- }
|
|
|
+
|
|
|
+ TmsLineCost tmsLineCost = new TmsLineCost();
|
|
|
+ BeanUtils.copyProperties(param, tmsLineCost);
|
|
|
+ boolean flag = removeById(tmsLineCost);
|
|
|
+
|
|
|
+ List<TmsLineCostOther> list = tmsLineCostOtherService.list(param);
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ for (TmsLineCostOther tmsLineCostOther : list) {
|
|
|
+ tmsLineCostOtherService.removeById(tmsLineCostOther);
|
|
|
}
|
|
|
- return flag;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("删除线路费用失败,参数:{},错误信息:{}", JSON.toJSONString(param), e);
|
|
|
- return false;
|
|
|
}
|
|
|
+ return flag;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|