Commit 7345390f by wutong

同步WMS库存新添加多个字段

parent 28f61875
...@@ -15,12 +15,25 @@ public class WmsStockItem { ...@@ -15,12 +15,25 @@ public class WmsStockItem {
private String skuTitle; private String skuTitle;
@JSONField(name = "warehouseCode") @JSONField(name = "warehouseCode")
private String warehouseCode; private String warehouseCode;
//待上架库存
@JSONField(name = "pendingStock") @JSONField(name = "pendingStock")
private Integer waitPutaway; private Integer waitPutaway;
//占用库存
@JSONField(name = "reserveStock") @JSONField(name = "reserveStock")
private Integer occupyStock; private Integer occupyStock;
//可用库存
@JSONField(name = "availabelStock") @JSONField(name = "availabelStock")
private Integer usableStock; private Integer usableStock;
//在途库存
@JSONField(name = "inboundStock")
private Integer quantityTransit;
//不可用库存
@JSONField(name = "unSellStock")
private Integer quantityFreeze;
//已发货库存
@JSONField(name = "shippedStock")
private Integer shippedStock;
@JSONField(name = "lastModificationTime") @JSONField(name = "lastModificationTime")
private LocalDateTime updateTime; private LocalDateTime updateTime;
} }
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bailuntec.domain.entity.DcBaseStock; import com.bailuntec.domain.entity.DcBaseStock;
import com.bailuntec.domain.entity.JobPointLog; import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.domain.example.DcBaseStockExample;
import com.bailuntec.domain.pojo.*; import com.bailuntec.domain.pojo.*;
import com.bailuntec.mapper.DcBaseStockMapper; import com.bailuntec.mapper.DcBaseStockMapper;
import com.bailuntec.mapper.DcBaseWarehouseMapper; import com.bailuntec.mapper.DcBaseWarehouseMapper;
...@@ -81,11 +82,12 @@ public class WmsStockJob extends PointJob { ...@@ -81,11 +82,12 @@ public class WmsStockJob extends PointJob {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("WMS库存BeanUtils.copyProperties失败"); throw new RuntimeException("WMS库存BeanUtils.copyProperties失败");
} }
mapper.upsertSelective(dcBaseStock); int i = mapper.updateByExampleSelective(dcBaseStock, DcBaseStockExample.newAndCreateCriteria().andBailunSkuEqualTo(dcBaseStock.getBailunSku()).andWarehouseCodeEqualTo(dcBaseStock.getWarehouseCode()).example());
SessionUtil.getSession().commit(); if (i == 0) {
mapper.insertSelective(dcBaseStock);
}
}); });
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("MYBATIS操作DB失败", e); throw new RuntimeException("MYBATIS操作DB失败", e);
} finally { } finally {
SessionUtil.closeSession(); SessionUtil.closeSession();
...@@ -99,7 +101,6 @@ public class WmsStockJob extends PointJob { ...@@ -99,7 +101,6 @@ public class WmsStockJob extends PointJob {
} }
jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1); jobPointLog.setPageIndex(jobPointLog.getPageIndex() + 1);
} while (jobPointLog.getPageIndex() <= totalPage); } while (jobPointLog.getPageIndex() <= totalPage);
if (jobPointLog.getPageIndex() > totalPage) jobPointLog.setPageIndex(1);
jobPointLog.setStartTime(now); jobPointLog.setStartTime(now);
jobPointLog.setEndTime(LocalDateTime.now()); jobPointLog.setEndTime(LocalDateTime.now());
} }
......
...@@ -121,6 +121,4 @@ public interface DcBaseStockMapper { ...@@ -121,6 +121,4 @@ public interface DcBaseStockMapper {
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
int upsertSelective(DcBaseStock record); int upsertSelective(DcBaseStock record);
void insertDailyStock();
} }
\ No newline at end of file
...@@ -295,6 +295,15 @@ public class DcBaseStock { ...@@ -295,6 +295,15 @@ public class DcBaseStock {
private LocalDateTime updateTime; private LocalDateTime updateTime;
/** /**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_stock.shipped_stock
*
* @mbg.generated
*/
private Integer shippedStock;
/**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock * This method corresponds to the database table dc_base_stock
* *
...@@ -338,6 +347,7 @@ public class DcBaseStock { ...@@ -338,6 +347,7 @@ public class DcBaseStock {
sb.append(", gmtModified=").append(gmtModified); sb.append(", gmtModified=").append(gmtModified);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", shippedStock=").append(shippedStock);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
...@@ -391,7 +401,8 @@ public class DcBaseStock { ...@@ -391,7 +401,8 @@ public class DcBaseStock {
&& (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate())) && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
&& (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified())) && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getShippedStock() == null ? other.getShippedStock() == null : this.getShippedStock().equals(other.getShippedStock()));
} }
/** /**
...@@ -436,6 +447,7 @@ public class DcBaseStock { ...@@ -436,6 +447,7 @@ public class DcBaseStock {
result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode()); result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getShippedStock() == null) ? 0 : getShippedStock().hashCode());
return result; return result;
} }
} }
\ No newline at end of file
...@@ -218,6 +218,36 @@ public class DcBaseStockExample { ...@@ -218,6 +218,36 @@ public class DcBaseStockExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
public DcBaseStockExample when(boolean condition, IExampleWhen then) {
if (condition) {
then.example(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public DcBaseStockExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) {
if (condition) {
then.example(this);
} else {
otherwise.example(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public void setOffset(Integer offset) { public void setOffset(Integer offset) {
this.offset = offset; this.offset = offset;
} }
...@@ -2289,6 +2319,66 @@ public class DcBaseStockExample { ...@@ -2289,6 +2319,66 @@ public class DcBaseStockExample {
addCriterion("update_time not between", value1, value2, "updateTime"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andShippedStockIsNull() {
addCriterion("shipped_stock is null");
return (Criteria) this;
}
public Criteria andShippedStockIsNotNull() {
addCriterion("shipped_stock is not null");
return (Criteria) this;
}
public Criteria andShippedStockEqualTo(Integer value) {
addCriterion("shipped_stock =", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockNotEqualTo(Integer value) {
addCriterion("shipped_stock <>", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockGreaterThan(Integer value) {
addCriterion("shipped_stock >", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockGreaterThanOrEqualTo(Integer value) {
addCriterion("shipped_stock >=", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockLessThan(Integer value) {
addCriterion("shipped_stock <", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockLessThanOrEqualTo(Integer value) {
addCriterion("shipped_stock <=", value, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockIn(List<Integer> values) {
addCriterion("shipped_stock in", values, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockNotIn(List<Integer> values) {
addCriterion("shipped_stock not in", values, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockBetween(Integer value1, Integer value2) {
addCriterion("shipped_stock between", value1, value2, "shippedStock");
return (Criteria) this;
}
public Criteria andShippedStockNotBetween(Integer value1, Integer value2) {
addCriterion("shipped_stock not between", value1, value2, "shippedStock");
return (Criteria) this;
}
} }
/** /**
...@@ -2337,6 +2427,7 @@ public class DcBaseStockExample { ...@@ -2337,6 +2427,7 @@ public class DcBaseStockExample {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
@Deprecated
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) { public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) { if (ifAdd) {
add.add(this); add.add(this);
...@@ -2345,12 +2436,43 @@ public class DcBaseStockExample { ...@@ -2345,12 +2436,43 @@ public class DcBaseStockExample {
} }
/** /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria when(boolean condition, ICriteriaWhen then) {
if (condition) {
then.criteria(this);
}
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) {
if (condition) {
then.criteria(this);
} else {
otherwise.criteria(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator. * This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_base_stock * This interface corresponds to the database table dc_base_stock
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
@Deprecated
public interface ICriteriaAdd { public interface ICriteriaAdd {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
...@@ -2454,4 +2576,40 @@ public class DcBaseStockExample { ...@@ -2454,4 +2576,40 @@ public class DcBaseStockExample {
this(condition, value, secondValue, null); this(condition, value, secondValue, null);
} }
} }
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaWhen {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void criteria(Criteria criteria);
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface IExampleWhen {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_stock
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
void example(DcBaseStockExample example);
}
} }
\ No newline at end of file
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