Commit fabecfc7 authored by hubaoshan's avatar hubaoshan

1.4

parent 5e68d829
......@@ -24,7 +24,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_name
* @default
*/
@Excel(name = "品名", orderNum = "0", width = 20)
@Excel(name = "商品名称", orderNum = "0", width = 20)
private String goodsName;
/**
......@@ -40,7 +40,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_type
* @default
*/
@Excel(name = "款式", orderNum = "2", width = 20)
@Excel(name = "款式", orderNum = "2", width = 20,replace = {"立领_50001","修身西装_50002","蕾丝披肩裙_50003"})
private String goodsStyle;
/**
......@@ -48,7 +48,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_art_number
* @default
*/
@Excel(name = "货号", orderNum = "3", width = 20)
@Excel(name = "货号", orderNum = "3", width = 20,replace = {"羊毛_20000001","晴纶_20000002","化纤_20000003"})
private String goodsArtNumber;
/**
......@@ -56,7 +56,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_season
* @default
*/
@Excel(name = "季节", orderNum = "4", width = 20)
@Excel(name = "季节", orderNum = "4", width = 20,replace = {"24春_401","24夏_402","24秋_403","24冬_404"})
private String goodsSeason;
/**
......@@ -64,7 +64,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_colour
* @default
*/
@Excel(name = "颜色", orderNum = "5", width = 20)
@Excel(name = "颜色", orderNum = "5", width = 20,replace = {"白色_61","黑色_62","灰色_63"})
private String goodsColour;
/**
......@@ -72,7 +72,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_norms
* @default
*/
@Excel(name = "规格", orderNum = "6", width = 20)
@Excel(name = "规格", orderNum = "6", width = 20,replace = {"150_701","155_702","160_703"})
private String goodsNorms;
/**
......@@ -80,7 +80,7 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_size
* @default
*/
@Excel(name = "尺码", orderNum = "7", width = 20)
@Excel(name = "尺码", orderNum = "7", width = 20,replace = {"60A_80","60B_81","60C_82"})
private String goodsSize;
/**
......@@ -88,9 +88,9 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
* @column goods_size
* @default
*/
@Excel(name = "品牌", orderNum = "8", width = 20)
@Excel(name = "品牌", orderNum = "8", width = 20,replace = {"莫兰蒂_31","雅姿_32","菲莉丝_33","卡莉娜_34"})
private String goodsBrand;
@Excel(name = "商品名称", orderNum = "9", width = 20)
@Excel(name = "品名", orderNum = "9", width = 20,replace = {"Nike_01","Adidas_02","Uniqlo_03"})
private String goodsDictName;
@TableField(exist = false)
......
......@@ -74,40 +74,34 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
wmsGoodsApply.setIoType("0");
wmsGoodsApply.setDealStatus("0");
baseMapper.insert(wmsGoodsApply);
//更新商品数量
List<WmsGoods> boxList = addwmsGoodsApply.getBoxList();
//空
List<WmsGoodsLog> logList = new ArrayList<>();
WmsGoodsLog log = null;
for (WmsGoods box : addwmsGoodsApply.getBoxList()) {
WmsGoodsStock goodsStock = wmsGoodsStockRepositoryImpl.findById(addwmsGoodsApply.getBoxList().get(0).getBusinessId());
if (goodsStock != null) {
goodsStock.setGoodsCounts(goodsStock.getGoodsCounts() + box.getInCounts());
wmsGoodsStockRepositoryImpl.updateCounts(goodsStock);
} else {
log = new WmsGoodsLog();
log.setGoodsName(box.getGoodsName());
log.setGoodsCode(box.getGoodsCode());
WmsGoodsStock goodsStock = wmsGoodsStockRepositoryImpl.findById(box.getBusinessId());
if (goodsStock == null) {
WmsGoodsStock newGoodsStock = new WmsGoodsStock();
newGoodsStock.setGoodsId(addwmsGoodsApply.getBoxList().get(0).getBusinessId());
newGoodsStock.setGoodsCounts(box.getInCounts());
wmsGoodsStockRepositoryImpl.persist(newGoodsStock);
} else {
goodsStock.setGoodsCounts(goodsStock.getGoodsCounts() + box.getInCounts());
wmsGoodsStockRepositoryImpl.updateCounts(goodsStock);
}
//日志
AddLogList addLogList = new AddLogList();
List<WmsGoodsLog> logList = new ArrayList<>();
WmsGoodsStock wmsgoodsStock = wmsGoodsStockRepositoryImpl.findById(box.getBusinessId());
WmsGoodsLog log = new WmsGoodsLog();
log.setGoodsName(box.getGoodsName());
log.setGoodsCode(box.getGoodsCode());
WmsGoodsApply wmsGoodsApplyId=new WmsGoodsApply();
wmsGoodsApplyId.setAppCode(addwmsGoodsApply.getAppCode());
List<WmsGoodsApply> wmsGoodsApplyList= baseMapper.queryWmsGoodsApplys(wmsGoodsApplyId);
log.setApplyId(wmsGoodsApplyList.get(0).getBusinessId());
log.setApplyId(wmsGoodsApply.getBusinessId());
log.setGoodsId(box.getBusinessId());
log.setGoodsCounts(box.getInCounts());
log.setIoType("0");
assert wmsgoodsStock != null;
log.setUpdateCounts(wmsgoodsStock.getGoodsCounts());
logList.add(log);
addLogList.setBoxList(logList);
wmsGoodsLogServiceImpl.batchPersist(logList);
}
wmsGoodsLogServiceImpl.batchPersist(logList);
return new CyPersistModel(1);
}
......@@ -154,7 +148,7 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
// 日志
log.setApplyId(wmsGoodsApplyOut.getBusinessId());
// todo
//log.setGoodsId(box.getBusinessId());
log.setGoodsId(box.getBusinessId());
log.setGoodsCounts(box.getOutCounts());
log.setIoType("1");
log.setUpdateCounts(goodsStock.getGoodsCounts());
......
......@@ -13,16 +13,17 @@
<result column="io_type" jdbcType="CHAR" property="ioType"/>
<result column="goods_name" jdbcType="VARCHAR" property="goodsName"/>
<result column="goods_code" jdbcType="VARCHAR" property="goodsCode"/>
<result column="goods_id" jdbcType="VARCHAR" property="goodsId"/>
<result column="apply_id" jdbcType="INTEGER" property="applyId"/>
<result column="goods_counts" jdbcType="INTEGER" property="goodsCounts"/>
<result column="update_counts" jdbcType="INTEGER" property="updateCounts"/>
</resultMap>
<insert id="batchPersist" parameterType="java.util.List">
insert into
wms_goods_log(flag,del_flag,create_by,create_date,update_by,update_date,io_type,goods_name,goods_code,apply_id,goods_counts,update_counts)
wms_goods_log(flag,del_flag,create_by,create_date,update_by,update_date,io_type,goods_name,goods_id,goods_code,apply_id,goods_counts,update_counts)
values
<foreach collection="list" item="item" separator=",">
(#{item.flag},#{item.delFlag},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.ioType},#{item.goodsName},#{item.goodsCode},#{item.applyId},#{item.goodsCounts},#{item.updateCounts})
(#{item.flag},#{item.delFlag},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.ioType},#{item.goodsName},#{item.goodsId},#{item.goodsCode},#{item.applyId},#{item.goodsCounts},#{item.updateCounts})
</foreach>
</insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
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