Authored by mali

二手

package com.yoho.product.dal;
import com.yoho.product.model.AuditRejectInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AuditRejectInfoMapper {
int insert(AuditRejectInfo record);
List<AuditRejectInfo> selectBySkups(@Param("list")List<Integer> list);
}
\ No newline at end of file
... ...
package com.yoho.product.model;
import com.alibaba.fastjson.JSONObject;
public class AuditRejectInfo {
private Integer id;
private Integer skup;
private String info;
private Integer updateTime;
public AuditRejectInfo() {
}
public AuditRejectInfo(Integer skup, String info) {
this.skup = skup;
this.info = info;
}
public AuditRejectInfo(Integer skup, String info, Integer updateTime) {
this(skup, info);
this.updateTime = updateTime;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSkup() {
return skup;
}
public void setSkup(Integer skup) {
this.skup = skup;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info == null ? null : info.trim();
}
public Integer getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Integer updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
}
}
\ No newline at end of file
... ...
<?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.yoho.product.dal.AuditRejectInfoMapper" >
<resultMap id="BaseResultMap" type="com.yoho.product.model.AuditRejectInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="skup" property="skup" jdbcType="INTEGER" />
<result column="info" property="info" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, skup, info, update_time
</sql>
<select id="selectBySkups" resultMap="BaseResultMap" >
select <include refid="Base_Column_List" />
from audit_reject_info where skup in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<insert id="insert" parameterType="com.yoho.product.model.AuditRejectInfo" >
insert into audit_reject_info (skup, info, update_time)
values ( #{skup,jdbcType=INTEGER}, #{info,jdbcType=VARCHAR}, #{updateTime,jdbcType=INTEGER})
</insert>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.service.impl;
import com.yoho.product.dal.AuditRejectInfoMapper;
import com.yoho.product.model.AuditRejectInfo;
import com.yoho.ufo.util.DateUtil;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by li.ma on 2019/4/8.
*/
@Service
public class AuditRejectInfoService {
@Autowired
private AuditRejectInfoMapper auditRejectInfoMapper;
public int insert(AuditRejectInfo record) {
record.setUpdateTime(DateUtil.getCurrentTimeSeconds());
return auditRejectInfoMapper.insert(record);
}
public List<AuditRejectInfo> selectBySkups(List<Integer> list) {
return auditRejectInfoMapper.selectBySkups(list);
}
public Map<Integer, String> selectBySkupsEx(List<Integer> list) {
List<AuditRejectInfo> auditRejectInfos = selectBySkups(list);
return auditRejectInfos.stream().collect(Collectors.toMap(AuditRejectInfo::getSkup, AuditRejectInfo::getInfo));
}
}
... ...
package com.yoho.ufo.service.impl;
import com.yoho.product.model.AuditRejectInfo;
import com.yoho.ufo.constants.ProductConstants;
import com.yoho.ufo.dal.*;
import com.yoho.ufo.dal.model.Goods;
... ... @@ -11,6 +12,7 @@ import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
import com.yoho.ufo.model.commoditybasicrole.color.ProductColor;
import com.yoho.ufo.model.commoditybasicrole.size.Size;
import com.yoho.ufo.util.CollectionUtil;
import com.yohobuy.ufo.model.enums.ProductSkupStatusEnum;
import com.yohobuy.ufo.model.enums.StorageTypeEnum;
import com.yohobuy.ufo.model.resp.product.ProductResponceBo;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -52,6 +54,9 @@ public class ProductAssistService {
@Autowired
private UfoSizeMapper sizeMapper;
@Autowired
private AuditRejectInfoService auditRejectInfoService;
// 商品列表填充品牌名称
public ProductAssistService fillBrandName(List<ProductResponceBo> productResponceBos) {
if (CollectionUtils.isEmpty(productResponceBos)) {
... ... @@ -190,9 +195,13 @@ public class ProductAssistService {
return this;
}
List<Integer> skupList = productResponceBos.stream().filter(item -> item.getStatus() == 11).map(ProductResponceBo::getSkup).collect(Collectors.toList());
// 只查询审核不通过
List<Integer> skupList = productResponceBos.stream().filter(item -> ProductSkupStatusEnum.CHECK_REJEST.getStatus().equals(item.getStatus()))
.map(ProductResponceBo::getSkup).collect(Collectors.toList());
Map<Integer, String> auditRejectInfos = auditRejectInfoService.selectBySkupsEx(skupList);
productResponceBos.stream().forEach(item -> item.setCheckRejustReason(auditRejectInfos.get(item.getSkup())));
return this;
}
}
... ...
... ... @@ -10,6 +10,7 @@ datasources:
- com.yohobuy.platform.dal.product.IProductSortMapper
- com.yoho.product.dal.ProductSelfShelvesMapper
- com.yoho.product.dal.ProductSelfShelvesPicMapper
- com.yoho.product.dal.AuditRejectInfoMapper
ufo_order:
servers:
... ...
... ... @@ -10,6 +10,7 @@ datasources:
- com.yohobuy.platform.dal.product.IBrandDao
- com.yoho.product.dal.ProductSelfShelvesMapper
- com.yoho.product.dal.ProductSelfShelvesPicMapper
- com.yoho.product.dal.AuditRejectInfoMapper
ufo_order:
servers:
... ...
... ... @@ -184,7 +184,12 @@
width: 50,
align: "center",
formatter: function (value, rowData) {
return ENUM.sku_p_status[value];
var statusStr = ENUM.sku_p_status[value];
if (value == 11) // 如果是审核不通过,则显示不通过的原因
{
statusStr += '(' + rowData.checkRejustReason + ')';
}
return statusStr;
},
}, {
title: "创建时间",
... ...