Commit 766c14a4 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 80bbdd3e 74812374
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.filepath>/mortals/app/data</profiles.filepath> <profiles.filepath>/mortals/app/data</profiles.filepath>
<skipDeploy>true</skipDeploy> <skipDeploy>true</skipDeploy>
<phpUrl>http://127.0.0.1:8076/zwfw/inter/user/list</phpUrl>
</properties> </properties>
...@@ -54,6 +55,7 @@ ...@@ -54,6 +55,7 @@
<profiles.active>product</profiles.active> <profiles.active>product</profiles.active>
<profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=16517</profiles.server.debug> <profiles.server.debug>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=16517</profiles.server.debug>
<profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.250:8848</profiles.nacos.server-addr>
<phpUrl>http://192.168.0.231:8076/zwfw_yx/inter/user/userlist</phpUrl>
</properties> </properties>
</profile> </profile>
......
...@@ -43,6 +43,7 @@ import com.mortals.xhx.module.company.model.CompanyEntity; ...@@ -43,6 +43,7 @@ import com.mortals.xhx.module.company.model.CompanyEntity;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -71,10 +72,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -71,10 +72,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired @Autowired
private RoleUserService roleUserService; private RoleUserService roleUserService;
@Lazy @Value("${phpUrl:http://192.168.0.231:8076/zwfw_yx/inter/user/userlist}")
@Autowired private String phpUrl;
private IUserFeign userFeign;
@Override @Override
protected String getExtKey(UserEntity data) { protected String getExtKey(UserEntity data) {
return data.getLoginName(); return data.getLoginName();
...@@ -325,7 +324,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -325,7 +324,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override @Override
public Rest<Void> refreshUser() { public Rest<Void> refreshUser() {
//todo 请求php获取用户 //todo 请求php获取用户
String respJson = HttpUtil.get("http://192.168.0.231:8076/zwfw_yx/inter/user/userlist"); String respJson = HttpUtil.get(phpUrl);
ApiResp<List<UserResp>> rest = JSON.parseObject(respJson, new TypeReference<ApiResp<List<UserResp>>>() { ApiResp<List<UserResp>> rest = JSON.parseObject(respJson, new TypeReference<ApiResp<List<UserResp>>>() {
}); });
if (200 == rest.getCode()) { if (200 == rest.getCode()) {
......
...@@ -5,8 +5,14 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,8 +5,14 @@ import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.code.DeclareStatusEnum; import com.mortals.xhx.common.code.DeclareStatusEnum;
import com.mortals.xhx.module.category.model.CategoryEntity;
import com.mortals.xhx.module.category.service.CategoryService;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.service.CompanyService;
import com.mortals.xhx.module.declare.model.*; import com.mortals.xhx.module.declare.model.*;
import com.mortals.xhx.module.declare.service.DeclareFinImagesService; import com.mortals.xhx.module.declare.service.DeclareFinImagesService;
import com.mortals.xhx.module.park.model.ParkEntity;
import com.mortals.xhx.module.park.service.ParkService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.util.Map; import java.util.Map;
...@@ -44,6 +50,12 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl ...@@ -44,6 +50,12 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
@Autowired @Autowired
private DeclareFinImagesService declareFinImagesService; private DeclareFinImagesService declareFinImagesService;
@Autowired
private CategoryService categoryService;
@Autowired
private ParkService parkService;
@Autowired
private CompanyService companyService;
@Override @Override
...@@ -74,6 +86,26 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl ...@@ -74,6 +86,26 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
} }
@Override
protected void saveBefore(DeclareEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getCategoryId())){
CategoryEntity categoryEntity = categoryService.get(entity.getCategoryId());
entity.setCategoryName(categoryEntity==null?"":categoryEntity.getCategoryName());
entity.setCategoryCode(categoryEntity==null?"":categoryEntity.getCategoryCode());
}
if(!ObjectUtils.isEmpty(entity.getParkId())){
ParkEntity parkEntity = parkService.get(entity.getParkId());
entity.setParkName(parkEntity==null?"":parkEntity.getName());
}
if(!ObjectUtils.isEmpty(entity.getCompanyId())){
CompanyEntity companyEntity = companyService.get(entity.getCompanyId());
entity.setCompanyName(companyEntity==null?"":companyEntity.getName());
}
super.saveBefore(entity, context);
}
@Override @Override
protected void saveAfter(DeclareEntity entity, Context context) throws AppException { protected void saveAfter(DeclareEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) { if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) {
......
...@@ -49,4 +49,4 @@ application: ...@@ -49,4 +49,4 @@ application:
unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/resource/list,/api/asset/*,/api/*,/uploads/*,/project/file/*,/file/* unloginUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/resource/list,/api/asset/*,/api/*,/uploads/*,/project/file/*,/file/*
uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/resource/list,/api/asset/*,/api/*,/uploads/*,/project/file/*,/file/* uncheckUrl: /refresh,/error,/login/login,/login/index,/login/logout,/securitycode/createCode,/file/common/*,/test*,/resource/list,/api/asset/*,/api/*,/uploads/*,/project/file/*,/file/*
phpUrl: @profiles.phpUrl@
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