Commit 80430f91 authored by hezhen's avatar hezhen

123

parent 84c40e22
......@@ -40,7 +40,8 @@ public class BranchCompanyStockRight{
*/
private Integer type;
private Integer state;
@Column(name = "stock_state")
private Integer stockState;
/**
......
package com.xxfc.platform.vehicle.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 分公司信息
*/
@Data
public class CompanyVo {
/**
* 公司基本信息表
*/
@ApiModelProperty("公司基本信息id")
Integer id;
@ApiModelProperty("公司全名称")
String name;
@ApiModelProperty("公司封面")
String cover;
@ApiModelProperty("轮播图")
String images;
@ApiModelProperty("片区id")
Integer zoneId;
@ApiModelProperty("公司简介")
String describes;
@ApiModelProperty("详情")
String content;
@ApiModelProperty("地址-省/直辖市(编码)")
Integer addrProvince;
@ApiModelProperty("地址-市(编码)")
Integer addrCity;
@ApiModelProperty("地址-镇/县(编码)")
Integer addrTown;
/**
* 分支机构
*/
@ApiModelProperty("分支机构id")
Integer companyId;
@ApiModelProperty("分支机构名称")
String companyName;
@ApiModelProperty("详细地址")
String addrDetail;
@ApiModelProperty("上下架:1-上架;2-下架")
Integer state;
@ApiModelProperty("负责人")
private String leader;
@ApiModelProperty("负责人联系方式")
private String leaderContactInfo;
@ApiModelProperty("公司状态")
private Integer status;
@ApiModelProperty("公司地址-纬度")
private BigDecimal latitude;
@ApiModelProperty("公司地址-经度")
private BigDecimal longitude;
@ApiModelProperty("租车客服电话")
private String vehiceServicePhone;
@ApiModelProperty("旅游客服电话")
private String tourServicePhone;
/**
* 股权信息
*/
@ApiModelProperty("股份id")
Integer stockId;
@ApiModelProperty("剩余股份")
Integer balance;
@ApiModelProperty("股份总数")
Integer total;
@ApiModelProperty("股份单价")
BigDecimal price;
@ApiModelProperty("排序")
Integer rank;
@ApiModelProperty("(-1:下架,0:筹备中,1:筹备完成,2:上架)")
Integer stockState;
@ApiModelProperty("股价类型:1-万/股;2-港万/股")
Integer type;
}
......@@ -3,10 +3,14 @@ package com.xxfc.platform.vehicle.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.vehicle.entity.*;
import com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper;
import com.xxfc.platform.vehicle.mapper.CompanyBaseMapper;
import com.xxfc.platform.vehicle.pojo.vo.CompanyVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -52,7 +56,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
branchCompanyStockRight.setPrice(price);
branchCompanyStockRight.setTotal(total);
branchCompanyStockRight.setCompanyBaseId(companyBaseId);
branchCompanyStockRight.setState(2);
branchCompanyStockRight.setStockState(2);
stockRightBiz.insertSelective(branchCompanyStockRight);
}
num++;
......@@ -62,6 +66,77 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return ObjectRestResponse.succ();
}
//设置基础信息
public ObjectRestResponse updCompany(CompanyVo companyVo){
if (companyVo==null|| StringUtils.isBlank(companyVo.getCompanyName())|| StringUtils.isBlank(companyVo.getName())||
companyVo.getZoneId()==null||companyVo.getZoneId()==0|| companyVo.getAddrProvince()==null||companyVo.getAddrProvince()==0
|| companyVo.getAddrCity()==null||companyVo.getAddrCity()==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
}
Integer state=companyVo.getState()==null?2:companyVo.getState();
if (state==1&&(StringUtils.isBlank(companyVo.getAddrDetail())||StringUtils.isBlank(companyVo.getImages())||StringUtils.isBlank(companyVo.getDescribes())||StringUtils.isBlank(companyVo.getContent())
||StringUtils.isBlank(companyVo.getLeader())||StringUtils.isBlank(companyVo.getLeaderContactInfo())||StringUtils.isBlank(companyVo.getTourServicePhone())||StringUtils.isBlank(companyVo.getVehiceServicePhone()))){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"上架时参数不能为空");
}
CompanyBase companyBase=new CompanyBase();
BeanUtils.copyProperties(companyVo,companyBase);
Integer companyBaseId=companyVo.getId();
if (companyBaseId==null||companyBaseId==0){
insertSelective(companyBase);
companyBaseId=companyBase.getId();
}else {
updateSelectiveById(companyBase);
}
BranchCompany branchCompany=new BranchCompany();
BeanUtils.copyProperties(companyVo,branchCompany);
branchCompany.setCompanyBaseId(companyBaseId);
branchCompany.setName(companyVo.getCompanyName());
Integer companyId=companyVo.getCompanyId();
if (companyId==null||companyId==0){
branchCompany.setId(null);
insertSelective(companyBase);
}else {
branchCompany.setId(companyId);
updateSelectiveById(companyBase);
}
return ObjectRestResponse.succ();
}
//设置股权信息
public ObjectRestResponse updStockInfo(CompanyVo companyVo){
if (companyVo==null|| StringUtils.isBlank(companyVo.getCompanyName())|| StringUtils.isBlank(companyVo.getName())||
companyVo.getZoneId()==null||companyVo.getZoneId()==0|| companyVo.getAddrProvince()==null||companyVo.getAddrProvince()==0
|| companyVo.getAddrCity()==null||companyVo.getAddrCity()==0){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
}
Integer state=companyVo.getState()==null?2:companyVo.getState();
if (state==1&&(StringUtils.isBlank(companyVo.getAddrDetail())||StringUtils.isBlank(companyVo.getImages())||StringUtils.isBlank(companyVo.getDescribes())||StringUtils.isBlank(companyVo.getContent())
||StringUtils.isBlank(companyVo.getLeader())||StringUtils.isBlank(companyVo.getLeaderContactInfo())||StringUtils.isBlank(companyVo.getTourServicePhone())||StringUtils.isBlank(companyVo.getVehiceServicePhone()))){
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"上架时参数不能为空");
}
CompanyBase companyBase=new CompanyBase();
BeanUtils.copyProperties(companyVo,companyBase);
Integer companyBaseId=companyVo.getId();
if (companyBaseId==null||companyBaseId==0){
insertSelective(companyBase);
companyBaseId=companyBase.getId();
}else {
updateSelectiveById(companyBase);
}
BranchCompany branchCompany=new BranchCompany();
BeanUtils.copyProperties(companyVo,branchCompany);
branchCompany.setCompanyBaseId(companyBaseId);
branchCompany.setName(companyVo.getCompanyName());
Integer companyId=companyVo.getCompanyId();
if (companyId==null||companyId==0){
branchCompany.setId(null);
insertSelective(companyBase);
}else {
branchCompany.setId(companyId);
updateSelectiveById(companyBase);
}
return ObjectRestResponse.succ();
}
}
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