|
|
@@ -23,6 +23,7 @@ import com.uas.sso.entity.UserSpaceView;
|
|
|
import com.uas.sso.entity.UserView;
|
|
|
import com.uas.sso.util.AccountUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
@@ -121,8 +122,54 @@ public class EnterpriseServiceImpl implements EnterpriseService{
|
|
|
//更新店铺中的企业信息
|
|
|
List<StoreIn> storeIns = storeInDao.findByEnUU(enterprise.getUu());
|
|
|
for (StoreIn storeIn : storeIns) {
|
|
|
- EnterpriseSimple enterpriseSimple = EnterpriseSimple.translateSimple(enterprise);
|
|
|
- storeIn.setEnterprise(enterpriseSimple);
|
|
|
+ EnterpriseSimple newEnterprise;
|
|
|
+ newEnterprise = new EnterpriseSimple();
|
|
|
+ EnterpriseSimple enterpriseOld = storeIn.getEnterprise();
|
|
|
+ BeanUtils.copyProperties(enterpriseOld,newEnterprise);
|
|
|
+ if (enterpriseOld != null) {
|
|
|
+ if (enterprise.getEnName() !=null) {
|
|
|
+ newEnterprise.setEnName(enterprise.getEnName());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnAddress() !=null) {
|
|
|
+ newEnterprise.setEnAddress(enterprise.getEnAddress());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnFax() !=null) {
|
|
|
+ newEnterprise.setEnFax(enterprise.getEnFax());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnTel() !=null) {
|
|
|
+ newEnterprise.setEnTel(enterprise.getEnTel());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnType() !=null) {
|
|
|
+ newEnterprise.setEnType(enterprise.getEnType());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnBussinessCode() !=null) {
|
|
|
+ newEnterprise.setEnBusinessCode(enterprise.getEnBussinessCode());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnDate() !=null) {
|
|
|
+ newEnterprise.setEnDate(enterprise.getEnDate());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnUrl() !=null) {
|
|
|
+ newEnterprise.setEnUrl(enterprise.getEnUrl());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnLogoUrl() !=null) {
|
|
|
+ newEnterprise.setEnLogoUrl(enterprise.getEnLogoUrl());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnEmail() !=null) {
|
|
|
+ newEnterprise.setEnLogoUrl(enterprise.getEnEmail());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnPhone() !=null) {
|
|
|
+ newEnterprise.setEnLogoUrl(enterprise.getEnPhone());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnWeixin() !=null) {
|
|
|
+ newEnterprise.setEnLogoUrl(enterprise.getEnWeixin());
|
|
|
+ }
|
|
|
+ if (enterprise.getEnQQ() !=null) {
|
|
|
+ newEnterprise.setEnLogoUrl(enterprise.getEnQQ());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ newEnterprise = EnterpriseSimple.translateSimple(enterprise);
|
|
|
+ }
|
|
|
+ storeIn.setEnterprise(newEnterprise);
|
|
|
storeInDao.save(storeIn);
|
|
|
}
|
|
|
if (existEnterprise == null)
|