Authored by caoyan

Merge branch 'test6.9.9' of http://git.yoho.cn/ufo/ufo-platform into test6.9.9

package com.yoho.order.dal;
import com.yoho.order.model.ProductSize;
public interface ProductSizeMapper {
int insert(ProductSize record);
int updateBySizeId(ProductSize record);
}
\ No newline at end of file
... ...
... ... @@ -22,7 +22,7 @@ public interface StorageDepositMapper {
* @param curTime
* @return 最多返回500条记录,怕内存不够
*/
List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") Integer remindStatus);
List<StorageDeposit> selectNeddRemindDeposit(@Param("curTime") Integer curTime, @Param("remindStatus") List<Integer> remindStatus);
/**
* 更新通知快到期的状态
... ...
package com.yoho.order.model;
import lombok.Data;
@Data
public class ProductSize {
private Integer id;
private Integer sizeId;
private String sizeName;
private Integer orderBy;
private Integer createTime;
private Integer updateTime;
}
\ 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.order.dal.ProductSizeMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.ProductSize" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="size_id" property="sizeId" jdbcType="INTEGER" />
<result column="size_name" property="sizeName" jdbcType="VARCHAR" />
<result column="order_by" property="orderBy" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, size_id, size_name, order_by, create_time, update_time
</sql>
<insert id="insert" parameterType="com.yoho.order.model.ProductSize" >
insert into product_size (id, size_id, size_name,
order_by, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{sizeId,jdbcType=INTEGER}, #{sizeName,jdbcType=VARCHAR},
#{orderBy,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER},
#{updateTime,jdbcType=INTEGER})
</insert>
<update id="updateBySizeId" parameterType="com.yoho.order.model.ProductSize" >
update product_size
<set >
<if test="sizeName != null" >
size_name = #{sizeName,jdbcType=VARCHAR},
</if>
<if test="orderBy != null" >
order_by = #{orderBy,jdbcType=INTEGER},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=INTEGER},
</if>
</set>
where size_id = #{sizeId,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -95,7 +95,11 @@
<select id="selectNeddRemindDeposit" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from storage_deposit WHERE del_status = 0 and deposit_end_time &lt;= #{curTime} and remind_status = #{remindStatus} AND status = 1 limit 500
from storage_deposit WHERE del_status = 0 and deposit_end_time &lt;= #{curTime} and remind_status in
<foreach collection="remindStatus" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
AND status = 1 limit 500
</select>
<update id="updateHasRemind">
... ...
... ... @@ -11,6 +11,7 @@ import com.yoho.ufo.model.ChannelSkuCompareReq;
import com.yoho.ufo.model.ChannelSkuCompareRspBo;
import com.yoho.ufo.order.service.impl.exportbean.OrderInfoForPackageNum;
import com.yoho.ufo.service.IBusinessExportService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -25,7 +26,7 @@ import java.util.Map;
/**
* Created by li.ma on 2019/7/19.
*/
@Service
@Service(value = "ClearanceRecordService")
public class ClearanceRecordService implements IBusinessExportService {
private static final Logger LOGGER = LoggerFactory.getLogger(ClearanceRecordService.class);
... ... @@ -71,6 +72,9 @@ public class ClearanceRecordService implements IBusinessExportService {
throw new ServiceException(400, "没有要导出的数据");
}
if (request.getOrderCode() == null && StringUtils.isEmpty(request.getWaybillCode())) {
throw new ServiceException(400, "没有要导出的数据");
}
ClearanceRecord clearanceRecord = clearanceRecordMapper.selectByOrderCode(request);
if (null == clearanceRecord) {
... ...
... ... @@ -128,7 +128,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
* @return
*/
public List<StorageDeposit> selectNeddRemindDeposit() {
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, 0);
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 24 * 60 * 60, Lists.newArrayList(0, 1));
}
... ... @@ -447,7 +447,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
}
public int updateHasRemind(Integer id) {
return storageDepositMapper.updateHasRemind(id, 1);
return storageDepositMapper.updateHasRemind(id, 2);
}
public List<StorageDeposit> selectNeddDownDeposit() {
... ... @@ -505,7 +505,7 @@ public class StorageDepositServiceImpl implements IStorageDepositService{
}
public List<StorageDeposit> selectThreedDayNeedRemindDeposit() {
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, 0);
return storageDepositMapper.selectNeddRemindDeposit(DateUtil.getCurrentTimeSeconds() + 72 * 60 * 60, Lists.newArrayList(0));
}
public int updateThreedDayHasRemind(Integer id) {
... ...
... ... @@ -72,25 +72,25 @@ public class StorageDepositAutoDown implements YhJob {
storageDeposits.stream().forEach(item -> {
LOGGER.info("method StorageDepositAutoDown.process item is {}", item);
int downResult = 0;
if (item.getOrderStatus() == 1) {
boolean offResult = offShelveByErp(item);
if (offResult) { // 下架成功之后触发,变成待拣货状态
downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
}
} else { // 下架成功之后触发,变成待拣货状态
downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
//int downResult = 0;
if (item.getOrderStatus() == 1 && offShelveByErp(item)) { // 到期商品直接下架
notifyOwnerUid(item); // 修改成功之后,调用发通知
}
//if (offResult) { // 下架成功之后触发,变成待拣货状态
//downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
// 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
// }
//} else { // 下架成功之后触发,变成待拣货状态
// downResult = storageDepositService.updateStatus(item.getId(), StorageDepositStatusEnum.WAITING_QUERY.getCode(),
// 0, DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
//}
if (downResult > 0) {
notifyOwnerUid(item); // 修改成功之后,调用发通知
//if (downResult > 0) {
clearOrderInfoCache(item);
} else {
LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item);
}
//clearOrderInfoCache(item);
//} else {
// LOGGER.error("storageDepositService.updateStatus find wrong, item is {}", item);
});
result.setJobResultCode(JobResultCode.SUCCESS);
... ...
... ... @@ -27,9 +27,9 @@ import java.util.List;
* Created by li.ma on 2019/7/8.
* 扫描库存到期前24小时的到期提醒
*/
/*@Service(value="StorageDepositThreeddayRemind")
@Service(value="StorageDepositThreeddayRemind")
@YhJobDef(desc = "72小时库存寄存到期处理", jobName = "StorageDepositThreeddayRemind", cron = "0 0/10 * * * ?", misfiredPolicy = MisfiredPolicy.CRON_DO_NOTHING,
jobType = JobType.CRON, jobGroup = "ufoPlatform")*/
jobType = JobType.CRON, jobGroup = "ufoPlatform")
public class StorageDepositThreeddayRemind implements YhJob {
private static final Logger LOGGER = LoggerFactory.getLogger("scheduledLog");
... ...
package com.yoho.ufo.service.impl;
import com.yoho.order.dal.ProductSizeMapper;
import com.yoho.order.model.ProductSize;
import com.yoho.ufo.dal.UfoSizeMapper;
import com.yoho.ufo.model.commoditybasicrole.size.Size;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class SizeManage {
@Autowired
private UfoSizeMapper ufoSizeMapper;
@Autowired
private ProductSizeMapper productSizeMapper;
/**
* 插入一条尺寸数据
*
* @param size
* @return
*/
public int insertSize(Size size) {
int rows = ufoSizeMapper.insertSize(size);
if (rows > 0) {
if (productSizeMapper.insert(newProductSize(size)) == 0) {
log.warn("product size {} {} insert fail", size.getSizeId(), size.getSizeName());
}
}
return rows;
}
/**
* 更新尺寸数据
*
* @param size
* @return
*/
public int updateSize(@Param("size") Size size) {
int rows = ufoSizeMapper.updateSize(size);
if (rows > 0) {
if (productSizeMapper.updateBySizeId(newProductSize(size)) == 0) {
log.warn("product size {} {} update fail", size.getSizeId(), size.getSizeName());
}
}
return rows;
}
private ProductSize newProductSize(Size size) {
ProductSize productSize = new ProductSize();
productSize.setSizeId(size.getId());
productSize.setSizeName(size.getSizeName());
productSize.setOrderBy(size.getOrderBy());
productSize.setCreateTime(size.getCreateTime());
productSize.setUpdateTime(size.getUpdateTime());
return productSize;
}
}
... ...
... ... @@ -58,6 +58,9 @@ public class SizeServiceImpl implements ISizeService {
@Autowired
private ISizeService sizeService;
@Autowired
private SizeManage sizeManage;
@Override
public int saveOrUpdateSize(SizeRequestBo sizeRequestBo) {
LOGGER.info("saveOrUpdateSize param = {}", sizeRequestBo);
... ... @@ -76,7 +79,7 @@ public class SizeServiceImpl implements ISizeService {
size.setOrderBy(0);
}
// 新增
return ufoSizeMapper.insertSize(size);
return sizeManage.insertSize(size);
} else {
List<Size> sizes = ufoSizeMapper.selectBySizeNameEx(size.getSizeName(), size.getId());
if (CollectionUtils.isNotEmpty(sizes)) {
... ... @@ -85,7 +88,7 @@ public class SizeServiceImpl implements ISizeService {
// 更新
size.setUpdateTime(DateUtil.currentTimeSeconds());
return ufoSizeMapper.updateSize(size);
return sizeManage.updateSize(size);
}
}
... ... @@ -346,7 +349,7 @@ public class SizeServiceImpl implements ISizeService {
s.setCreateTime(time);
s.setUpdateTime(0);
LOGGER.info("切换品类尺码数据, 构建新尺码:{}", s);
ufoSizeMapper.insertSize(s);
sizeManage.insertSize(s);
LOGGER.info("切换品类尺码数据, 保存新尺码成功:{}", s);
LOGGER.info("切换品类尺码数据, 获取 {} 绑定的类别", sName);
... ...
... ... @@ -93,6 +93,7 @@
<entry key="couponServiceImpl" value-ref="couponServiceImpl"></entry>
<entry key="channelSkuCompareServiceImpl" value-ref="channelSkuCompareServiceImpl"/>
<entry key="productPoolDetailsServiceImpl" value-ref="productPoolDetailsServiceImpl"/>
<entry key="ClearanceRecordService" value-ref="ClearanceRecordService"/>
</util:map>
</beans>
\ No newline at end of file
... ...
... ... @@ -60,6 +60,7 @@ datasources:
- com.yoho.order.dal.DepositOrderMapper
- com.yoho.order.dal.DepositCodeMapper
- com.yoho.order.dal.ClearanceRecordMapper
- com.yoho.order.dal.ProductSizeMapper
ufo_resource:
servers:
... ...
... ... @@ -61,6 +61,7 @@ datasources:
- com.yoho.order.dal.DepositOrderMapper
- com.yoho.order.dal.DepositCodeMapper
- com.yoho.order.dal.ClearanceRecordMapper
- com.yoho.order.dal.ProductSizeMapper
ufo_resource:
servers:
... ...
... ... @@ -90,7 +90,7 @@
// var params = {"poolId": poolId.toString()};
var param = getParams();
window.open(contextPath + "/batch/export.do?type=ClearanceRecordService&queryConf=" + JSON.stringify(param));
window.open(contextPath + "/batch/export.do?type=ClearanceRecordService&queryConf=" + escape(JSON.stringify(param)));
}
});
... ... @@ -98,7 +98,7 @@
* 提取出搜索参数
*/
function getParams() {
var waybillCode = $("#sellerWaybillCode").val();
var waybillCode = $("#waybillCode").val();
var orderCode = $("#orderCode").val();
var param = {};
if (undefined !== orderCode && null !== orderCode && "" !== orderCode) {
... ...