|
@@ -68,6 +68,14 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
|
|
|
if (StringUtils.isBlank(dd) || dd.length() == 0){
|
|
|
throw new BusinessException("新增产品信息'" + dmpProductInfo.getProductCode() + "'失败,设备类型缺少属性");
|
|
|
}
|
|
|
+
|
|
|
+ QueryWrapper<DmpProductInfo> query = Wrappers.query();
|
|
|
+ query.select("max(id) as id");
|
|
|
+ DmpProductInfo info1 = this.getOne(query);
|
|
|
+ int id = info1.getId()+1;
|
|
|
+ String productCode = String.format("%03d",deviceType)+"_"+String.format("%04d",id);
|
|
|
+ dmpProductInfo.setProductCode(productCode);
|
|
|
+
|
|
|
dmpProductInfo.setCreatedBy(SecurityUtils.getUsername());
|
|
|
dmpProductInfo.setCreatedTime(new Date());
|
|
|
dmpProductInfo.setDeleteFlag(0);
|