wms部分修改3

master
mengjiao 8 months ago
parent f0f7b81534
commit ccf6e9303b

@ -37,6 +37,7 @@ public class wmsReportWork extends BaseEntity {
@Excel(name = "产品编码") @Excel(name = "产品编码")
private String productCode; private String productCode;
/** 产品名称 */ /** 产品名称 */
@Excel(name = "产品名称") @Excel(name = "产品名称")
private String productName; private String productName;
@ -53,6 +54,15 @@ public class wmsReportWork extends BaseEntity {
/** 生产工单编码 */ /** 生产工单编码 */
//已经过账的值 //已经过账的值
private String SAPquantity; private String SAPquantity;
private String selectedType;
public String getSelectedType() {
return selectedType;
}
public void setSelectedType(String selectedType) {
this.selectedType = selectedType;
}
public String getSAPquantity() { public String getSAPquantity() {
return SAPquantity; return SAPquantity;

@ -135,4 +135,11 @@ public class WmsSellOutEmbryoController extends BaseController {
return R.ok(); return R.ok();
} }
@PostMapping("addRE")
public AjaxResult addRE(@RequestBody List<WmsSellOutEmbryo> wmsSellOutEmbryoList) {
return success(wmsSellOutEmbryoService.addRE(wmsSellOutEmbryoList));
}
} }

@ -162,6 +162,16 @@ public class WmsFpStorageNewsSn extends BaseEntity {
*/ */
@Excel(name = "备用10") @Excel(name = "备用10")
private String userDefined10; private String userDefined10;
@Excel(name = "备用1")
private String userDefined1;
public String getUserDefined1() {
return userDefined1;
}
public void setUserDefined1(String userDefined1) {
this.userDefined1 = userDefined1;
}
/** /**
* *

@ -93,4 +93,6 @@ public interface WmsFpStorageNewsSnMapper {
List<WmsFpStorageNewsSn> selectWmsFpStorageNewsSnSTList(WmsFpStorageNewsSn wmsFpStorageNewsSn); List<WmsFpStorageNewsSn> selectWmsFpStorageNewsSnSTList(WmsFpStorageNewsSn wmsFpStorageNewsSn);
public void insertWmsFpStorageNewsSnRecords(WmsFpStorageNewsSn wmsFpStorageNewsSn3); public void insertWmsFpStorageNewsSnRecords(WmsFpStorageNewsSn wmsFpStorageNewsSn3);
List<WmsFpStorageNewsSn> selectwmsFpStorageNewsGroupWaCode(@Param("productCode")String productCode);
} }

@ -80,4 +80,6 @@ public interface IWmsSellOutEmbryoService {
void SynchronizationOfShippingDocuments(); void SynchronizationOfShippingDocuments();
List<WmsSellOutEmbryo> selectWmsSellOutEmbryoREList(WmsSellOutEmbryo wmsSellOutEmbryo); List<WmsSellOutEmbryo> selectWmsSellOutEmbryoREList(WmsSellOutEmbryo wmsSellOutEmbryo);
String addRE(List<WmsSellOutEmbryo> wmsSellOutEmbryoList);
} }

@ -356,6 +356,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public String addReportListSap(List<wmsReportWork> mesReportWorks) throws ParseException { public String addReportListSap(List<wmsReportWork> mesReportWorks) throws ParseException {
String selectedType= mesReportWorks.get(0).getSelectedType();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date(); Date date = new Date();
String formattedDate = dateFormat.format(date);//批次 String formattedDate = dateFormat.format(date);//批次
@ -517,6 +518,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("QUANTITY", mesReportWork.getQuantityQualified());
map.put("ERFME", mesReportWork.getUnit()); map.put("ERFME", mesReportWork.getUnit());
map.put("BATCH", mesReportWork.getBatchSK()); map.put("BATCH", mesReportWork.getBatchSK());
map.put("STCK_TYPE", selectedType);
if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){
//String batch = mesReportWork.getBatch().substring(12); //String batch = mesReportWork.getBatch().substring(12);
String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); String HSDAT = InterceptionSJRules(mesReportWork.getBatch());
@ -559,12 +561,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("QUANTITY", mesReportWork.getQuantityQualified());
map.put("ERFME", mesReportWork.getUnit()); map.put("ERFME", mesReportWork.getUnit());
map.put("BATCH", mesReportWork.getBatchSK()); map.put("BATCH", mesReportWork.getBatchSK());
// if (mesReportWork.getBatch().length()>12){ map.put("STCK_TYPE", selectedType);
// String batch = InterceptionRules(mesReportWork.getBatch());
// map.put("BATCH", batch);
// }else {
// map.put("BATCH", mesReportWork.getBatch());
// }
if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){
//String batch = mesReportWork.getBatch().substring(12); //String batch = mesReportWork.getBatch().substring(12);
String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); String HSDAT = InterceptionSJRules(mesReportWork.getBatch());

@ -15,6 +15,8 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.wms.domain.OdsProcureOrder; import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.domain.ShipmentTDO; import com.op.wms.domain.ShipmentTDO;
import com.op.wms.domain.WmsFpStorageNewsSn;
import com.op.wms.mapper.WmsFpStorageNewsSnMapper;
import okhttp3.*; import okhttp3.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -35,6 +37,8 @@ import com.op.wms.service.IWmsSellOutEmbryoService;
public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService { public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService {
@Autowired @Autowired
private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper; private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper;
@Autowired
private WmsFpStorageNewsSnMapper wmsFpStorageNewsSnMapper;
@Autowired @Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@ -161,6 +165,37 @@ public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService {
return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoREList(wmsSellOutEmbryo); return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoREList(wmsSellOutEmbryo);
} }
@Override
@DS("#header.poolName")
public String addRE(List<WmsSellOutEmbryo> wmsSellOutEmbryoList) {
String result="完成";
String stockOrder="BH";
for (WmsSellOutEmbryo wmsSellOutEmbryo:
wmsSellOutEmbryoList) {
WmsSellOutEmbryo wmsSellOutEmbryo1= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(wmsSellOutEmbryo.getId());
String productCode =wmsSellOutEmbryo1.getProductCode();
BigDecimal planQuantity = wmsSellOutEmbryo1.getPlanQuantity();
List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectwmsFpStorageNewsGroupWaCode(productCode);
if (wmsFpStorageNewsSns.size()<1){
return "无库存";
}
//区分大小planQuantity
for ( WmsFpStorageNewsSn wmsFpStorageNewsSn: wmsFpStorageNewsSns){
BigDecimal tem= wmsFpStorageNewsSn.getAmount();
if(planQuantity.compareTo(tem)<=0){
//生成一个
return result;
}else {
}
}
}
return null;
}
public List<WmsSellOutEmbryo> dayin( ) { public List<WmsSellOutEmbryo> dayin( ) {
// 定义请求的URL地址 // 定义请求的URL地址

@ -499,7 +499,7 @@
</trim> </trim>
</foreach> </foreach>
</insert> </insert>
<select id="selectWmsFpStorageNewsSnSTList"> <select id="selectWmsFpStorageNewsSnSTList" parameterType="WmsFpStorageNewsSn" resultMap="WmsFpStorageNewsSnResult">
SELECT SELECT
storage_id, storage_id,
wh_code, wh_code,
@ -510,7 +510,7 @@
product_code, product_code,
sn, sn,
bar_code, bar_code,
COALESCE(amount, 0) , COALESCE(amount, 0) amount,
batch_number, batch_number,
COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0 COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0
COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0 COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0
@ -562,4 +562,23 @@
<if test="sapFactoryCode != null and sapFactoryCode != ''">and sap_factory_code = #{sapFactoryCode}</if> <if test="sapFactoryCode != null and sapFactoryCode != ''">and sap_factory_code = #{sapFactoryCode}</if>
</where> </where>
</select> </select>
<select id="selectwmsFpStorageNewsGroupWaCode" resultMap="WmsFpStorageNewsSnResult">
SELECT
wa_code,
wh_code,
product_code,
SUM(amount) AS amount,
MIN(gmt_create) AS gmt_create -- 或者使用 MAX(gmt_create)
FROM
wms_fp_storage_news_sn
WHERE
product_code like concat('%',#{productCode} ,
'%')
AND wh_code='0021'
GROUP BY
wa_code,
wh_code,
product_code;
</select>
</mapper> </mapper>

Loading…
Cancel
Save