wms成品出库部分代码修改17

master
mengjiao 1 year ago
parent df119d3ee1
commit b87576a1eb

@ -107,7 +107,7 @@ public class WmsSellOutTrayController extends BaseController {
/**
*
* ----
*
* @param wmsSellOutTrays
* @return
@ -118,7 +118,7 @@ public class WmsSellOutTrayController extends BaseController {
String deliveryOrder = opsForValue.get("deliveryOrder");
String productCode = opsForValue.get("productCode");
WmsSellOutEmbryo wmsSellOutEmbryo = wmsSellOutEmbryoService.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode);
wmsSellOutEmbryo.setOutQuantity(number);
// wmsSellOutEmbryo.setOutQuantity(number);
wmsSellOutEmbryoService.updateWmsSellOutEmbryo(wmsSellOutEmbryo);
return toAjax(wmsSellOutTrayService.handSellOut(wmsSellOutTrays));
}

@ -1,6 +1,8 @@
package com.op.wms.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
@ -104,16 +106,16 @@ public class WmsSellOutEmbryo extends BaseEntity {
*
*/
@Excel(name = "计划出库数量")
private Long planQuantity;
private BigDecimal planQuantity;
/**
*
*/
@Excel(name = "出库数量")
private Long outQuantity;
private BigDecimal outQuantity;
/**
*
* --01
*/
@Excel(name = "出库状态")
private String status;
@ -207,6 +209,15 @@ public class WmsSellOutEmbryo extends BaseEntity {
*/
@Excel(name = "有效标记")
private String activeFlag;
private List<WmsProductPutTrayCode> wmsProductPutTrayCodeList;
public List<WmsProductPutTrayCode> getWmsProductPutTrayCodeList() {
return wmsProductPutTrayCodeList;
}
public void setWmsProductPutTrayCodeList(List<WmsProductPutTrayCode> wmsProductPutTrayCodeList) {
this.wmsProductPutTrayCodeList = wmsProductPutTrayCodeList;
}
public String getActiveFlag() {
return activeFlag;
@ -328,19 +339,19 @@ public class WmsSellOutEmbryo extends BaseEntity {
return lotNumber;
}
public void setPlanQuantity(Long planQuantity) {
public void setPlanQuantity(BigDecimal planQuantity) {
this.planQuantity = planQuantity;
}
public Long getPlanQuantity() {
public BigDecimal getPlanQuantity() {
return planQuantity;
}
public void setOutQuantity(Long outQuantity) {
public void setOutQuantity(BigDecimal outQuantity) {
this.outQuantity = outQuantity;
}
public Long getOutQuantity() {
public BigDecimal getOutQuantity() {
return outQuantity;
}

@ -73,4 +73,6 @@ public interface WmsFpStorageNewsMapper {
* @return
*/
public WmsFpStorageNews selectWmsFpStorageNewsByProductCodeAndWlCode(@Param("productCode") String productCode, @Param("wlCode") String wlCode);
void updateWmsFpStorageNewsOut(WmsFpStorageNews wmsFpStorageNews);
}

@ -76,4 +76,6 @@ public interface WmsFpStorageNewsSnMapper {
* @return
*/
public WmsFpStorageNewsSn selectWmsFpStorageNewsSnBySnAndProductCode(@Param("sn") String sn, @Param("productCode") String productCode);
void updateWmsFpStorageNewsSnOut(WmsFpStorageNewsSn wmsFpStorageNewsSn);
}

@ -88,7 +88,10 @@ public interface IWmsProductPutService {
String deletSnCorrelationBarcode(WmsProductPutTrayCode wmsProductPutTrayCode);
List<WmsSellOutEmbryo> selectFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo);
/**
* --
*
*/
String confirmFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo);
/**
* ----

@ -679,7 +679,56 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
@Override
public String confirmFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo) {
return null;
String result1="出库成功";
DynamicDataSourceContextHolder.push("ds_" + wmsSellOutEmbryo.getFactoryCode());
List<WmsProductPutTrayCode> wmsProductPutTrayCodeList= wmsSellOutEmbryo.getWmsProductPutTrayCodeList();
//成品销售出库--确认接口---修改出库单,--出库库存
WmsSellOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(wmsSellOutEmbryo.getId());
Integer tem= wmsProductPutTrayCodeList.size();
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));
int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity);
WmsSellOutEmbryo wmsSellOutEmbryoUpdate=new WmsSellOutEmbryo();
if (result == 0){//出库完
wmsSellOutEmbryoUpdate.setStatus("1");
}else {
wmsSellOutEmbryoUpdate.setStatus("0");
}
wmsSellOutEmbryoUpdate.setId(wmsSellOutEmbryo.getId());
wmsSellOutEmbryoUpdate.setOutQuantity(OutQuantity);
wmsSellOutEmbryoMapper.updateWmsSellOutEmbryo(wmsSellOutEmbryo);
//订单修改完成
for(WmsProductPutTrayCode wmsProductPutTrayCode: wmsProductPutTrayCodeList){//库存修改
//解除绑定
wmsProductPutTrayCode.setRelatStatus("0");
wmsProductPutTrayCodeMapper.updateWmsProductPutTrayCode(wmsProductPutTrayCode);
//改明细
WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn();
wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn());
wmsFpStorageNewsSn.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNewsSn.setActiveFlag("1");
wmsFpStorageNewsSn.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSnOut(wmsFpStorageNewsSn);
//判断如果托盘数据被出完,就关闭这个明细
List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
if (wmsFpStorageNewsSns.size()>0){
WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSns.get(0);
BigDecimal ken= new BigDecimal(wmsFpStorageNewsSn1.getUserDefined2());
int comparisonResult = ken.compareTo(wmsFpStorageNewsSn1.getAmount());
if (comparisonResult == 0) {
// ken和amount相等
wmsFpStorageNewsSn1.setActiveFlag("0");
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn1);
}
}
//改主表
WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews();
wmsFpStorageNews.setActiveFlag("1");
wmsFpStorageNews.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNews.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsMapper.updateWmsFpStorageNewsOut(wmsFpStorageNews);
}
return result1;
}
@Override

@ -290,4 +290,9 @@
#{storageId}
</foreach>
</delete>
<update id="updateWmsFpStorageNewsOut">
update wms_fp_storage_news
set amount = COALESCE(amount, 0) - 1
where product_code = #{productCode} and wl_code = #{wlCode} and active_flag='1'
</update>
</mapper>

@ -248,4 +248,9 @@
#{storageId}
</foreach>
</delete>
<update id="updateWmsFpStorageNewsSnOut">
update wms_fp_storage_news_sn
set user_defined2 = COALESCE(user_defined2, 0) + 1
where sn=#{sn} and active_flag='1'
</update>
</mapper>

Loading…
Cancel
Save