成品wcs部分代码修改

master
mengjiao 8 months ago
parent 5ebb81a661
commit e1015bcc9e

@ -591,5 +591,87 @@ public class WmsToWCSmissionController {
/**
* RGV RFID WMS
* RFID
* @param wcsdto
* @return
*/
@PostMapping("/finishedProductRequestInbound")
public WmsToWCSODTO finishedProductRequestInbound(@RequestBody WmsToWCSDTO wcsdto) {
if (StringUtils.isBlank(wcsdto.getFactory())) {
WmsToWCSODTO wmsToWCSODTO = new WmsToWCSODTO();
wmsToWCSODTO.setCode("1");
wmsToWCSODTO.setMessage("factory is not null");
return wmsToWCSODTO;
}
return iWmsToWCSmissionService.finishedProductRequestInbound(wcsdto);
}
/**
*
*WCS WMS WMS
* WmsProductPutByWorkOrderConfirm
* @param wcsdto
* @return
*/
@PostMapping("/finishedProductInboundCompleted")
public WmsToWCSDTO finishedProductInboundCompleted(@RequestBody WmsToWCSDTO wcsdto) {
if (StringUtils.isBlank(wcsdto.getFactory())) {
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return iWmsToWCSmissionService.finishedProductInboundCompleted(wcsdto);
}
/**
*
*WCS WMS
* @param wcsdto
* @return
*/
@PostMapping("/finishedProductOutBoundCompleted")
public WmsToWCSDTO finishedProductOutBoundCompleted(@RequestBody WmsToWCSDTO wcsdto) {
if (StringUtils.isBlank(wcsdto.getFactory())) {
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return iWmsToWCSmissionService.finishedProductOutBoundCompleted(wcsdto);
}
/**
*
* WMS
*
* @param wcsdto
* @return
*/
@PostMapping("/finishedProductOutBoundScanReply")
public WmsToWCSDTO finishedProductOutBoundScanReply(@RequestBody WmsToWCSDTO wcsdto) {
if (StringUtils.isBlank(wcsdto.getFactory())) {
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return iWmsToWCSmissionService.finishedProductOutBoundScanReply(wcsdto);
}
/**
*
* PDA
* PDA
* @param wcsdto
* @return
*/
@PostMapping("/liftTakeOrPutCompleted")
public WmsToWCSDTO liftTakeOrPutCompleted(@RequestBody WmsToWCSDTO wcsdto) {
if (StringUtils.isBlank(wcsdto.getFactory())) {
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return iWmsToWCSmissionService.liftTakeOrPutCompleted(wcsdto);
}
}

@ -10,10 +10,28 @@ import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WmsToWCSDTO extends BaseEntity {
private String wlcode;//请求ID
public String getWlcode() {
return wlcode;
}
public void setWlcode(String wlcode) {
this.wlcode = wlcode;
}
private String reqCode;//请求ID
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reqTime;//请求时间
private List<String> items;
public List<String> getItems() {
return items;
}
public void setItems(List<String> items) {
this.items = items;
}
private String planNo;
private List<OrderLine> orderLines;

@ -61,4 +61,8 @@ public interface WmsRawOrderInMapper {
public int deleteWmsRawOrderInByRawOrderInIds(String[] rawOrderInIds);
WmsToWCSDTO packagingStorage(WmsToWCSDTO wcsdto);
WmsToWCSDTO finishedProductRequestInbound(WmsToWCSDTO wcsdto);
List<String> finishedProductRequestInboundsn(WmsToWCSDTO wcsdto);
}

@ -83,4 +83,6 @@ public interface WmsSellOutEmbryoMapper {
WmsAllocationOutEmbryo selectWmsAllocationOutEmbryoById(String id);
void updateWmsAllocationOutEmbryo(WmsAllocationOutEmbryo wmsAllocationOutEmbryo);
void updateWmsSellOutEmbryotwo(WmsSellOutEmbryo wmsSellOutEmbryoUpdate);
}

@ -9,4 +9,14 @@ public interface IWmsToWCSmissionService {
WmsToWCSDTO packingMaterialsInboundCompleted(WmsToWCSDTO wcsdto);
WmsToWCSDTO packingMaterialsOutBoundCompleted(WmsToWCSDTO wcsdto);
WmsToWCSODTO finishedProductRequestInbound(WmsToWCSDTO wcsdto);
WmsToWCSDTO finishedProductInboundCompleted(WmsToWCSDTO wcsdto);
WmsToWCSDTO finishedProductOutBoundCompleted(WmsToWCSDTO wcsdto);
WmsToWCSDTO finishedProductOutBoundScanReply(WmsToWCSDTO wcsdto);
WmsToWCSDTO liftTakeOrPutCompleted(WmsToWCSDTO wcsdto);
}

@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Service
public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
@ -22,12 +23,19 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
@Autowired
private WmsRawOrderInSnMapper wmsRawOrderInSnMapper;
@Autowired
private WmsFpStorageNewsSnMapper wmsFpStorageNewsSnMapper;
@Autowired
private WmsFpStorageNewsMapper wmsFpStorageNewsMapper;
@Autowired
private WmsOdsMateStorageNewsSnMapper wmsOdsMateStorageNewsSnMapper;
@Autowired
private WmsOdsEmStorageNewsMapper wmsOdsEmStorageNewsMapper;
@Autowired
private WmsOdsMateStorageNewsMapper wmsOdsMateStorageNewsMapper;
@Autowired
private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper;
@Autowired
private WmsProductPutTrayCodeMapper wmsProductPutTrayCodeMapper;
@Override
public WmsToWCSODTO packagingStorage(WmsToWCSDTO wcsdto) {
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
@ -153,5 +161,175 @@ public class WmsToWCSmissionServiceImpl implements IWmsToWCSmissionService {
return wcsdto;
}
@Override
public WmsToWCSODTO finishedProductRequestInbound(WmsToWCSDTO wcsdto) {
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
//其中wcsdto的rfidNo属性先传托盘号原因---还没有自动码垛
WmsToWCSDTO wmsToWCSDTO = wmsRawOrderInMapper.finishedProductRequestInbound(wcsdto);
List<String> items=wmsRawOrderInMapper.finishedProductRequestInboundsn(wcsdto);
// wmsToWCSDTO.set//
if (wmsToWCSDTO == null) {
WmsToWCSODTO wms = new WmsToWCSODTO();
wms.setCode("0");
wms.setReqCode(wcsdto.getReqCode());
wms.setMessage("OK");
return wms;
}
wmsToWCSDTO.setQualityStatus("1");
wmsToWCSDTO.setItems(items);
wmsToWCSDTO.setCode("0");
wmsToWCSDTO.setReqCode(wcsdto.getReqCode());
wmsToWCSDTO.setMessage("OK");
WmsToWCSODTO wmsToWCSODTO = new WmsToWCSODTO();
wmsToWCSODTO.setCode("0");
// 创建Gson对象
Gson gson = new GsonBuilder().setPrettyPrinting().create();
// 将对象转换为JSON格式的字符串并格式化输出
String MESSAGE = gson.toJson(wmsToWCSDTO);
wmsToWCSODTO.setMessage(MESSAGE);
return wmsToWCSODTO;
}
@Override
public WmsToWCSDTO finishedProductInboundCompleted(WmsToWCSDTO wmsToWCSDTO) {
DynamicDataSourceContextHolder.push("ds_" + wmsToWCSDTO.getFactory());
// //wms_raw_order_in_sn
// WmsRawOrderInSn wmsRawOrderInSn = wmsRawOrderInSnMapper.selectwmsRfidNo(wmsToWCSDTO);
// wmsRawOrderInSn.setWhCode(wmsToWCSDTO.getWarehouseNo());
// wmsRawOrderInSn.setWlCode(wmsToWCSDTO.getLocation());
// WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = new WmsOdsMateStorageNewsSn();
// wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
// wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码
// wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
// wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
// wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn());
// wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount());
// wmsOdsMateStorageNewsSn.setCreateBy("AGV");
// wmsOdsMateStorageNewsSn.setActiveFlag("1");
// wmsOdsMateStorageNewsSn.setGmtCreate(new Date());
// wmsOdsMateStorageNewsSn.setMateOrderInSnId(IdUtils.fastSimpleUUID());
// wmsOdsMateStorageNewsSn.setFactoryCode(wmsToWCSDTO.getFactory());
// wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsToWCSDTO.getFactory());
// //wms_ods_mate_storage_news_sn
// wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);
// //修改库存
// //修改库存加库存数量storage_amount = IFNULL(storage_amount, 0) + #{amount},
// WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews();
// wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
// wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码
// wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
// wmsOdsEmStorageNews.setAmount(wmsRawOrderInSn.getAmount());
//
// //添加库存--这个要有个判断有没有这个库存如果没有的话,就插入
// WmsOdsMateStorageNews wmsOdsMateStorageNews = wmsOdsMateStorageNewsMapper.selectByWhCodeAndMate(wmsOdsEmStorageNews);
// if (wmsOdsMateStorageNews == null) {
// WmsOdsMateStorageNews wmsOdsMateStorageNews1 = new WmsOdsMateStorageNews();
// wmsOdsMateStorageNews1.setStorageId(IdUtils.fastSimpleUUID());
// wmsOdsMateStorageNews1.setWhCode(wmsRawOrderInSn.getWhCode());
// wmsOdsMateStorageNews1.setWlCode(wmsRawOrderInSn.getWlCode());
// wmsOdsMateStorageNews1.setAmount(wmsRawOrderInSn.getAmount());
// // wmsOdsMateStorageNews1.setStorageAmount(wmsRawOrderInSn.getAmount());
// wmsOdsMateStorageNews1.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
// wmsOdsMateStorageNews1.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
// wmsOdsMateStorageNews1.setStorageType("BC");
// wmsOdsMateStorageNews1.setCreateBy("wcs");
// wmsOdsMateStorageNews1.setGmtCreate(new Date());
// wmsOdsMateStorageNews1.setActiveFlag("1");
// wmsOdsMateStorageNews1.setFactoryCode(wmsToWCSDTO.getFactory());
// wmsOdsMateStorageNews1.setSapFactoryCode(wmsToWCSDTO.getFactory());
// wmsOdsMateStorageNews1.setUserDefined1(wmsRawOrderInSn.getUserDefined4());//单位
// wmsOdsMateStorageNewsMapper.insertWmsOdsMateStorageNews(wmsOdsMateStorageNews1);
// } else {
// wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews);
// }
// //修改托盘记录为入库
// wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn);
//在入库手持那里已经入了他没有用rfid而是托盘但是成品手持下线入库在下下线入库那里已经入了除非后续用自动码垛不用手持的下线入库
wmsToWCSDTO.setCode("0");
wmsToWCSDTO.setMessage("OK");
return wmsToWCSDTO;
}
@Override
public WmsToWCSDTO finishedProductOutBoundCompleted(WmsToWCSDTO wcsdto) {
//记录明细消减库存--wms_raw_mission_out-
DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory());
WmsSellOutEmbryo wmsSellOutEmbryo=new WmsSellOutEmbryo();
wmsSellOutEmbryo.setDeliveryOrder(wcsdto.getOrderNo());//查询对应的销售订单
List<WmsSellOutEmbryo> wmsSellOutEmbryos = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoList(wmsSellOutEmbryo);
WmsSellOutEmbryo wmsSellOutEmbryo1=wmsSellOutEmbryos.get(0);
WmsToWCSDTO wmsToWCSDTO = wmsRawOrderInMapper.finishedProductRequestInbound(wcsdto);//根据托盘查询明细
//修改销售订单
String tem= wmsToWCSDTO.getQty();
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));//2
int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity);
WmsSellOutEmbryo wmsSellOutEmbryoUpdate=new WmsSellOutEmbryo();
if (result == 0){//出库完
wmsSellOutEmbryoUpdate.setStatus("1");
}else {
wmsSellOutEmbryoUpdate.setStatus("0");
}
wmsSellOutEmbryoUpdate.setDeliveryOrder(wcsdto.getOrderNo());
wmsSellOutEmbryoUpdate.setOutQuantity(OutQuantity);
wmsSellOutEmbryoMapper.updateWmsSellOutEmbryotwo(wmsSellOutEmbryoUpdate);
//订单修改完成
//
WmsProductPutTrayCode wmsProductPutTrayCode=new WmsProductPutTrayCode();
//解除绑定
wmsProductPutTrayCode.setSn(wcsdto.getRfidNo());//托盘号
wmsProductPutTrayCode.setWlCode(wmsToWCSDTO.getWlcode());//库位
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);
wcsdto.setCode("0");
wcsdto.setMessage("OK");
return wcsdto;
}
@Override
public WmsToWCSDTO finishedProductOutBoundScanReply(WmsToWCSDTO wcsdto) {
wcsdto.setCode("0");
wcsdto.setMessage("OK");
return wcsdto;
}
@Override
public WmsToWCSDTO liftTakeOrPutCompleted(WmsToWCSDTO wcsdto) {
wcsdto.setCode("0");
wcsdto.setMessage("OK");
return wcsdto;
}
}

@ -323,4 +323,30 @@
sn=#{rfidNo}
and user_defined1 = '1'
</select>
<select id="finishedProductRequestInbound" resultType="com.op.wms.domain.WmsToWCSDTO">
SELECT
product_code as sku,
sn as rfidNo,
wl_code wlcode,
amount as qty
FROM
wms_fp_storage_news_sn
where
sn=#{rfidNo}
and active_flag = '1'
</select>
<select id="finishedProductRequestInboundsn" resultType="java.lang.String" >
SELECT
barcode as sn
FROM
wms_product_put_tray_code
where
sn=#{rfidNo}
and relat_status = '1'
</select>
</mapper>

@ -270,7 +270,46 @@
</trim>
where id = #{id}
</update>
<update id="updateWmsSellOutEmbryotwo" parameterType="WmsSellOutEmbryo">
update wms_sell_out_embryo
<trim prefix="SET" suffixOverrides=",">
<if test="itemNumber != null">Item_number = #{itemNumber},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="whCode != null">wh_code = #{whCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="deliveryPlace != null">delivery_place = #{deliveryPlace},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSort != null">product_sort = #{productSort},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="lotNumber != null">lot_number = #{lotNumber},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="status != null">status = #{status},</if>
<if test="sapStatus != null">SAP_status = #{sapStatus},</if>
<if test="sapProof != null">SAP_proof = #{sapProof},</if>
<if test="sapMessage != null">SAP_message = #{sapMessage},</if>
<if test="outDate != null">out_date = #{outDate},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="attr5 != null">attr5 = #{attr5},</if>
<if test="attr6 != null">attr6 = #{attr6},</if>
<if test="attr7 != null">attr7 = #{attr7},</if>
<if test="attr8 != null">attr8 = #{attr8},</if>
<if test="attr9 != null">attr9 = #{attr9},</if>
<if test="attr10 != null">attr10 = #{attr10},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where delivery_order = #{deliveryOrder}
</update>
<delete id="deleteWmsSellOutEmbryoById" parameterType="String">
delete from wms_sell_out_embryo where id = #{id}
</delete>

Loading…
Cancel
Save