Commit 9d2df493 authored by wangyihao's avatar wangyihao

添加 默认值

parent 9b5ef34f
...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl; ...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Random;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -262,7 +263,7 @@ public class AdministratorsServiceImpl implements AdministratorsService { ...@@ -262,7 +263,7 @@ public class AdministratorsServiceImpl implements AdministratorsService {
* @return * @return
*/ */
public String generatePK() { public String generatePK() {
return null; return String.valueOf(new Date().getTime() * 1000000 + new Random().nextInt(1000000));
} }
/** /**
...@@ -271,6 +272,12 @@ public class AdministratorsServiceImpl implements AdministratorsService { ...@@ -271,6 +272,12 @@ public class AdministratorsServiceImpl implements AdministratorsService {
*/ */
public void fillDefaultValues(Administrators obj) { public void fillDefaultValues(Administrators obj) {
if (obj != null) { if (obj != null) {
if(obj.getIsAuditing() == null) {
obj.setIsAuditing(0);
}
if(obj.getIsDeleted() == null) {
obj.setIsDeleted(0);
}
} }
} }
......
...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl; ...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Random;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -262,7 +263,7 @@ public class StoreServiceImpl implements StoreService { ...@@ -262,7 +263,7 @@ public class StoreServiceImpl implements StoreService {
* @return * @return
*/ */
public String generatePK() { public String generatePK() {
return null; return String.valueOf(new Date().getTime() * 1000000 + new Random().nextInt(1000000));
} }
/** /**
...@@ -271,6 +272,21 @@ public class StoreServiceImpl implements StoreService { ...@@ -271,6 +272,21 @@ public class StoreServiceImpl implements StoreService {
*/ */
public void fillDefaultValues(Store obj) { public void fillDefaultValues(Store obj) {
if (obj != null) { if (obj != null) {
if(obj.getIsAuditing() == null) {
obj.setIsAuditing(0);
}
if(obj.getIsDeleted() == null) {
obj.setIsDeleted(0);
}
if(obj.getIsShopping() == null) {
obj.setIsShopping(0);
}
if(obj.getIsAvailable() == null) {
obj.setIsAvailable(0);
}
if(obj.getIsRecommend() == null) {
obj.setIsRecommend(0);
}
} }
} }
......
...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl; ...@@ -3,6 +3,7 @@ package cn.com.fqy.core.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Random;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -262,7 +263,7 @@ public class WorkerServiceImpl implements WorkerService { ...@@ -262,7 +263,7 @@ public class WorkerServiceImpl implements WorkerService {
* @return * @return
*/ */
public String generatePK() { public String generatePK() {
return null; return String.valueOf(new Date().getTime() * 1000000 + new Random().nextInt(1000000));
} }
/** /**
...@@ -271,6 +272,18 @@ public class WorkerServiceImpl implements WorkerService { ...@@ -271,6 +272,18 @@ public class WorkerServiceImpl implements WorkerService {
*/ */
public void fillDefaultValues(Worker obj) { public void fillDefaultValues(Worker obj) {
if (obj != null) { if (obj != null) {
if(obj.getIsAuditing() == null) {
obj.setIsAuditing(0);
}
if(obj.getIsDeleted() == null) {
obj.setIsDeleted(0);
}
if(obj.getIsShopping() == null) {
obj.setIsShopping(0);
}
if(obj.getIsRecommend() == null) {
obj.setIsRecommend(0);
}
} }
} }
......
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