提交 9f57e6e2 作者: xiaowang

修复bug

上级 6822cee1
package com.mmc.pms.auth.dto; package com.mmc.pms.auth.dto;
import com.mmc.pms.model.group.Insert;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -20,27 +22,27 @@ import javax.validation.constraints.NotNull; ...@@ -20,27 +22,27 @@ import javax.validation.constraints.NotNull;
public class CompanyInfoVO { public class CompanyInfoVO {
private static final long serialVersionUID = 3247519744829926132L; private static final long serialVersionUID = 3247519744829926132L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
private Integer id; private Integer id;
@ApiModelProperty(value = "单位类型,0科比特,1加盟公司", example = "0") @ApiModelProperty(value = "单位类型,0科比特,1加盟公司", example = "0")
@NotNull(message = "单位类型不能为空", groups = {Insert.class})
private Integer companyType; private Integer companyType;
@ApiModelProperty(value = "单位名称", example = "科比特") @ApiModelProperty(value = "单位名称", example = "科比特")
@NotNull(message = "单位名称不能为空", groups = {Insert.class})
private String companyName; private String companyName;
@ApiModelProperty(value = "单位全称", example = "浙江科比特创新科技有限公司") @ApiModelProperty(value = "单位全称", example = "浙江科比特创新科技有限公司")
private String fullName; private String fullName;
@ApiModelProperty(value = "省份名称", example = "广东省") @ApiModelProperty(value = "省份名称", example = "广东省", hidden = true)
@NotNull(message = "省份名称不能为空")
private String province; private String province;
@ApiModelProperty(value = "城市名称", example = "深圳市") @ApiModelProperty(value = "城市名称", example = "深圳市", hidden = true)
@NotNull(message = "城市名称不能为空")
private String city; private String city;
@ApiModelProperty(value = "县区名称", example = "南山区") @ApiModelProperty(value = "县区名称", example = "南山区", hidden = true)
@NotNull(message = "县区名称不能为空")
private String district; private String district;
@ApiModelProperty(value = "详细地址", example = "西丽街道万科云城国际创新谷6栋") @ApiModelProperty(value = "详细地址", example = "西丽街道万科云城国际创新谷6栋")
@NotNull(message = "详细地址不能为空", groups = {Insert.class})
private String address; private String address;
@ApiModelProperty(value = "联系人", example = "lx") @ApiModelProperty(value = "联系人", example = "lx")
private String companyUserName; private String companyUserName;
...@@ -48,4 +50,32 @@ public class CompanyInfoVO { ...@@ -48,4 +50,32 @@ public class CompanyInfoVO {
private String phoneNum; private String phoneNum;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "小程序用户id")
private Integer userAccountId;
@ApiModelProperty(value = "后台用户id")
private Integer backUserAccountId;
@ApiModelProperty(value = "纬度")
private Double lat;
@ApiModelProperty(value = "经度")
private Double lon;
@ApiModelProperty(value = "社会信用代码")
private String creditCode;
@ApiModelProperty(value = "营业执照")
private String licenseImg;
@ApiModelProperty(value = "品牌名称", example = "科比特")
private String brandName;
@ApiModelProperty(value = "品牌logo", example = "http://")
private String brandLogo;
@ApiModelProperty(value = "管理员标识")
private Integer leader;
@ApiModelProperty(value = "服务资质信息", example = "5星店铺")
private String content;
@ApiModelProperty(value = "评分", example = "*****")
private Integer score;
@ApiModelProperty(value = "背景图", example = "http://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/3505c402-cbf9-41a5-9d6f-bdb350625bea.jpg")
private String backImg;
@ApiModelProperty(value = "当前距离")
private Double distance;
} }
...@@ -87,4 +87,7 @@ public interface UserAppApi { ...@@ -87,4 +87,7 @@ public interface UserAppApi {
@PostMapping("/userapp/company/listCompanyInfoByIds") @PostMapping("/userapp/company/listCompanyInfoByIds")
List<CompanyInfoVO> feignListCompanyInfoByIds(@RequestBody List<Integer> ids, @RequestHeader("token") String token); List<CompanyInfoVO> feignListCompanyInfoByIds(@RequestBody List<Integer> ids, @RequestHeader("token") String token);
@PostMapping("/userapp/company/listCompanyInfoByBUIds")
List<CompanyInfoVO> listCompanyInfoByBUIds(@RequestBody List<Integer> backUserAccountIds);
} }
...@@ -59,4 +59,10 @@ public class UserAppApiHystrix implements UserAppApi { ...@@ -59,4 +59,10 @@ public class UserAppApiHystrix implements UserAppApi {
log.error("熔断:feignListCompanyInfoByIds:{}", ids); log.error("熔断:feignListCompanyInfoByIds:{}", ids);
return null; return null;
} }
@Override
public List<CompanyInfoVO> listCompanyInfoByBUIds(List<Integer> backUserAccountIds) {
log.error("熔断:listCompanyInfoByBUIds:{}", backUserAccountIds);
return null;
}
} }
...@@ -127,7 +127,9 @@ public class LeaseGoodsVO implements Serializable { ...@@ -127,7 +127,9 @@ public class LeaseGoodsVO implements Serializable {
@ApiModelProperty(value = "型号名称", hidden = true) @ApiModelProperty(value = "型号名称", hidden = true)
private String deviceModeName; private String deviceModeName;
@ApiModelProperty(value = "配送方式信息", hidden = true) @ApiModelProperty(value = "配送方式信息", hidden = true)
private String modeOfDeliveryInfo; private String modeOfDeliveryInfo;
@ApiModelProperty(value = "企业名称",hidden = true)
private String companyName;
} }
package com.mmc.pms.service.lease.impl; package com.mmc.pms.service.lease.impl;
import com.mmc.pms.auth.dto.CompanyInfoVO;
import com.mmc.pms.auth.dto.LoginSuccessDTO; import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody; import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.lease.LeaseGoodsDao; import com.mmc.pms.dao.lease.LeaseGoodsDao;
import com.mmc.pms.entity.lease.*; import com.mmc.pms.entity.lease.*;
import com.mmc.pms.feign.UserAppApi;
import com.mmc.pms.model.lease.qo.LeaseGoodsQO; import com.mmc.pms.model.lease.qo.LeaseGoodsQO;
import com.mmc.pms.model.lease.vo.LeaseGoodsVO; import com.mmc.pms.model.lease.vo.LeaseGoodsVO;
import com.mmc.pms.model.lease.vo.LeasePartsListVO; import com.mmc.pms.model.lease.vo.LeasePartsListVO;
...@@ -34,6 +36,8 @@ public class LeaseGoodsServiceImpl implements LeaseGoodsService { ...@@ -34,6 +36,8 @@ public class LeaseGoodsServiceImpl implements LeaseGoodsService {
MallGoodsService mallGoodsService; MallGoodsService mallGoodsService;
@Resource @Resource
LeaseGoodsDao leaseGoodsDao; LeaseGoodsDao leaseGoodsDao;
@Resource
UserAppApi userAppApi;
@Override @Override
public ResultBody addLeaseGoods(LeaseGoodsVO leaseGoodsVO, Integer userAccountId) { public ResultBody addLeaseGoods(LeaseGoodsVO leaseGoodsVO, Integer userAccountId) {
...@@ -138,7 +142,16 @@ public class LeaseGoodsServiceImpl implements LeaseGoodsService { ...@@ -138,7 +142,16 @@ public class LeaseGoodsServiceImpl implements LeaseGoodsService {
// 转成vo // 转成vo
List<LeaseGoodsVO> leaseGoodsVOList = leaseGoodsDOList.stream().map(LeaseGoodsDO::buildLeaseGoodsVO) List<LeaseGoodsVO> leaseGoodsVOList = leaseGoodsDOList.stream().map(LeaseGoodsDO::buildLeaseGoodsVO)
.skip(param.getPageNo()).limit(param.getPageSize()).collect(Collectors.toList()); .skip(param.getPageNo()).limit(param.getPageSize()).collect(Collectors.toList());
// 获取公司
List<Integer> userIds = leaseGoodsVOList.stream().map(LeaseGoodsVO::getUserAccountId).collect(Collectors.toList());
List<CompanyInfoVO> companyInfoVOS = userAppApi.listCompanyInfoByBUIds(userIds);
leaseGoodsVOList = leaseGoodsVOList.stream().peek(d -> { leaseGoodsVOList = leaseGoodsVOList.stream().peek(d -> {
for (CompanyInfoVO companyInfoVO : companyInfoVOS) {
if (companyInfoVO.getBackUserAccountId().equals(d.getUserAccountId())){
d.setCompanyName(companyInfoVO.getCompanyName());
break;
}
}
// 获取最低押金及最高押金 // 获取最低押金及最高押金
List<LeasePriceStockVO> list = d.getPriceStock().stream().sorted(Comparator.comparing(LeasePriceStockVO::getCashPledge)).collect(Collectors.toList()); List<LeasePriceStockVO> list = d.getPriceStock().stream().sorted(Comparator.comparing(LeasePriceStockVO::getCashPledge)).collect(Collectors.toList());
LeasePriceStockVO lastElement = list.get(list.size() - 1); LeasePriceStockVO lastElement = list.get(list.size() - 1);
......
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
FROM lease_spec_attr lsa FROM lease_spec_attr lsa
LEFT JOIN lease_spec_attr_value lsav ON lsa.id = lsav.spec_attr_id LEFT JOIN lease_spec_attr_value lsav ON lsa.id = lsav.spec_attr_id
<where> <where>
lsa.lease_goods_id in ( lsa.id in (
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论