Commit 2274904d authored by hezhen's avatar hezhen

Merge branch 'dev' of http://113.105.137.151:22280/youjj/cloud-platform into dev

parents f7d7ead2 dedd4f3c
...@@ -65,6 +65,7 @@ public class AppShareholderDetailDTO { ...@@ -65,6 +65,7 @@ public class AppShareholderDetailDTO {
* 操作指令 * 操作指令
* 1:信息修改 * 1:信息修改
* 2:股权变动 * 2:股权变动
* 3:再次购买此前抛售的股权
*/ */
private Integer changeState; private Integer changeState;
......
...@@ -17,6 +17,7 @@ import com.google.common.collect.Lists; ...@@ -17,6 +17,7 @@ import com.google.common.collect.Lists;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import com.xxfc.platform.vehicle.pojo.CompanyDetail;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -95,14 +96,14 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -95,14 +96,14 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer companyId = Integer.valueOf(company); Integer companyId = Integer.valueOf(company);
if (!(companyId != null && companyId > 0)) if (!(companyId != null && companyId > 0))
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "分公司不存在"); return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "分公司不存在");
RestResponse<BranchCompany> branchCompany = vehicleFeign.get(companyId); CompanyDetail branchCompany = vehicleFeign.getCompanyDetail(companyId).getData();
if (branchCompany.getData() == null) { if (branchCompany == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "分公司不存在"); return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "分公司不存在");
} }
appShareholderDetailDTO.setCompanyId(companyId); appShareholderDetailDTO.setCompanyId(companyId);
appShareholderDetailDTO.setCompanyName(branchCompany.getData().getName()); appShareholderDetailDTO.setCompanyName(branchCompany.getName());
Integer positionId = branchCompany.getData().getId().equals(1) ? HEADQUARTERS_SHAREHOLDER : BRANCH_HEADQUARTERS_SHAREHOLDER; Integer positionId = branchCompany.getId().equals(1) ? HEADQUARTERS_SHAREHOLDER : BRANCH_HEADQUARTERS_SHAREHOLDER;
//用户表更改其身份 //用户表更改其身份
Integer userId = 0; Integer userId = 0;
//登陆表查询用户手机号 //登陆表查询用户手机号
...@@ -129,7 +130,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -129,7 +130,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer id = appShareholderDetailDTO.getId() == null ? 0 : appShareholderDetailDTO.getId(); Integer id = appShareholderDetailDTO.getId() == null ? 0 : appShareholderDetailDTO.getId();
BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail); BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail);
appShareholderDetail.setPositionId(positionId); appShareholderDetail.setPositionId(positionId);
appShareholderDetailDTO.setUserId(userId); appShareholderDetail.setUserId(userId);
// insertSelective(appShareholderDetail); // insertSelective(appShareholderDetail);
addUserFindId(appShareholderDetail); addUserFindId(appShareholderDetail);
//插入记录表 //插入记录表
...@@ -163,8 +164,19 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -163,8 +164,19 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail); BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail);
//信息修改 //信息修改
if (appShareholderDetailDTO.getChangeState().equals(1)) { if (appShareholderDetailDTO.getChangeState().equals(1)) {
updateSelectiveById(appShareholderDetail); if (appShareholderDetailDTO.getCompanyList() == null) {
// updateById(appShareholderDetail); for (String company : appShareholderDetailDTO.getCompanyList()) {
Integer companyId = Integer.valueOf(company);
appShareholderDetail.setCompanyId(companyId);
CompanyDetail branchCompany = vehicleFeign.getCompanyDetail(companyId).getData();
String companyName = branchCompany.getName();
appShareholderDetail.setCompanyName(companyName);
updateSelectiveById(appShareholderDetail);
}
} else {
updateSelectiveById(appShareholderDetail);
}
//退股操作
} else if (appShareholderDetailDTO.getChangeState().equals(2)) { } else if (appShareholderDetailDTO.getChangeState().equals(2)) {
if (appShareholderDetailDTO.getCompanyList() == null) { if (appShareholderDetailDTO.getCompanyList() == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "请传入需要退股的公司"); return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "请传入需要退股的公司");
...@@ -177,20 +189,80 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -177,20 +189,80 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
} }
for (String company : appShareholderDetailDTO.getCompanyList()) { for (String company : appShareholderDetailDTO.getCompanyList()) {
Integer companyId = Integer.valueOf(company); Integer companyId = Integer.valueOf(company);
appShareholderDetail.setIsQuit(SHAREHOLDERDE_IS_FALSE); //更新股东表 持股状态改为已退股
updateSelectiveById(appShareholderDetail); mapper.updShareHolderIsQuit(appShareholderDetailDTO.getPhone(), companyId, 1);
AppShareholderDetail updAppShareholderDetail = selectById(appShareholderDetail); AppShareholderDetail updAppShareholderDetail = selectById(appShareholderDetailDTO);
RestResponse<BranchCompany> branchCompany = vehicleFeign.get(companyId); //查询股东表,是否为总部股东
String companyName = branchCompany.getData().getName(); Integer oldPositionId = null;
oldPositionId = mapper.selectShareHolderByUserIdOrPhone(updAppShareholderDetail.getUserId(), updAppShareholderDetail.getPhone());
CompanyDetail branchCompany = vehicleFeign.getCompanyDetail(companyId).getData();
String companyName = branchCompany.getName();
updAppShareholderDetail.setCompanyName(companyName); updAppShareholderDetail.setCompanyName(companyName);
//用户表更改其身份
Integer userId = 0;
//登陆表查询用户手机号
AppUserLogin userLogin = loginBiz.checkeUserLogin(appShareholderDetailDTO.getPhone());
if (userLogin != null) {
userId = userLogin.getId();
//离职更新用户表身份
if (oldPositionId == null) {
detailBiz.updateUserPositionByUserId(userId, 6);
} else {
detailBiz.updateUserPositionByUserId(userId, oldPositionId);
}
}
//插入记录表 //插入记录表
appShareholderDetailChangeRecordBiz.addAppShareholderDetailChangeRecord(updAppShareholderDetail, updUserId, SHAREHOLDERDE_IS_FALSE); appShareholderDetailChangeRecordBiz.addAppShareholderDetailChangeRecord(updAppShareholderDetail, updUserId, SHAREHOLDERDE_IS_FALSE);
} }
} //复股操作
} else if (appShareholderDetailDTO.getChangeState().equals(3)) {
if (appShareholderDetailDTO.getPhone() == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "请输入股东号码");
}
if (appShareholderDetailDTO.getCompanyList() == null) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, "请输入复股公司");
}
for (String company : appShareholderDetailDTO.getCompanyList()) {
Integer companyId = Integer.valueOf(company);
AppShareholderDetail updAppShareholderDetail = selectById(appShareholderDetail);
//查询股东表,是否为总部股东
Integer oldPositionId = mapper.selectShareHolderByUserIdOrPhone(updAppShareholderDetail.getUserId(), updAppShareholderDetail.getPhone());
//用户表更改其身份
Integer userId = 0;
//登陆表查询用户手机号
AppUserLogin userLogin = loginBiz.checkeUserLogin(appShareholderDetailDTO.getPhone());
if (userLogin != null) {
userId = userLogin.getId();
//关联查询detail表 获取身份
AppUserDetail appUserDetail = detailBiz.checkeIsAppUser(userId);
CompanyDetail branchCompany = vehicleFeign.getCompanyDetail(companyId).getData();
Integer positionId = branchCompany.getId().equals(1) ? HEADQUARTERS_SHAREHOLDER : BRANCH_HEADQUARTERS_SHAREHOLDER;
if (oldPositionId == null) {
detailBiz.updateUserPositionByUserId(userId, positionId);
} else {
if (!(appUserDetail.getPositionId().equals(1))) {
if (oldPositionId > positionId) {
detailBiz.updateUserPositionByUserId(userId, positionId);
} else {
detailBiz.updateUserPositionByUserId(userId, oldPositionId);
}
}
}
}
appShareholderDetail.setIsQuit(SHAREHOLDERDE_IS_TRUE);
//修改
mapper.updShareHolderIsQuit(appShareholderDetailDTO.getPhone(), companyId, 0);
//updateSelectiveById(appShareholderDetail);
appShareholderDetailChangeRecordBiz.addAppShareholderDetailChangeRecord(updAppShareholderDetail, updUserId, SHAREHOLDERDE_IS_TRUE);
}
}
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -373,7 +445,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -373,7 +445,7 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
Integer id = appShareholderDetailDTO.getId() == null ? 0 : appShareholderDetailDTO.getId(); Integer id = appShareholderDetailDTO.getId() == null ? 0 : appShareholderDetailDTO.getId();
BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail); BeanUtils.copyProperties(appShareholderDetailDTO, appShareholderDetail);
appShareholderDetail.setPositionId(positionId); appShareholderDetail.setPositionId(positionId);
appShareholderDetailDTO.setUserId(userId); appShareholderDetail.setUserId(userId);
addUserFindId(appShareholderDetail); addUserFindId(appShareholderDetail);
//插入记录表 //插入记录表
appShareholderDetailChangeRecordBiz.addAppShareholderDetailChangeRecord(appShareholderDetail, operatorId, SHAREHOLDERDE_IS_TRUE); appShareholderDetailChangeRecordBiz.addAppShareholderDetailChangeRecord(appShareholderDetail, operatorId, SHAREHOLDERDE_IS_TRUE);
...@@ -413,4 +485,5 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper, ...@@ -413,4 +485,5 @@ public class AppShareholderDetailBiz extends BaseBiz<AppShareholderDetailMapper,
result.put("exist", exist - total); result.put("exist", exist - total);
return result; return result;
} }
} }
...@@ -41,13 +41,13 @@ public class AppShareholderDetailChangeRecordBiz extends BaseBiz<AppShareholderD ...@@ -41,13 +41,13 @@ public class AppShareholderDetailChangeRecordBiz extends BaseBiz<AppShareholderD
* 查询员工信息变更记录表 * 查询员工信息变更记录表
*/ */
public List<AppShareholderDetailChangeRecord> findShareholderChangeRecord(AppShareholderDetail appShareholderDetail) { public List<AppShareholderDetailChangeRecord> findShareholderChangeRecord(AppShareholderDetail appShareholderDetail) {
Example example = new Example(AppShareholderDetailChangeRecord.class); /* Example example = new Example(AppShareholderDetailChangeRecord.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", appShareholderDetail.getId()); criteria.andEqualTo("userId", appShareholderDetail.getId());
if (appShareholderDetail.getPhone() != null) { if (appShareholderDetail.getPhone() != null) {
criteria.andEqualTo("phone", appShareholderDetail.getPhone()); criteria.andEqualTo("phone", appShareholderDetail.getPhone());
} }*/
List<AppShareholderDetailChangeRecord > list = mapper.selectByExample(example); List<AppShareholderDetailChangeRecord> list = mapper.selectAppshareholderUserOrPhoneOrUserId(appShareholderDetail.getId(), appShareholderDetail.getPhone());
return list; return list;
} }
} }
...@@ -191,9 +191,10 @@ public class AppUserPositionChangeRecordBiz extends BaseBiz<AppUserPositionChang ...@@ -191,9 +191,10 @@ public class AppUserPositionChangeRecordBiz extends BaseBiz<AppUserPositionChang
*/ */
public List<AppUserPositionChangeRecordDTO> findPositionChangeRecord(AppUserPositionTemp userPositionTemp) { public List<AppUserPositionChangeRecordDTO> findPositionChangeRecord(AppUserPositionTemp userPositionTemp) {
Example example = new Example(AppUserPositionChangeRecord.class); Example example = new Example(AppUserPositionChangeRecord.class);
example.createCriteria().andEqualTo("phone", userPositionTemp.getPhone()); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", userPositionTemp.getId());
if (userPositionTemp.getId() != null) { if (userPositionTemp.getId() != null) {
example.createCriteria().andEqualTo("userId", userPositionTemp.getId()); criteria.andEqualTo("phone", userPositionTemp.getPhone());
} }
List<AppUserPositionChangeRecord> list = selectByExample(example); List<AppUserPositionChangeRecord> list = selectByExample(example);
List<AppUserPositionChangeRecordDTO> listAppUserPositionChangeRecordDTO = new ArrayList<>(); List<AppUserPositionChangeRecordDTO> listAppUserPositionChangeRecordDTO = new ArrayList<>();
......
package com.github.wxiaoqi.security.admin.mapper; package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord; import com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface AppShareholderDetailChangeRecordMapper extends Mapper<AppShareholderDetailChangeRecord> { public interface AppShareholderDetailChangeRecordMapper extends Mapper<AppShareholderDetailChangeRecord> {
List<AppShareholderDetailChangeRecord> selectAppshareholderUserOrPhoneOrUserId(@Param("userId") Integer userId, @Param("phone") String phone);
} }
...@@ -23,4 +23,10 @@ public interface AppShareholderDetailMapper extends Mapper<AppShareholderDetail> ...@@ -23,4 +23,10 @@ public interface AppShareholderDetailMapper extends Mapper<AppShareholderDetail>
@Param("positionId") Integer positionId, @Param("positionId") Integer positionId,
@Param("companyId") Integer companyId); @Param("companyId") Integer companyId);
void updShareHolderIsQuit(@Param("phone") String phone, @Param("companyId") Integer companyId,@Param("isQuit") Integer isQuit);
Integer selectMaxShareHolderByUserIdOrPhone(
@Param("phone") String phone,
@Param("userId") Integer userId);
} }
...@@ -112,4 +112,5 @@ public class AppShareholderDetailController { ...@@ -112,4 +112,5 @@ public class AppShareholderDetailController {
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppShareholderDetailChangeRecordMapper"> <mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppShareholderDetailChangeRecordMapper">
<resultMap id="appShareholderDetailMap" type="com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord"> <resultMap id="appShareholderDetailMap"
type="com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="companyName" column="company_name"/> <result property="companyName" column="company_name"/>
<result property="userId" column="user_id"/> <result property="userId" column="user_id"/>
...@@ -13,6 +14,20 @@ ...@@ -13,6 +14,20 @@
<result property="relTime" column="rel_time"/> <result property="relTime" column="rel_time"/>
</resultMap> </resultMap>
<select id="selectAppshareholderUserOrPhoneOrUserId"
resultType="com.github.wxiaoqi.security.admin.entity.AppShareholderDetailChangeRecord">
SELECT *from
app_shareholder_detail_change_record
WHERE
1=1
<if test="userId!=null">
and user_id=#{userId}
</if>
<if test="phone!=null">
or phone=#{phone}
</if>
ORDER BY crt_time DESC
</select>
</mapper> </mapper>
...@@ -14,6 +14,38 @@ ...@@ -14,6 +14,38 @@
<result property="positionId" column="position_id"/> <result property="positionId" column="position_id"/>
</resultMap> </resultMap>
<select id="selectMaxShareHolderByUserIdOrPhone" resultType="java.lang.Integer">
select max(`position_id`) from `app_shareholder_detail` where `is_quit`=0
<choose>
<when test="userId != null and (phone == null or phone != '')">
and `user_id`=#{userId}
</when>
<when test="phone != null and phone != '' and userId == null">
and `phone`=#{phone}
</when>
<otherwise>
and `user_id`=#{userId}
</otherwise>
</choose>
</select>
<select id="updShareHolderIsQuit" resultType="com.github.wxiaoqi.security.admin.entity.AppShareholderDetail">
UPDATE `app_shareholder_detail`
SET
<if test="isQuit!=null">
`is_quit`=#{isQuit}
</if>
WHERE
1 = 1
<if test="phone!=null">
and `phone`=#{phone}
</if>
<if test="companyId!=null">
and `company_id`=#{companyId}
</if>
</select>
<select id="selectShareHolderByUserIdOrPhone" resultType="java.lang.Integer"> <select id="selectShareHolderByUserIdOrPhone" resultType="java.lang.Integer">
select min(`position_id`) from `app_shareholder_detail` where `is_quit`=0 select min(`position_id`) from `app_shareholder_detail` where `is_quit`=0
<choose> <choose>
...@@ -71,7 +103,7 @@ ...@@ -71,7 +103,7 @@
<if test="companyId!=null"> <if test="companyId!=null">
and find_in_set(#{companyId}, a.companyIdArray) and find_in_set(#{companyId}, a.companyIdArray)
</if> </if>
</select> </select>
<resultMap id="detail" type="com.github.wxiaoqi.security.admin.entity.AppShareholderDetail"> <resultMap id="detail" type="com.github.wxiaoqi.security.admin.entity.AppShareholderDetail">
<result property="id" column="id"/> <result property="id" column="id"/>
......
...@@ -330,4 +330,16 @@ public class BaseOrder implements Serializable { ...@@ -330,4 +330,16 @@ public class BaseOrder implements Serializable {
@ApiModelProperty(value = "上级公司员工id") @ApiModelProperty(value = "上级公司员工id")
@Column(name = "parent_position_id") @Column(name = "parent_position_id")
private Integer parentPositionId; private Integer parentPositionId;
/**
* 是否开票
*/
@Column(name = "invoice_status")
private Integer invoiceStatus;
/**
* 开票记录Id
*/
@Column(name = "invoice_id")
private Integer invoiceId;
} }
package com.xxfc.platform.order.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
@Table(name = "order_e_invoice")
@Data
public class OrderInvoice {
/**
* 主键
*/
@Id
private Integer id;
/**
* 发票类型:1--租房车;2--房车游;3--会员
*/
private Integer type;
/**
* 订单ids,逗号分隔
*/
@Column(name = "order_ids")
private String orderIds;
/**
* 发票抬头类型:1--企业单位;2--个人/非企业单位
*/
@Column(name = "title_type")
private Integer titleType;
/**
* 抬头名称
*/
@Column(name = "title_name")
private String titleName;
/**
* 税号
*/
@Column(name = "tax_code")
private String taxCode;
/**
* 发票内容-备注说明
*/
@Column(name = "content_remark")
private String contentRemark;
/**
* 发票内容-地址和电话
*/
@Column(name = "content_contact")
private String contentContact;
/**
* 发票内容-开户行和账号
*/
@Column(name = "content_account")
private String contentAccount;
/**
* 发票方
*/
private String drawer;
/**
* 金额
*/
private BigDecimal amount;
/**
* 接收方式:1--邮件
*/
@Column(name = "receive_type")
private Integer receiveType;
/**
* 接收方式内容
*/
@Column(name = "receive_content")
private String receiveContent;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
/**
* 创建者id
*/
@Column(name = "user_id")
private Integer userId;
/**
* 更新者id
*/
@Column(name = "user_upd")
private Integer userUpd;
/**
* 更多内容
*/
private String extend;
}
\ No newline at end of file
...@@ -38,4 +38,9 @@ public class QueryOrderDTO extends PageParam { ...@@ -38,4 +38,9 @@ public class QueryOrderDTO extends PageParam {
private Integer type; private Integer type;
private String multiTypes; private String multiTypes;
/**
* 开票状态,0未开票,1已开票
*/
private Integer invoiceStatus;
} }
\ No newline at end of file
...@@ -799,6 +799,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -799,6 +799,20 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
sendQueue(orderMQDTO, sign); sendQueue(orderMQDTO, sign);
} }
public ObjectRestResponse updateBaseOrder(BaseOrder baseOrder) {
if(baseOrder.getId() == null) {
return ObjectRestResponse.paramIsEmpty();
}
BaseOrder oldValue = mapper.selectByPrimaryKey(baseOrder.getId());
if (oldValue == null) {
return ObjectRestResponse.createFailedResult(ResCode.ORDER_IS_NOT_EXIST.getCode(), ResCode.ORDER_IS_NOT_EXIST.getDesc());
}
BeanUtil.copyProperties(baseOrder, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
updateSelectiveByIdReT(oldValue);
return ObjectRestResponse.succ();
}
@Override @Override
public void updateSelectiveById(BaseOrder entity) { public void updateSelectiveById(BaseOrder entity) {
super.updateSelectiveById(entity); super.updateSelectiveById(entity);
......
package com.xxfc.platform.order.biz;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
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.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderInvoice;
import com.xxfc.platform.order.mapper.OrderInvoiceMapper;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import javax.servlet.http.HttpServletRequest;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 订单发票记录
*/
@Service
@Slf4j
public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper, OrderInvoice> {
@Autowired
BaseOrderBiz baseOrderBiz;
@Autowired
UserFeign userFeign;
@Autowired
HttpServletRequest request;
/**
* 添加发票记录
* @return
*/
@Transactional
public ObjectRestResponse add(OrderInvoice orderInvoice) {
AppUserDTO appUserDTO = userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, ResultCode.getMsg(ResultCode.RSTOKEN_EXPIRED_CODE));
}
if (orderInvoice == null || StringUtils.isBlank(orderInvoice.getOrderIds())) {
return ObjectRestResponse.paramIsEmpty();
}
String[] orderIdArray = orderInvoice.getOrderIds().split(",");
if (orderIdArray.length > 0) {
for (int a = 0; a <= orderIdArray.length - 1; a ++) {
String orderId = StringUtils.isBlank(orderIdArray[a])? "0" : orderIdArray[a];
BaseOrder baseOrder = baseOrderBiz.selectById(Integer.parseInt(orderId));
if (baseOrder == null) {
return ObjectRestResponse.createFailedResult(ResCode.ORDER_IS_NOT_EXIST.getCode(), ResCode.ORDER_IS_NOT_EXIST.getDesc() + ", 订单Id = " + orderId);
}
//查询是否已开票
OrderInvoice oldValue = selectByUserIdAndOrderId(appUserDTO.getUserid(), Integer.parseInt(orderId)).getData();
if (oldValue == null) { //不存在就添加
orderInvoice.setUserId(appUserDTO.getUserid());
insertSelectiveRe(orderInvoice);
log.info("添加发票记录成功: {}", orderInvoice);
OrderInvoice newValue = selectByUserIdAndOrderId(appUserDTO.getUserid(), Integer.parseInt(orderId)).getData();
if(newValue != null) {
baseOrder.setInvoiceStatus(1);
baseOrder.setInvoiceId(newValue.getId());
baseOrderBiz.updateBaseOrder(baseOrder);
} else {
return ObjectRestResponse.createFailedResult(ResultCode.DB_OPERATION_FAIL_CODE, ResultCode.getMsg(ResultCode.DB_OPERATION_FAIL_CODE));
}
} else {//已开票
log.info("该订单已经开票, {}", orderId);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "该订单已经开票: orderId = " + orderId);
}
}
}
return ObjectRestResponse.succ();
}
/**
* 根据orderIds字符串查询对应的发票记录
* @param orderIds
* @return
*/
public ObjectRestResponse<List<OrderInvoice>> selectByIds(String orderIds) {
AppUserDTO appUserDTO = userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, ResultCode.getMsg(ResultCode.RSTOKEN_EXPIRED_CODE));
}
if (StringUtils.isBlank(orderIds)) {
return ObjectRestResponse.paramIsEmpty();
}
Set<OrderInvoice> set = new HashSet<>();
String[] orderIdArray = orderIds.split(",");
if (orderIdArray.length > 0) {
for (int a = 0; a <= orderIdArray.length -1; a++) {
OrderInvoice orderInvoice = selectByUserIdAndOrderId(appUserDTO.getUserid(), Integer.parseInt(orderIdArray[a])).getData();
if(orderInvoice != null) {
set.add(orderInvoice);
}
}
}
return ObjectRestResponse.succ(set);
}
/**
* 获取用户的发票记录列表
* @return
*/
public ObjectRestResponse<List<OrderInvoice>> selectByToken(Integer type) {
AppUserDTO appUserDTO = userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, ResultCode.getMsg(ResultCode.RSTOKEN_EXPIRED_CODE));
}
Example example = new Example(OrderInvoice.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", appUserDTO.getUserid());
if (type != null) {
criteria.andEqualTo("type", type);
}
return ObjectRestResponse.succ(mapper.selectByExample(example));
}
/**
* 根据用户Id获取用户发票记录
* @param userId
* @return
*/
public ObjectRestResponse<List<OrderInvoice>> selectByUserId(Integer userId, Integer type) {
Example example = new Example(OrderInvoice.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId", userId);
if (type != null) {
criteria.andEqualTo("type", type);
}
return ObjectRestResponse.succ(mapper.selectByExample(example));
}
public ObjectRestResponse<OrderInvoice> selectByUserIdAndOrderId(Integer userId, Integer orderId) {
return ObjectRestResponse.succ(mapper.selectByUserIdAndOrderId(new OrderInvoice(){{
setUserId(userId);
setOrderIds(orderId + "");
}}));
}
}
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.OrderInvoice;
import tk.mybatis.mapper.common.Mapper;
public interface OrderInvoiceMapper extends Mapper<OrderInvoice> {
OrderInvoice selectByUserIdAndOrderId(OrderInvoice orderInvoice);
}
\ No newline at end of file
...@@ -19,11 +19,11 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO; ...@@ -19,11 +19,11 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.order.biz.*; import com.xxfc.platform.order.biz.*;
import com.xxfc.platform.order.biz.inner.OrderCancelBiz; import com.xxfc.platform.order.biz.inner.OrderCancelBiz;
import com.xxfc.platform.order.biz.inner.OrderMsgBiz; import com.xxfc.platform.order.biz.inner.OrderMsgBiz;
import com.xxfc.platform.order.contant.enumerate.*; import com.xxfc.platform.order.contant.enumerate.CrosstownTypeEnum;
import com.xxfc.platform.order.contant.enumerate.OrderStatusEnum;
import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.*; import com.xxfc.platform.order.entity.*;
import com.xxfc.platform.order.mqhandler.RabbitProduct; import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.account.OrderAccountDeduction;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import com.xxfc.platform.order.pojo.dto.OrderDTO; import com.xxfc.platform.order.pojo.dto.OrderDTO;
import com.xxfc.platform.order.pojo.mq.OrderMQDTO; import com.xxfc.platform.order.pojo.mq.OrderMQDTO;
import com.xxfc.platform.order.pojo.order.CancelOrderDTO; import com.xxfc.platform.order.pojo.order.CancelOrderDTO;
...@@ -58,7 +58,6 @@ import java.util.List; ...@@ -58,7 +58,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER; import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
...@@ -482,4 +481,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes ...@@ -482,4 +481,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
//ObjectRestResponse.succ(baseOrderBiz.selectBaeOrderByOrderIds(orderIds)); //ObjectRestResponse.succ(baseOrderBiz.selectBaeOrderByOrderIds(orderIds));
} }
@RequestMapping(value = "/updateOrder", method = RequestMethod.POST)
public ObjectRestResponse updateOrder(@RequestBody BaseOrder baseOrder) {
return baseOrderBiz.updateBaseOrder(baseOrder);
}
} }
package com.xxfc.platform.order.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.order.biz.OrderInvoiceBiz;
import com.xxfc.platform.order.entity.OrderInvoice;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 发票记录
*/
@RestController
@RequestMapping(value = "/order/invoice")
public class OrderInvoiceController extends BaseController<OrderInvoiceBiz, OrderInvoice> {
@PostMapping(value = "/add")
public ObjectRestResponse add(@RequestBody OrderInvoice orderInvoice) {
return baseBiz.add(orderInvoice);
}
@GetMapping(value = "selectByOrderIds")
public ObjectRestResponse<List<OrderInvoice>> selectByOrderIds(String orderIds) {
return baseBiz.selectByIds(orderIds);
}
@GetMapping(value = "selectByType")
public ObjectRestResponse<List<OrderInvoice>> selectByToken(Integer type) {
return baseBiz.selectByToken(type);
}
@GetMapping(value = "getByUser")
public ObjectRestResponse<List<OrderInvoice>> selectByUserId(Integer userId, Integer type) {
return baseBiz.selectByUserId(userId, type);
}
}
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
<!-- </table>--> <!-- </table>-->
<!-- <table tableName="branch_company_stock_info" domainObjectName="BranchCompanyStockInfo"></table>--> <!-- <table tableName="branch_company_stock_info" domainObjectName="BranchCompanyStockInfo"></table>-->
<!-- <table tableName="branch_company_stock_apply_info" domainObjectName="BranchCompanyStockApplyInfo"></table>--> <!-- <table tableName="branch_company_stock_apply_info" domainObjectName="BranchCompanyStockApplyInfo"></table>-->
<table tableName="deposit_refund_record" domainObjectName="DepositRefundRecord"></table> <table tableName="order_e_invoice" domainObjectName="OrderInvoice"></table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
\ No newline at end of file
...@@ -3,28 +3,6 @@ ...@@ -3,28 +3,6 @@
<mapper namespace="com.xxfc.platform.order.mapper.BaseOrderMapper"> <mapper namespace="com.xxfc.platform.order.mapper.BaseOrderMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.xxfc.platform.order.entity.BaseOrder" id="baseOrderMap">
<result property="id" column="id"/>
<result property="no" column="no"/>
<result property="type" column="type"/>
<result property="detailId" column="detail_id"/>
<result property="status" column="status"/>
<result property="productAmount" column="product_amount"/>
<result property="orderAmount" column="order_amount"/>
<result property="detailJson" column="detail_json"/>
<result property="thirdType" column="third_type"/>
<result property="outTradeNo" column="out_trade_no"/>
<result property="crtTime" column="crt_time"/>
<result property="crtUser" column="crt_user"/>
<result property="crtName" column="crt_name"/>
<result property="crtHost" column="crt_host"/>
<result property="updTime" column="upd_time"/>
<result property="updUser" column="upd_user"/>
<result property="updName" column="upd_name"/>
<result property="updHost" column="upd_host"/>
</resultMap>
<resultMap type="com.xxfc.platform.order.pojo.order.OrderPageVO" id="orderPageMap"> <resultMap type="com.xxfc.platform.order.pojo.order.OrderPageVO" id="orderPageMap">
<result javaType="Integer" column="type" property="type"></result> <result javaType="Integer" column="type" property="type"></result>
<discriminator javaType="Integer" column="type"> <discriminator javaType="Integer" column="type">
...@@ -90,6 +68,9 @@ ...@@ -90,6 +68,9 @@
<if test="type != null"> <if test="type != null">
and type = #{type} and type = #{type}
</if> </if>
<if test="invoiceStatus != null">
and invoice_status = #{invoiceStatus}
</if>
<if test="hasMemberRight != null"> <if test="hasMemberRight != null">
and has_member_right = #{hasMemberRight} and has_member_right = #{hasMemberRight}
</if> </if>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.order.mapper.OrderInvoiceMapper" >
<select id="selectByUserIdAndOrderId" parameterType="com.xxfc.platform.order.entity.OrderInvoice" resultType="com.xxfc.platform.order.entity.OrderInvoice">
select * from order_e_invoice where user_id = #{userId} and order_ids like concat("%", #{orderIds}, "%")
</select>
</mapper>
\ No newline at end of file
...@@ -18,6 +18,7 @@ import io.swagger.annotations.Api; ...@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -54,6 +55,17 @@ public class VehicleModelController extends CommonBaseController { ...@@ -54,6 +55,17 @@ public class VehicleModelController extends CommonBaseController {
return objectRestResponse; return objectRestResponse;
} }
@ApiOperation("车型详情")
@GetMapping(value = "/detail")
@IgnoreUserToken
public ObjectRestResponse<VModelDetailVO> getDetails(@RequestParam("id") @ApiParam("车型名称") Integer id) {
ObjectRestResponse<VModelDetailVO> objectRestResponse = vehicleFeign.detailByParam(BeanUtil.beanToMap(new VehicleModel(){{
setId(id);
}}, false, true));
objectRestResponse.getData().setUccnCataList(initUccnCataCollect(objectRestResponse.getData().getConfig()));
return objectRestResponse;
}
/** /**
* 车型列表查 * 车型列表查
* *
......
...@@ -2,24 +2,17 @@ package com.xxfc.platform.universal.controller; ...@@ -2,24 +2,17 @@ package com.xxfc.platform.universal.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.constant.VideoConstant;
import com.xxfc.platform.universal.dto.ImgDTO; import com.xxfc.platform.universal.dto.ImgDTO;
import com.xxfc.platform.universal.dto.UploadImgDTO; import com.xxfc.platform.universal.dto.UploadImgDTO;
import com.xxfc.platform.universal.service.FileUploadService; import com.xxfc.platform.universal.service.FileUploadService;
import com.xxfc.platform.universal.service.UploadService; import com.xxfc.platform.universal.service.UploadService;
import com.xxfc.platform.universal.service.UploadZipService; import com.xxfc.platform.universal.service.UploadZipService;
import com.xxfc.platform.universal.utils.ImgBase64Util;
import com.xxfc.platform.universal.utils.PublicMsg; import com.xxfc.platform.universal.utils.PublicMsg;
import com.xxfc.platform.universal.vo.Ueditor; import com.xxfc.platform.universal.vo.Ueditor;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -27,7 +20,6 @@ import org.springframework.web.bind.annotation.*; ...@@ -27,7 +20,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -172,6 +164,9 @@ public class UploadController{ ...@@ -172,6 +164,9 @@ public class UploadController{
@RequestMapping(value="/app/unauth/ueditor", method = RequestMethod.POST) @RequestMapping(value="/app/unauth/ueditor", method = RequestMethod.POST)
public Ueditor imgUpload(MultipartFile upfile) throws Exception { public Ueditor imgUpload(MultipartFile upfile) throws Exception {
Ueditor ueditor = new Ueditor(); Ueditor ueditor = new Ueditor();
if (upfile == null) {
return ueditor;
}
ueditor.setUrl(uploadService.uploadFile(upfile,"admin")); ueditor.setUrl(uploadService.uploadFile(upfile,"admin"));
ueditor.setOriginal(upfile.getOriginalFilename()); ueditor.setOriginal(upfile.getOriginalFilename());
ueditor.setState("SUCCESS"); ueditor.setState("SUCCESS");
......
...@@ -211,6 +211,6 @@ public interface VehicleFeign { ...@@ -211,6 +211,6 @@ public interface VehicleFeign {
@GetMapping("/branchCompany/company_info") @GetMapping("/branchCompany/company_info")
Map<Integer, String> findCompanyMap(); Map<Integer, String> findCompanyMap();
@RequestMapping(value ="/branchCompany/{id}",method = RequestMethod.GET) /* @RequestMapping(value ="/branchCompany/{id}",method = RequestMethod.GET)
RestResponse<BranchCompany> get(@PathVariable Integer id); RestResponse<BranchCompany> get(@PathVariable Integer id);*/
} }
...@@ -5,7 +5,7 @@ import lombok.Data; ...@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
@Data @Data
public class ResultVehicleVo { public class ResultVehicleVo {
/** /**
* 主键(uuid) * 主键(uuid)
*/ */
......
package com.xxfc.platform.vehicle.pojo; package com.xxfc.platform.vehicle.pojo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.HashMap;
import java.util.Map;
@Data @Data
public class VehicleExcelVo { @Builder
@NoArgsConstructor
@AllArgsConstructor
public class VehicleExcelVo {
private static Map<Integer, String> map = new HashMap();
static {
map.put(1, "正常运行");
map.put(3, "报废");
map.put(4, "出车");
map.put(6, "维修");
map.put(7, "保养");
map.put(8, "上牌");
}
/** /**
* 车牌号,空字符串-没有 * 车牌号,空字符串-没有
...@@ -34,7 +51,21 @@ public class VehicleExcelVo { ...@@ -34,7 +51,21 @@ public class VehicleExcelVo {
/** /**
* 停靠分支机构(名) * 停靠分支机构(名)
*/ */
private String parkBranchCompanyName; private String parkBranchCompanyName;
/**
* 车辆状态: 1-正常运行 2-维修 3-报废
*/
private Integer status;
/**
* 所属人 名称
*/
private String belongToName;
public String getStatus() {
return map.get(status);
}
} }
package com.xxfc.platform.vehicle.pojo; package com.xxfc.platform.vehicle.pojo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
...@@ -138,6 +139,9 @@ public class VehiclePageQueryVo { ...@@ -138,6 +139,9 @@ public class VehiclePageQueryVo {
*/ */
private Integer modelId; private Integer modelId;
/**
* 判断是否需要下载
*/
private boolean download;
} }
...@@ -67,8 +67,8 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -67,8 +67,8 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
try { try {
if (StringUtils.isNotBlank(vehiclePageQueryVoJson)){ if (StringUtils.isNotBlank(vehiclePageQueryVoJson)){
vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson, VehiclePageQueryVo.class); vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson, VehiclePageQueryVo.class);
vehiclePageQueryVo.setDownload(true);
} }
if (userDTO.getDataAll() == 2) { if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany()); List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return getByPageNotAllData(vehiclePageQueryVo, companyList); return getByPageNotAllData(vehiclePageQueryVo, companyList);
...@@ -85,11 +85,22 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -85,11 +85,22 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception { public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception {
List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO); List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO);
ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList(); ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList();
resultVehicleVoList.parallelStream().forEach(result->{ resultVehicleVoList.stream().forEach(result->{
try { try {
VehicleExcelVo vehicleExcelVo = new VehicleExcelVo(); Integer belongTo = result.getBelongTo();
BeanUtilsBean.getInstance().copyProperties(vehicleExcelVo,result); if (belongTo!=null&& belongTo==1) {
arrayList.add(vehicleExcelVo); System.out.println(belongTo);
}
VehicleExcelVo build = VehicleExcelVo.builder()
.code(result.getCode())
.numberPlate(result.getNumberPlate())
.parkBranchCompanyName(result.getParkBranchCompanyName())
.status(result.getStatus())
.useTypeName(result.getUseTypeName())
.vehicleType(result.getVehicleType())
.belongToName(result.getBelongTo()!=null&&result.getBelongTo()==1?"欣新房车有限公司":result.getBelongToName())
.build();
arrayList.add(build);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -50,13 +50,18 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle ...@@ -50,13 +50,18 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
if (userDTO == null) { if (userDTO == null) {
throw new BaseException("token已失效"); throw new BaseException("token已失效");
} }
List<VehicleExcelVo> rows = baseBiz.getList(vehiclePageQueryVoJson, userDTO); List<VehicleExcelVo> rows = baseBiz.getList(vehiclePageQueryVoJson, userDTO);
ExcelWriter writer = ExcelUtil.getWriter(true); ExcelWriter writer = ExcelUtil.getWriter(true);
writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("code", "车辆编码"); writer.addHeaderAlias("code", "车辆编码");
writer.addHeaderAlias("vehicleType", "车型"); writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("useTypeName", "用途"); writer.addHeaderAlias("status", "车辆状态");
writer.addHeaderAlias("vehicleType", "车辆品牌");
writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司"); writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司");
writer.addHeaderAlias("useTypeName", "用途");
writer.addHeaderAlias("belongToName", "托管人");
// 一次性写出内容,使用默认样式,强制输出标题 // 一次性写出内容,使用默认样式,强制输出标题
writer.write(rows, true); writer.write(rows, true);
//response为HttpServletResponse对象 //response为HttpServletResponse对象
......
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