Merge remote-tracking branch 'origin/master'

master
wws 1 year ago
commit 7dee2effa0

@ -92,7 +92,17 @@ public interface RemoteSapService {
@PostMapping("/sap/sapPOrderGoodsReceipt")
public R sapPOrderGoodsReceipt(@RequestBody(required = false) List<Map<String, Object>> mapList);
/**101类型订单收货*/
/**
* 101
*
* * AUFNR CHAR12
* * WERKS
* * LGORT CHAR4
* * QUANTITY
* * ERFME UNIT
* * BATCH
* * HSDAT DATS8
*/
@PostMapping("/sap/sapOrderReceipt")
public R sapOrderReceipt(@RequestBody(required = false) List<Map<String, Object>> mapList);
}

@ -88,6 +88,17 @@ public class WmsProductPutController extends BaseController {
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(wmsProductPutService.deleteWmsProductPutByIds(ids));
}
/**
*
*
*/
@PostMapping("/WmsProductPutByWorkOrderConfirmSAPPosting")
public AjaxResult WmsProductPutByWorkOrderConfirmSAPPosting(@RequestBody List<WmsProductPut> wmsProductPut){
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderConfirmSAPPosting(wmsProductPut));
}
/**
*
@ -96,12 +107,5 @@ public class WmsProductPutController extends BaseController {
public AjaxResult selectWmsProductPutByWorkOrder(@PathVariable("workOrder") String workOrder){
return AjaxResult.success(wmsProductPutService.selectWmsProductPutByWorkOrder(workOrder));
}
/**
*
*/
@PostMapping("/s/WmsProductPutByWorkOrderquery")
public AjaxResult WmsProductPutByWorkOrderquery(@RequestBody WmsProductPut wmsProductPut){
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderquery(wmsProductPut));
}
}

@ -11,6 +11,7 @@ import com.op.common.log.enums.BusinessType;
import com.op.wms.domain.*;
import com.op.wms.service.IBaseWarehouseService;
import com.op.wms.service.IOdsProcureOrderService;
import com.op.wms.service.IWmsProductPutService;
import com.op.wms.service.IWmsToWCSmissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -22,7 +23,8 @@ import static com.op.common.core.web.domain.AjaxResult.success;
@RestController
@RequestMapping("/WmsToWCSmission")
public class WmsToWCSmissionController {
@Autowired
private IWmsProductPutService wmsProductPutService;
@Autowired
private IWmsToWCSmissionService iWmsToWCSmissionService;
@Autowired
@ -95,8 +97,10 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
@PostMapping("/PurchaseOrderdeliPda")
public AjaxResult PurchaseOrderdeliPda(@RequestBody OdsProcureOrder odsProcureOrder) {
int tem =odsProcureOrderService.PurchaseOrderdeliPda(odsProcureOrder);
return success(tem);
odsProcureOrderService.PurchaseOrderdeliPdas(odsProcureOrder);
return success();
// int tem =odsProcureOrderService.PurchaseOrderdeliPda(odsProcureOrder);
// return success(tem);
}
/**
@ -196,4 +200,23 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
AjaxResult result= odsProcureOrderService.sapPurchaseOrderSync(odsProcureOrder);
return result;
}
/**
*
*
*/
@PostMapping("/WmsProductPutByWorkOrderquery")
public AjaxResult WmsProductPutByWorkOrderquery(@RequestBody WmsProductPut wmsProductPut){
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderquery(wmsProductPut));
}
/**
*
*
*/
@PostMapping("/WmsProductPutByWorkOrderConfirm")
public AjaxResult WmsProductPutByWorkOrderConfirm(@RequestBody WmsProductPut wmsProductPut){
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderConfirm(wmsProductPut));
}
}

@ -1,6 +1,9 @@
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;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -9,7 +12,7 @@ import com.op.common.core.web.domain.BaseEntity;
/**
* wms_product_put
*
*
* @author Open Platform
* @date 2023-08-31
*/
@ -65,15 +68,26 @@ public class WmsProductPut extends BaseEntity {
/** 计划入库数量 */
@Excel(name = "计划入库数量")
private Long planQuantity;
private BigDecimal planQuantity;
/** 入库数量 */
@Excel(name = "入库数量")
private Long putQuantity;
private BigDecimal putQuantity;
/** 入库状态 */
@Excel(name = "入库状态")
private String status;
/** 箱数 */
@Excel(name = "箱数")
private String number;
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
/** 过账SAP状态 */
@Excel(name = "过账SAP状态")
@ -131,6 +145,24 @@ public class WmsProductPut extends BaseEntity {
/** 预留字段10 */
@Excel(name = "预留字段10")
private String attr10;
List<WmsProductPut> wmsProductPut;
private String sn;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public List<WmsProductPut> getWmsProductPut() {
return wmsProductPut;
}
public void setWmsProductPut(List<WmsProductPut> wmsProductPut) {
this.wmsProductPut = wmsProductPut;
}
public void setId(String id) {
this.id = id;
@ -216,20 +248,23 @@ public class WmsProductPut extends BaseEntity {
public String getUnitOfMeasure() {
return unitOfMeasure;
}
public void setPlanQuantity(Long planQuantity) {
this.planQuantity = planQuantity;
}
public Long getPlanQuantity() {
public BigDecimal getPlanQuantity() {
return planQuantity;
}
public void setPutQuantity(Long putQuantity) {
this.putQuantity = putQuantity;
public void setPlanQuantity(BigDecimal planQuantity) {
this.planQuantity = planQuantity;
}
public Long getPutQuantity() {
public BigDecimal getPutQuantity() {
return putQuantity;
}
public void setPutQuantity(BigDecimal putQuantity) {
this.putQuantity = putQuantity;
}
public void setStatus(String status) {
this.status = status;
}
@ -265,14 +300,14 @@ public class WmsProductPut extends BaseEntity {
public Date getPutDate() {
return putDate;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getBatchNumber() {
return batchNumber;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getProductDate() {
return productDate;

@ -64,5 +64,7 @@ public interface WmsProductPutMapper {
*/
public WmsProductPut selectWmsProductPutByWorkOrder(String workOrder);
WmsProductPut selectMesReportWork(WmsProductPut wmsProductPut);
public WmsProductPut selectMesReportWork(WmsProductPut wmsProductPut);
public WmsProductPut selectWmsProductPutSAPById(String id);
}

@ -1,20 +1,22 @@
package com.op.wms.service.impl;
import java.util.List;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.wms.domain.WmsProductPutTray;
import com.op.wms.domain.WmsProductPutTrayCode;
import com.op.wms.mapper.WmsProductPutTrayMapper;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.system.api.RemoteSapService;
import com.op.wms.domain.*;
import com.op.wms.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.WmsProductPutMapper;
import com.op.wms.domain.WmsProductPut;
import com.op.wms.service.IWmsProductPutService;
/**
@ -29,7 +31,14 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
private WmsProductPutMapper wmsProductPutMapper;
@Autowired
private RedisTemplate<String,String> redisTemplate;
@Autowired
private WmsProductPutRecordsMapper wmsProductPutRecordsMapper;
@Autowired
private WmsFpStorageNewsSnMapper wmsFpStorageNewsSnMapper;
@Autowired
private WmsFpStorageNewsMapper wmsFpStorageNewsMapper;
@Autowired
private RemoteSapService remoteSapService;
/**
*
*
@ -131,4 +140,135 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
WmsProductPut wmsProductPut1= wmsProductPutMapper.selectMesReportWork(wmsProductPut);
return wmsProductPut1;
}
/**
* wms_product_put_records
* wms_fp_storage_news_sn
* wms_fp_storage_news
* wms_product_put
*
* @param wmsProductPut
* @return
*/
@Override
public String WmsProductPutByWorkOrderConfirm(WmsProductPut wmsProductPut) {
DynamicDataSourceContextHolder.push("ds_" +wmsProductPut.getFactoryCode());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String formattedDate = dateFormat.format(date);//批次
List<WmsProductPut> wmsProductPutList= wmsProductPut.getWmsProductPut();
WmsProductPut wmsProductPutk=new WmsProductPut();
//wms_product_put
wmsProductPutk.setId(IdUtils.fastSimpleUUID());
wmsProductPutk.setWorkOrder(wmsProductPut.getWorkOrder());
wmsProductPutk.setFactoryCode(wmsProductPut.getFactoryCode());
wmsProductPutk.setWhCode(wmsProductPut.getWhCode());//仓库编码
wmsProductPutk.setProductName(wmsProductPut.getProductName());
wmsProductPutk.setProductCode(wmsProductPut.getProductCode());
wmsProductPutk.setProductOrder(wmsProductPut.getProductOrder());
wmsProductPutk.setPlanQuantity(wmsProductPut.getPlanQuantity());
wmsProductPutk.setPutQuantity(wmsProductPut.getPutQuantity());
wmsProductPutk.setStatus("1");
wmsProductPutk.setSapStatus("0");
wmsProductPutk.setBatchNumber(wmsProductPut.getBatchNumber());//
wmsProductPutk.setAttr3(formattedDate);//
wmsProductPutk.setCreateBy(wmsProductPut.getCreateBy());
wmsProductPutk.setCreateTime(new Date());
wmsProductPutk.setUnitOfMeasure(wmsProductPut.getUnitOfMeasure());
wmsProductPutMapper.insertWmsProductPut(wmsProductPutk);
String SUCCESS="操作成功";
for (WmsProductPut wmsProductPut1:
wmsProductPutList) {
WmsProductPutRecords wmsProductPutRecords=new WmsProductPutRecords();
wmsProductPutRecords.setWorkOrder(wmsProductPut.getWorkOrder());
wmsProductPutRecords.setProductOrder(wmsProductPut.getProductOrder());
wmsProductPutRecords.setProductName(wmsProductPut.getProductName());
wmsProductPutRecords.setProductCode(wmsProductPut.getProductCode());
wmsProductPutRecords.setWhCode(wmsProductPut.getWhCode());//仓库编码
wmsProductPutRecords.setId(IdUtils.fastSimpleUUID());
wmsProductPutRecords.setWlCode(wmsProductPut1.getWlCode());
wmsProductPutRecords.setSn(wmsProductPut1.getSn());
wmsProductPutRecords.setNumber(wmsProductPut1.getNumber());
wmsProductPutRecords.setCreateBy(wmsProductPut.getCreateBy());
wmsProductPutRecords.setCreateTime(new Date());
wmsProductPutRecordsMapper.insertWmsProductPutRecords(wmsProductPutRecords);
//wms_fp_storage_news_sn
WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn();
wmsFpStorageNewsSn.setStorageId(IdUtils.fastSimpleUUID());
wmsFpStorageNewsSn.setFactoryCode(wmsProductPut.getFactoryCode());
wmsFpStorageNewsSn.setWhCode(wmsProductPut.getWhCode());//仓库编码
wmsFpStorageNewsSn.setWlCode(wmsProductPut1.getWlCode());
wmsFpStorageNewsSn.setOrderNo(wmsProductPutk.getId());
wmsFpStorageNewsSn.setProductCode(wmsProductPut.getProductCode());
wmsFpStorageNewsSn.setProductName(wmsProductPut.getProductName());
wmsFpStorageNewsSn.setSn(wmsProductPut1.getSn());
wmsFpStorageNewsSn.setAmount(new BigDecimal(wmsProductPut1.getNumber()));
wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber());
wmsFpStorageNewsSn.setUserDefined2(formattedDate);
wmsFpStorageNewsSn.setCreateBy(wmsProductPut.getCreateBy());
wmsFpStorageNewsSn.setCreateTime(new Date());
wmsFpStorageNewsSn.setActiveFlag("1");
wmsFpStorageNewsSnMapper.insertWmsFpStorageNewsSn(wmsFpStorageNewsSn);
// wms_fp_storage_news
WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews();
wmsFpStorageNews.setWhCode(wmsProductPut.getWhCode());//仓库编码
wmsFpStorageNews.setWlCode(wmsProductPut1.getWlCode());
wmsFpStorageNews.setStorageType("成品");
wmsFpStorageNews.setProductCode(wmsProductPut.getProductCode());
wmsFpStorageNews.setProductName(wmsProductPut.getProductName());
wmsFpStorageNews.setFactoryCode(wmsProductPut.getFactoryCode());
wmsFpStorageNews.setActiveFlag("1");
wmsFpStorageNews.setUserDefined1(wmsProductPut.getUnitOfMeasure());
List<WmsFpStorageNews> wmsFpStorageNewsList= wmsFpStorageNewsMapper.selectWmsFpStorageNewsList(wmsFpStorageNews);
wmsFpStorageNews.setStorageId(IdUtils.fastSimpleUUID());
wmsFpStorageNews.setAmount(new BigDecimal(wmsProductPut1.getNumber()));
wmsFpStorageNews.setCreateBy(wmsProductPut.getCreateBy());
wmsFpStorageNews.setCreateTime(new Date());
if (wmsFpStorageNewsList.size()>0){
WmsFpStorageNews wmsFpStorageNews1= wmsFpStorageNewsList.get(0);
BigDecimal amount= wmsFpStorageNews1.getAmount();
BigDecimal amountAdd= amount.add(wmsFpStorageNews.getAmount());
wmsFpStorageNews1.setAmount(amountAdd);
wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews1);
}else {
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews);
}
}
return SUCCESS;
}
@Override
@DS("#header.poolName")
public String WmsProductPutByWorkOrderConfirmSAPPosting(List<WmsProductPut> wmsProductPut) {
String msgs="操作完成";
for (WmsProductPut wmsProductPut1:
wmsProductPut) {
WmsProductPut wmsProductPut2= wmsProductPutMapper.selectWmsProductPutSAPById(wmsProductPut1.getId());
List<Map<String, Object>> mapList = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
map.put("AUFNR",wmsProductPut2.getProductOrder());
map.put("WERKS",wmsProductPut2.getFactoryCode());
map.put("LGORT",wmsProductPut2.getWhCode());
map.put("QUANTITY",wmsProductPut2.getPutQuantity());
map.put("ERFME",wmsProductPut2.getUnitOfMeasure());
map.put("BATCH",wmsProductPut2.getAttr3());
map.put("HSDAT",wmsProductPut2.getProductDate());
mapList.add(map);
R result= remoteSapService.sapOrderReceipt(mapList);
int code= result.getCode();
String msg= result.getMsg();
wmsProductPut2.setSapMessage(msg);
if (code==200) {//过账成功
String date= (String) result.getData();
wmsProductPut2.setSapProof(date);
wmsProductPut2.setSapStatus("1");
}else {
wmsProductPut2.setSapStatus("2");
}
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
return msgs;
}
}

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="WmsProductPut" id="WmsProductPutResult">
<result property="id" column="id" />
<result property="workOrder" column="work_order" />
<result property="batchNumber" column="batch_number" />
<result property="factoryCode" column="factory_code" />
<result property="productOrder" column="product_order" />
<result property="whCode" column="wh_code" />
@ -152,8 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sapProof != null">#{sapProof},</if>
<if test="sapMessage != null">#{sapMessage},</if>
<if test="putDate != null">#{putDate},</if>
<if test="batchNumber != null">#{batch_number},</if>
<if test="productDate != null">#{product_date},</if>
<if test="batchNumber != null">#{batchNumber},</if>
<if test="productDate != null">#{productDate},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="attr5 != null">#{attr5},</if>
@ -220,17 +221,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectMesReportWork" resultMap="WmsProductPutResult">
SELECT
report_code work_order,
product_code,
product_name,
unit unit_of_measure,
quantity plan_quantity
mes_report_work.report_code work_order,
pro_order_workorder.order_code product_order,
mes_report_work.product_code,
mes_report_work.product_name,
mes_report_work.unit unit_of_measure,
mes_report_work.batch batch_number,
mes_report_work.quantity plan_quantity,
(mes_report_work.quantity-put.put_quantity) attr3
FROM
mes_report_work
LEFT JOIN (
SELECT SUM
( wms_product_put.put_quantity ) AS put_quantity,
wms_product_put.work_order AS work_order,
wms_product_put.product_code AS product_code FROM wms_product_put
GROUP BY
wms_product_put.work_order,
wms_product_put.product_code
) put ON put.work_order=mes_report_work.report_code AND put.product_code=mes_report_work.product_code
LEFT JOIN pro_order_workorder ON pro_order_workorder.workorder_code=mes_report_work.workorder_code
WHERE
report_code=#{workOrder}
mes_report_work.report_code=#{workOrder}
and
parent_order = '0'
mes_report_work.parent_order = '0'
</select>
<select id="selectWmsProductPutSAPById" parameterType="String" resultMap="WmsProductPutResult">
SELECT DISTINCT
wms_product_put.id,
wms_product_put.work_order,
wms_product_put.factory_code,
wms_product_put.product_order,
wms_product_put.wh_code,
wms_product_put.wa_code,
wms_product_put.wl_code,
wms_product_put.product_name,
wms_product_put.product_code,
wms_product_put.product_sort,
wms_product_put.specification,
wms_product_put.unit_of_measure,
wms_product_put.plan_quantity,
wms_product_put.put_quantity,
wms_product_put.status,
wms_product_put.SAP_status,
wms_product_put.SAP_proof,
wms_product_put.SAP_message,
wms_product_put.put_date,
wms_product_put.batch_number,
wms_product_put.attr3,
wms_product_put.attr4,
wms_product_put.attr5,
wms_product_put.attr6,
wms_product_put.attr7,
wms_product_put.attr8,
wms_product_put.attr9,
wms_product_put.attr10,
wms_product_put.create_by,
wms_product_put.create_time,
wms_product_put.update_by,
wms_product_put.update_time ,
pro_order_workorder.product_date
FROM
wms_product_put
LEFT JOIN pro_order_workorder ON pro_order_workorder.order_code=wms_product_put.product_order
WHERE wms_product_put.id = #{id}
AND wms_product_put.status= '1'
AND wms_product_put.SAP_status IN ( 0, 1 )
</select>
</mapper>

Loading…
Cancel
Save