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

Merge remote-tracking branch 'origin/master'

parents 80bbdd3e 74812374
......@@ -25,6 +25,7 @@
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<skipDeploy>true</skipDeploy>
<phpUrl>http://127.0.0.1:8076/zwfw/inter/user/list</phpUrl>
</properties>
......@@ -54,6 +55,7 @@
<profiles.active>product</profiles.active>
<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>
<phpUrl>http://192.168.0.231:8076/zwfw_yx/inter/user/userlist</phpUrl>
</properties>
</profile>
......
......@@ -43,6 +43,7 @@ import com.mortals.xhx.module.company.model.CompanyEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -71,10 +72,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired
private RoleUserService roleUserService;
@Lazy
@Autowired
private IUserFeign userFeign;
@Value("${phpUrl:http://192.168.0.231:8076/zwfw_yx/inter/user/userlist}")
private String phpUrl;
@Override
protected String getExtKey(UserEntity data) {
return data.getLoginName();
......@@ -325,7 +324,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Override
public Rest<Void> refreshUser() {
//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>>>() {
});
if (200 == rest.getCode()) {
......
......@@ -5,8 +5,14 @@ import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
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.service.DeclareFinImagesService;
import com.mortals.xhx.module.park.model.ParkEntity;
import com.mortals.xhx.module.park.service.ParkService;
import org.springframework.beans.BeanUtils;
import java.util.Map;
......@@ -44,6 +50,12 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
@Autowired
private DeclareFinImagesService declareFinImagesService;
@Autowired
private CategoryService categoryService;
@Autowired
private ParkService parkService;
@Autowired
private CompanyService companyService;
@Override
......@@ -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
protected void saveAfter(DeclareEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) {
......
......@@ -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/*
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