Commit e843445c authored by lcl's avatar lcl

字段添加

parent 5165b094
...@@ -48,10 +48,7 @@ public class CbQuantitySummaryActual implements Serializable { ...@@ -48,10 +48,7 @@ public class CbQuantitySummaryActual implements Serializable {
* 采购单价 * 采购单价
*/ */
private Double purchaseUnitPrice; private Double purchaseUnitPrice;
/**
* 创建时间
*/
private Date createTime;
/** /**
* 推送时间 * 推送时间
*/ */
...@@ -76,6 +73,18 @@ public class CbQuantitySummaryActual implements Serializable { ...@@ -76,6 +73,18 @@ public class CbQuantitySummaryActual implements Serializable {
* IPM作业编码 * IPM作业编码
*/ */
private String ipmBizCode; private String ipmBizCode;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新人id
*/
private Long updateId;
/**
* 更新时间
*/
private Date updateTime;
} }
...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsk.common.exception.ServiceException; import com.dsk.common.exception.ServiceException;
import com.dsk.common.helper.LoginHelper;
import com.dsk.cscec.domain.CbQuantitySummary; import com.dsk.cscec.domain.CbQuantitySummary;
import com.dsk.cscec.domain.CbQuantitySummaryActual; import com.dsk.cscec.domain.CbQuantitySummaryActual;
import com.dsk.cscec.domain.CbSubject; import com.dsk.cscec.domain.CbSubject;
...@@ -62,7 +63,7 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -62,7 +63,7 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
Map<String, Object> oneMap = new HashMap<>(); Map<String, Object> oneMap = new HashMap<>();
List<Map<String, Object>> oneList = new ArrayList<>(); List<Map<String, Object>> oneList = new ArrayList<>();
oneMap.put("name", entry.getKey()); oneMap.put("name", entry.getKey());
oneMap.put("sort", cbSubjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCbSubjectName,entry.getKey())).getSort()); oneMap.put("sort", cbSubjectMapper.selectOne(Wrappers.<CbSubject>lambdaQuery().eq(CbSubject::getCbSubjectName, entry.getKey())).getSort());
for (Map.Entry<String, Map<String, List<Map<String, Object>>>> twoEntry : entry.getValue().entrySet()) { for (Map.Entry<String, Map<String, List<Map<String, Object>>>> twoEntry : entry.getValue().entrySet()) {
Map<String, Object> twoMap = new HashMap<>(); Map<String, Object> twoMap = new HashMap<>();
List<Map<String, Object>> twoList = new ArrayList<>(); List<Map<String, Object>> twoList = new ArrayList<>();
...@@ -106,11 +107,13 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM ...@@ -106,11 +107,13 @@ public class CbQuantitySummaryServiceImpl extends ServiceImpl<CbQuantitySummaryM
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateActual(List<CbQuantitySummaryActual> list) { public void updateActual(List<CbQuantitySummaryActual> list) {
if (ObjectUtils.isEmpty(list)) throw new BeanException("数据不能为空"); if (ObjectUtils.isEmpty(list)) throw new BeanException("数据不能为空");
Long userId = LoginHelper.getUserId();
for (CbQuantitySummaryActual actual : list) { for (CbQuantitySummaryActual actual : list) {
if (ObjectUtils.isEmpty(actual.getCbQuantitySummaryId())) throw new BeanException("基础数据id不能为空!"); if (ObjectUtils.isEmpty(actual.getCbQuantitySummaryId())) throw new BeanException("基础数据id不能为空!");
if (ObjectUtils.isEmpty(actual.getQuantities())) throw new BeanException("工程量(本月用料)不能为空!"); if (ObjectUtils.isEmpty(actual.getQuantities())) throw new BeanException("工程量(本月用料)不能为空!");
if (ObjectUtils.isEmpty(actual.getRecordDate())) throw new BeanException("填写月份不能为空!"); if (ObjectUtils.isEmpty(actual.getRecordDate())) throw new BeanException("填写月份不能为空!");
actual.setId(ObjectUtils.isEmpty(actual.getId()) ? SecureUtil.md5(actual.getCbQuantitySummaryId() + actual.getRecordDate()) : actual.getId()); actual.setId(ObjectUtils.isEmpty(actual.getId()) ? SecureUtil.md5(actual.getCbQuantitySummaryId() + actual.getRecordDate()) : actual.getId());
actual.setUpdateId(userId);
boolean b = baseActualService.saveOrUpdate(actual); boolean b = baseActualService.saveOrUpdate(actual);
if (!b) { if (!b) {
log.error("CbQuantitySummaryServiceImpl.updateActual() data insert error! data:" + JSONUtil.toJsonStr(actual)); log.error("CbQuantitySummaryServiceImpl.updateActual() data insert error! data:" + JSONUtil.toJsonStr(actual));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment