Commit 3abe5d4a authored by 高建强's avatar 高建强

场站新增归属地区名称属性

parent 7140f7aa
...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -17,10 +18,10 @@ import java.util.List; ...@@ -17,10 +18,10 @@ import java.util.List;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="StationBasicDto", description="场站基础信息表") @ApiModel(value = "StationBasicDto", description = "场站基础信息表")
public class StationBasicDto extends BaseDto { public class StationBasicDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "场站名称") @ApiModelProperty(value = "场站名称")
...@@ -71,8 +72,9 @@ public class StationBasicDto extends BaseDto { ...@@ -71,8 +72,9 @@ public class StationBasicDto extends BaseDto {
@ApiModelProperty(value = "所属片区") @ApiModelProperty(value = "所属片区")
private String area; private String area;
@ApiModelProperty(value = "所属地区名称")
private String belongAreaName;
private List<StationCoordinateDto> stationCoordinate; private List<StationCoordinateDto> stationCoordinate;
} }
...@@ -95,7 +95,11 @@ public class StationBasic extends BaseEntity { ...@@ -95,7 +95,11 @@ public class StationBasic extends BaseEntity {
*/ */
@TableField("belong_area") @TableField("belong_area")
private String belongArea; private String belongArea;
/**
* 所属地区名称
*/
@TableField("belong_area_name")
private String belongAreaName;
@TableField(exist =false) @TableField(exist =false)
private List<Integer> belongArealist; private List<Integer> belongArealist;
......
...@@ -315,7 +315,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas ...@@ -315,7 +315,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto,PersonBas
} }
return departmentModel; return departmentModel;
} }
private CompanyModel getCompanyModel(Long projectId) { public CompanyModel getCompanyModel(Long projectId) {
FeignClientResult<CompanyModel> cResult = Privilege.companyClient.seleteOne(projectId); FeignClientResult<CompanyModel> cResult = Privilege.companyClient.seleteOne(projectId);
CompanyModel companyModel=new CompanyModel(); CompanyModel companyModel=new CompanyModel();
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationCoordinate; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationCoordinate;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IStationBasicService; import com.yeejoin.amos.boot.module.jxiop.api.service.IStationBasicService;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto; import com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -30,6 +31,9 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station ...@@ -30,6 +31,9 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
@Autowired @Autowired
StationCoordinateServiceImpl stationCoordinateServiceImpl; StationCoordinateServiceImpl stationCoordinateServiceImpl;
@Autowired
PersonBasicServiceImpl personBasicServiceImpl;
@Autowired @Autowired
StationBasicMapper stationBasicMapper; StationBasicMapper stationBasicMapper;
/** /**
...@@ -77,7 +81,10 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station ...@@ -77,7 +81,10 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
if(stationBasic.getBelongArealist()!=null){ if(stationBasic.getBelongArealist()!=null){
stationBasic.setBelongArea(JSON.toJSONString(stationBasic.getBelongArealist())); stationBasic.setBelongArea(JSON.toJSONString(stationBasic.getBelongArealist()));
} }
CompanyModel companyModel=new CompanyModel();
//单位
companyModel=personBasicServiceImpl.getCompanyModel(Long.parseLong(stationBasic.getBelongArea()));
stationBasic.setBelongAreaName(companyModel.getCompanyName());
//场站基本信息 //场站基本信息
this.save(stationBasic); this.save(stationBasic);
...@@ -100,6 +107,10 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station ...@@ -100,6 +107,10 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto,Station
if(stationBasic.getBelongArealist()!=null){ if(stationBasic.getBelongArealist()!=null){
stationBasic.setBelongArea(JSON.toJSONString(stationBasic.getBelongArealist())); stationBasic.setBelongArea(JSON.toJSONString(stationBasic.getBelongArealist()));
} }
CompanyModel companyModel=new CompanyModel();
//单位
companyModel=personBasicServiceImpl.getCompanyModel(Long.parseLong(stationBasic.getBelongArea()));
stationBasic.setBelongAreaName(companyModel.getCompanyName());
//场站基本信息 //场站基本信息
stationBasicMapper.updateById(stationBasic); stationBasicMapper.updateById(stationBasic);
......
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