Merge remote-tracking branch 'origin/master'

master
shaoyong 5 months ago
commit 5c4341e677

@ -125,4 +125,9 @@ public interface RemoteSapService {
@PostMapping("/sap/removeDatasource")
public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty);
}
/**
*
*/
@PostMapping("/sap/temporarilyCollected")
public R temporarilyCollected(@RequestBody(required = false) List<Map> mapList) ;
}

@ -138,6 +138,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("sap数据源删除失败" + throwable.getMessage());
}
@Override
public R temporarilyCollected(List<Map> mapList) {
return R.fail("来料暂收过账失败" + throwable.getMessage());
}
};
}
}

@ -93,6 +93,7 @@ public class MesReportWorkConsume extends BaseEntity {
@Excel(name = "报工编码")
private String reportCode;
private BigDecimal quantityFeedback;
//虚拟字段
private String id;
private String parentOrder;
@ -117,6 +118,14 @@ public class MesReportWorkConsume extends BaseEntity {
private String erfmg;
private String erfme;
public BigDecimal getQuantityFeedback() {
return quantityFeedback;
}
public void setQuantityFeedback(BigDecimal quantityFeedback) {
this.quantityFeedback = quantityFeedback;
}
public String getErfmg() {
return erfmg;
}

@ -138,8 +138,10 @@ public class MesUnitpriceReport extends BaseEntity {
// @Excel(name = "平均工资")
// private String avgResult;
@Excel(name = "工时工资")
@Excel(name = "时薪")
private String realWages;
@Excel(name = "备注", readConverterExp = "1=请假")
private String remark;
/**
*
@ -152,7 +154,6 @@ public class MesUnitpriceReport extends BaseEntity {
* $column.columnComment
*/
public BigDecimal getKk() {
return kk;
}

@ -1,5 +1,6 @@
package com.op.mes.mapper;
import java.math.BigDecimal;
import java.util.List;
import com.op.mes.domain.MesReportWorkConsume;
@ -85,4 +86,6 @@ public interface MesReportWorkConsumeMapper {
List<MesReportWorkConsume> getSumConsumeList(MesReportWorkConsume consumeqo);
int getSumConsumeListNum(MesReportWorkConsume consumeqo);
BigDecimal getActAllProduct(MesReportWorkConsume mesReportWorkConsume);
}

@ -358,6 +358,12 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer
pTabs.setTitle("第"+i+"层工单物料损耗");
mesReportWorkConsume.setParentOrder("0");
List<MesReportWorkConsume> liblist0 = mesReportWorkConsumeMapper.getConsumeList(mesReportWorkConsume);
if(!CollectionUtils.isEmpty(liblist0)){
BigDecimal actPro = mesReportWorkConsumeMapper.getActAllProduct(mesReportWorkConsume);
liblist0.get(0).setQuantityFeedback(actPro);
}
pTabs.setLibList(liblist0);
tabs.add(pTabs);

@ -82,7 +82,7 @@
from pro_order_workorder ow
left join mes_prepare mp on ow.workorder_code = mp.workorder_code
left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id
where ow.belong_work_order = #{workorderCode}
where ow.belong_work_order = #{workorderCode} and ow.del_flag = '0'
and mpd.recoil = #{recoil} and mp.del_flag = '0' and mpd.del_flag = '0'
order by mpd.recoil
</select>

@ -202,6 +202,9 @@
and mrw.machine_code = #{machineCode}
)t
</select>
<select id="getActAllProduct" resultType="java.math.BigDecimal">
select sum(quantity_feedback) from mes_report_work where workorder_code = #{workorderCode} and del_flag = '0'
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">
insert into mes_report_work_consume

@ -702,6 +702,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productDateEnd != null and productDateEnd != ''">
and CONVERT(varchar(10), #{productDateEnd}, 23) >= CONVERT(varchar(10),pow.product_date, 23)
</if>
<if test="productCode != null and productCode != ''">and pow.product_code like concat('%', #{productCode}, '%')</if>
order by be.equipment_code
</select>

@ -977,7 +977,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
private void setOaFunc(QcCheckUnqualified unqualified,QcCheckTaskIncome qcCheckTaskIncome){
//不合格描述
unqualified.setRemark(qcCheckTaskIncome.getRemark());
if("produce".equals(qcCheckTaskIncome.getTypeCode())){
if("produce".equals(qcCheckTaskIncome.getTypeCode())||"product".equals(qcCheckTaskIncome.getTypeCode())){
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
unqualified.setUser(qcCheckTaskIncome.getPgzg());//qcCheckTaskIncome.getUpdateBy();

@ -100,13 +100,14 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
if("material".equals(taskIfo.getTypeCode())) {
//ZL0010-来料检验不合格控制流程
oaR = this.createLLOA(taskIfo);
}else if("produce".equals(taskIfo.getTypeCode())){
}else if("produce".equals(taskIfo.getTypeCode())||"product".equals(taskIfo.getTypeCode())){
//ZL0030-品质异常流程
oaR = this.createProduceOA(taskIfo);
}else if("product".equals(taskIfo.getTypeCode())) {
//ZL0020-成品检验控制流程
oaR = this.createProductOA(taskIfo);
}
// else if("product".equals(taskIfo.getTypeCode())) {
// //ZL0020-成品检验控制流程
// oaR = this.createProductOA(taskIfo);
// }
if(oaR!=null ){
if((oaR.get("code").toString()).equals("200")){
/**qc_check_unqualified**/
@ -358,8 +359,10 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
mainObject.append(",\"Notes\":"+"\"\"");//测试备注
mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660朱继新
if("0".equals(task.getSfxyzg())){
mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660朱继新
}
mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append("}");

@ -319,7 +319,7 @@
from base_product bp
left join qc_material_group qmg on qmg.group_code = bp.mvgr5
where bp.product_code like concat('%',#{materialCode},'%')
and bp.del_flag = '0'
and bp.del_flag = '0' and qmg.del_flag = '0'
order by qmg.create_time desc
</select>
<select id="selectExist" resultType="com.op.quality.domain.QcMaterialGroupDetail">

@ -320,6 +320,8 @@ public class OdsProcureOrderController extends BaseController {
odsProcureOrderService.OutboundPostingSAPfc(orderList);
return success();
}
@PostMapping("/listCKT")
public AjaxResult listCKT(BaseWarehouse baseWarehouse) {

@ -6,6 +6,7 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.system.api.RemoteOpenService;
import com.op.wms.domain.*;
import com.op.wms.service.*;
@ -33,6 +34,8 @@ public class WmsToWCSmissionController {
private IOdsWhiteEmbryoService iOdsWhiteEmbryoService;
@Autowired
private IOdsProductEmbryoInventoryService odsProductEmbryoInventoryService;
@Autowired
private IBaseAreaService baseAreaService;
/**
@ -297,7 +300,14 @@ public class WmsToWCSmissionController {
public AjaxResult WmsProductPutByWorkOrderquery(@RequestBody WmsProductPut wmsProductPut) {
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderquery(wmsProductPut));
}
/**
*
* ---
*/
@PostMapping("/WmsProductPutByWorkOrderqueryBS")
public AjaxResult WmsProductPutByWorkOrderqueryBS(@RequestBody WmsProductPut wmsProductPut) {
return AjaxResult.success(wmsProductPutService.WmsProductPutByWorkOrderqueryBS(wmsProductPut));
}
/**
*
*
@ -723,6 +733,13 @@ public class WmsToWCSmissionController {
return iWmsToWCSmissionService.liftTakeOrPutCompleted(wcsdto);
}
/**
*
*/
@PostMapping("/listTableDataInfo")
public AjaxResult list(@RequestBody BaseArea baseArea) {
List<BaseArea> list = baseAreaService.selectBaseAreaListSC(baseArea);
return success(list);
}
}

@ -77,6 +77,17 @@ public class OdsProcureOrder extends BaseEntity {
@Excel(name = "仓库编码")
private String whCode;
@Excel(name = "仓库编码")
private String waCode;
public String getWaCode() {
return waCode;
}
public void setWaCode(String waCode) {
this.waCode = waCode;
}
public String getWhCode() {
return whCode;
}
@ -337,6 +348,42 @@ public class OdsProcureOrder extends BaseEntity {
*/
@Excel(name = "企业编码")
private String enterpriseCode;
private String SapTempInfor;
private String SapTempStatus;
private String SAPstatus;
private String SAPmessage;
public String getSapTempInfor() {
return SapTempInfor;
}
public void setSapTempInfor(String sapTempInfor) {
SapTempInfor = sapTempInfor;
}
public String getSapTempStatus() {
return SapTempStatus;
}
public void setSapTempStatus(String sapTempStatus) {
SapTempStatus = sapTempStatus;
}
public String getSAPstatus() {
return SAPstatus;
}
public void setSAPstatus(String SAPstatus) {
this.SAPstatus = SAPstatus;
}
public String getSAPmessage() {
return SAPmessage;
}
public void setSAPmessage(String SAPmessage) {
this.SAPmessage = SAPmessage;
}
public void setSiteCode(String siteCode) {
this.siteCode = siteCode;

@ -217,6 +217,43 @@ public class WmsProductPut extends BaseEntity {
List<WmsProductPut> wmsProductPut;
private String sn;
private String pallet;//标识卡
public String getPallet() {
return pallet;
}
private String attribute1 ;
private String attribute2;
private String attribute3;
public String getAttribute1() {
return attribute1;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public void setPallet(String pallet) {
this.pallet = pallet;
}
public String getSn() {
return sn;
}

@ -77,6 +77,7 @@ public interface WmsProductPutMapper {
void updateWmsProductPutByIds(@Param("wmsProductPut") WmsProductPut wmsProductPut4, @Param("list") List<WmsProductPut> wmsProductPut2);
WmsProductPut WmsProductPutByWorkOrderqueryBS(WmsProductPut wmsProductPut);
// String selectWmsProductPutNum(wmsReportWork wmsReportWork);

@ -67,4 +67,6 @@ public interface WmsRawOrderInSnMapper {
List<WmsRawOrderInSn> selecPurchaseOrderdeliPdaList(OdsProcureOrder odsProcureOrder);
void insertWmsLogotypeTable(WmsLogotypeTable wmsLogotypeTable);
WmsRawOrderInSn selecPurchaseOrderdeliPdaById(OdsProcureOrder odsProcureOrder);
}

@ -62,4 +62,6 @@ public interface IBaseAreaService {
boolean checkAreaCodeUnique(BaseArea baseArea);
boolean checkAreaDescUnique(BaseArea baseArea);
List<BaseArea> selectBaseAreaListSC(BaseArea baseArea);
}

@ -138,4 +138,6 @@ public interface IWmsProductPutService {
Integer finishedProductProductionRecords(ProOrderWorkorder proOrderWorkorder);
List<WmsProductProductionRecords> selectProductProductionRecords(WmsProductProductionRecords wmsProductProductionRecords);
WmsProductPut WmsProductPutByWorkOrderqueryBS(WmsProductPut wmsProductPut);
}

@ -3,6 +3,7 @@ package com.op.wms.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -133,4 +134,10 @@ public class BaseAreaServiceImpl implements IBaseAreaService {
}
}
@Override
public List<BaseArea> selectBaseAreaListSC(BaseArea baseArea) {
DynamicDataSourceContextHolder.push("ds_" + baseArea.getFactoryCode());
return baseAreaMapper.selectBaseAreaList(baseArea);
}
}

@ -164,9 +164,11 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
//wms_raw_order_in_sn
WmsRawOrderInSn wmsRawOrderInSn = new WmsRawOrderInSn();
wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID());
wmsRawOrderInSn.setUserDefined1("1");//
wmsRawOrderInSn.setUserDefined1("1");//1是收货,2是入库
wmsRawOrderInSn.setUserDefined2(odsProcureOrder.getIncomeBatchNo());//批次
wmsRawOrderInSn.setWhCode(odsProcureOrder.getWhCode());//厂库编号
wmsRawOrderInSn.setWaCode(odsProcureOrder.getWaCode());
wmsRawOrderInSn.setWlCode("00001-1-01");//先都设置为同一个库位
wmsRawOrderInSn.setPoNo(order.getProcureCode());//采购单号
wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目
wmsRawOrderInSn.setMaterialCode(odsProcureOrder.getMaterialCode());
@ -203,24 +205,6 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
}
Integer tem = odsProcureOrderMapper.updateRealityNuById(odsProcureOrder);
//插入检验集计划
// QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO();
// qcCheckTaskIncomeDTO.setCheckLoc("mjtest");
// qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
//// qcCheckTaskIncomeDTO.setCheckManCode("mobile");
//// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户");
// qcCheckTaskIncomeDTO.setSupplierCode(order.getSupplierCode());
// String name = odsProcureOrderMapper.selectBaseSupplier(odsProcureOrder);
// qcCheckTaskIncomeDTO.setSupplierName(name);
// qcCheckTaskIncomeDTO.setOrderType("bc");
// qcCheckTaskIncomeDTO.setUnit(order.getUnit());
// qcCheckTaskIncomeDTO.setFactoryCode(odsProcureOrder.getFactoryCode());
// qcCheckTaskIncomeDTO.setQuality(odsProcureOrder.getPlanNumber());
// qcCheckTaskIncomeDTO.setMaterialCode(odsProcureOrder.getMaterialCode());
// qcCheckTaskIncomeDTO.setMaterialName(odsProcureOrder.getSupplierName());
// qcCheckTaskIncomeDTO.setIncomeBatchNo(odsProcureOrder.getIncomeBatchNo());
// qcCheckTaskIncomeDTO.setOrderNo(order.getProcureCode());
// qcCheckTaskIncomeDTO.setIncomeTime(new Date());
// remoteQualityService.createIncomeTask(qcCheckTaskIncomeDTO);
return tem;
}
@ -739,9 +723,104 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public String PurchaseOrderdeliPdaConfirm(OdsProcureOrder odsProcureOrder) {
DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode());
String result="操作成功";
List<WmsRawOrderInSn> wmsRawOrderInSn = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
String formattedDate = dateFormat.format(date);
WmsRawOrderInSn wmsRawOrderInSn1=new WmsRawOrderInSn();
OdsProcureOrder order = odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID());
List<WmsRawOrderInSn> wmsRawOrderInSns = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder);
WmsRawOrderInSn wmsRawOrderInSnTEM = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaById(odsProcureOrder);
if(wmsRawOrderInSns.size()>0){
}else {
result="托盘都已经入库";
return result;
}
//先sap暂收成功后我们这边也进行收货
BigDecimal amount= wmsRawOrderInSnTEM.getAmount();//要入库的数量
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
/**
* ZMES_103_MIGOMIGO-103
*
* EBELN CHAR 10 0
* EBELP NUMC 5 0
* MATNR CHAR 18 0
* WERKS CHAR 4 0
* QUANTITY QUAN 13 3
* @param mapList
* @return
*/
paramMap.put("EBELN",order.getProcureCode());
paramMap.put("EBELP",order.getUserDefined3());
paramMap.put("MATNR",order.getMaterialCode());
paramMap.put("WERKS",order.getSiteCode());
paramMap.put("QUANTITY",amount.toString());
mapList.add(paramMap);
R result2 = remoteSapService.temporarilyCollected(mapList);
int code = result2.getCode();
if (code == 200){//成功
order.setSapTempStatus("1");//0是失败。1是成功
order.setSapTempInfor(result2.getMsg());
odsProcureOrderMapper.updateOdsProcureOrder(order);
for (WmsRawOrderInSn wmsRawOrderInSn:wmsRawOrderInSns){
//收货
WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = new WmsOdsMateStorageNewsSn();
wmsOdsMateStorageNewsSn.setMateOrderInSnId(IdUtils.fastSimpleUUID());
wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
wmsOdsMateStorageNewsSn.setWaCode(wmsRawOrderInSn.getWaCode());
wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码--现在都设置为00001-1-01
wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn());
wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount());
wmsOdsMateStorageNewsSn.setCreateBy(odsProcureOrder.getCreateBy());
wmsOdsMateStorageNewsSn.setGmtCreate(new Date());
wmsOdsMateStorageNewsSn.setUserDefined2(formattedDate);//批次
wmsOdsMateStorageNewsSn.setFactoryCode(wmsRawOrderInSn.getFactoryCode());
wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsRawOrderInSn.getFactoryCode());
wmsOdsMateStorageNewsSn.setActiveFlag("1");
wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn);
//修改库存
//2,修改库存---/加库存数量-/-冻结数量
WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews();
wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码
wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码
wmsOdsEmStorageNews.setWaCode(wmsRawOrderInSn.getWaCode());//库位编码
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.setWaCode(wmsRawOrderInSn.getWaCode());
wmsOdsMateStorageNews1.setAmount(wmsRawOrderInSn.getAmount());
wmsOdsMateStorageNews1.setStorageAmount(wmsRawOrderInSn.getAmount());
wmsOdsMateStorageNews1.setMaterialCode(wmsRawOrderInSn.getMaterialCode());
wmsOdsMateStorageNews1.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc());
wmsOdsMateStorageNews1.setStorageType("BC");
wmsOdsMateStorageNews1.setCreateBy(wmsRawOrderInSn.getCreateBy());
wmsOdsMateStorageNews1.setGmtCreate(new Date());
wmsOdsMateStorageNews1.setActiveFlag("1");
wmsOdsMateStorageNews1.setFactoryCode(wmsRawOrderInSn.getFactoryCode());
wmsOdsMateStorageNews1.setSapFactoryCode(wmsRawOrderInSn.getSapFactoryCode());
wmsOdsMateStorageNews1.setUserDefined1(wmsRawOrderInSn.getUserDefined4());//单位
wmsOdsMateStorageNewsMapper.insertWmsOdsMateStorageNews(wmsOdsMateStorageNews1);
} else {
wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews);
}
wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn);//入库
}
}else {////失败|
result="暂收失败";
order.setSapTempInfor(result2.getMsg());
order.setSapTempStatus("0");//0是失败。1是成功
odsProcureOrderMapper.updateOdsProcureOrder(order);
return result;
}
return result;
}
@ -775,7 +854,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
if (ruslt.getCode()==200){//成功
odsProcureOrderMapper.updateOdsProcureOrderAddOperationNumber(odsProcureOrder);
}else {
result="操作失败";
result="操作失败:"+ruslt.getMsg();
}
return result;
}

@ -1028,6 +1028,22 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
return records;
}
@Override
public WmsProductPut WmsProductPutByWorkOrderqueryBS(WmsProductPut wmsProductPut) {
// 使用 split 方法根据 '-' 分割字符串,结果是一个字符串数组
DynamicDataSourceContextHolder.push("ds_" + wmsProductPut.getFactoryCode());
String[] attributes = wmsProductPut.getPallet().split("-");
// 通过索引访问分割后的数组,获取所需的三个属性
String attribute1 = attributes[0]; // 获取第一个属性
String attribute2 = attributes[1]; // 获取第二个属性
String attribute3 = attributes[2]; // 获取第三个属性
wmsProductPut.setAttribute1(attribute1);
wmsProductPut.setAttribute2(attribute2);
wmsProductPut.setAttribute3(attribute3);
WmsProductPut wmsProductPut1 = wmsProductPutMapper.WmsProductPutByWorkOrderqueryBS(wmsProductPut);
return wmsProductPut1;
}
@Override
public List<WmsRuturnPutEmbryo> FinishedProductSalesReturn(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) {
DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode());

@ -188,6 +188,10 @@
<if test="lastUpdateBy != null">Last_Update_By = #{lastUpdateBy},</if>
<if test="lastUpdateDate != null">Last_Update_Date = #{lastUpdateDate},</if>
<if test="Active != null">Active = #{Active},</if>
<if test="SapTempInfor != null">Sap_Temp_Infor = #{SapTempInfor},</if>
<if test="SapTempStatus != null">Sap_Temp_Status = #{SapTempStatus},</if>
<if test="SAPstatus != null">SAP_status = #{SAPstatus},</if>
<if test="SAPmessage != null">SAP_message = #{SAPmessage},</if>
<if test="enterpriseId != null">Enterprise_Id = #{enterpriseId},</if>
<if test="enterpriseCode != null">Enterprise_Code = #{enterpriseCode},</if>
</trim>

@ -213,7 +213,7 @@
</delete>
<select id="selectByWhCodeAndMate" resultMap="WmsOdsMateStorageNewsResult">
select storage_id, wh_code, region_code, wa_code, storage_type, wl_code, material_code, material_desc, amount, storage_amount, occupy_amount, lpn, product_batch, receive_date, product_date, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, user_defined7, user_defined8, user_defined9, user_defined10, create_by, gmt_create, last_modified_by, gmt_modified, active_flag, factory_code, sap_factory_code, wl_name from wms_ods_mate_storage_news
where wh_code=#{whCode} and wl_code=#{wlCode} and material_code=#{materialCode}
where wh_code=#{whCode} and wl_code=#{wlCode} and wa_code=#{waCode} and material_code=#{materialCode}
</select>
<select id="selectBaseProductByCode" resultMap="WmsOdsMateStorageNewsResult">
select DISTINCT material_desc,user_defined1

@ -195,8 +195,9 @@
<update id="updateAdd">
update wms_ods_mate_storage_news
set amount = ISNULL(amount, 0) + #{amount},
storage_amount = ISNULL(storage_amount, 0) + #{amount},
gmt_modified=GETDATE()
where wh_code=#{whCode} and wl_code=#{wlCode} and material_code=#{materialCode}
where wh_code=#{whCode} and wl_code=#{wlCode} and wa_code=#{waCode} and material_code=#{materialCode}
</update>
<update id="updatekdd">
update wms_ods_mate_storage_news

@ -384,5 +384,35 @@
#{item.id}
</foreach>
</update>
<select id="WmsProductPutByWorkOrderqueryBS" resultMap="WmsProductPutResult">
SELECT
mes_report_work.report_code work_order,
pro_order_workorder.workorder_code_sap 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
pro_order_workorder
LEFT JOIN mes_report_work ON pro_order_workorder.workorder_code = mes_report_work.workorder_code
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= pro_order_workorder.workorder_code_sap
WHERE
pro_order_workorder.workorder_code_sap=#{attribute1}
AND mes_report_work.batch=#{attribute2}
AND mes_report_work.parent_order = '0'
</select>
</mapper>

@ -200,37 +200,51 @@
set
user_defined1 = '2'
where raw_order_in_sn_id=#{rawOrderInSnId}
AND user_defined1 = '1'
AND active_flag = '1'
</update>
<select id="selecPurchaseOrderdeliPdaList" parameterType="com.op.wms.domain.OdsProcureOrder" resultMap="WmsRawOrderInSnResult">
SELECT
wh_code,
wl_code,
wa_code,
po_no,
material_code,
material_desc,
sum ( amount ) AS amount,
user_defined2,
user_defined3
sn,
amount AS amount
FROM
wms_raw_order_in_sn
WHERE
user_defined5 = #{receiptNoCode}
AND active_flag='1'
GROUP BY
user_defined3 = #{ID}
AND user_defined1 = '1'
AND active_flag = '1'
</select>
<select id="selecPurchaseOrderdeliPdaById" parameterType="com.op.wms.domain.OdsProcureOrder" resultMap="WmsRawOrderInSnResult">
SELECT
wh_code,
po_no,
material_code,
material_desc,
user_defined2,
user_defined3,
user_defined4;
SUM ( amount ) AS amount
FROM
wms_raw_order_in_sn
WHERE
user_defined3 =#{ID}
AND user_defined1 = '1'
AND active_flag = '1'
GROUP BY
wh_code,
po_no,
material_code,
material_desc;
</select>
<insert id="insertWmsLogotypeTable" >
insert into wms_logotype_table(
id,
logotype,
sn,
activeFlag
active_flag
)
values
(

Loading…
Cancel
Save