Merge remote-tracking branch 'origin/master'

master
Yangwl 1 year ago
commit 82891f72d2

@ -136,6 +136,15 @@ public class QcCheckTaskIncomeDTO extends BaseEntity {
private BigDecimal bNoOkquality;
private BigDecimal cNoOkquality;
private String orderType;
private String orderTypeDesc;
public String getOrderTypeDesc() {
return orderTypeDesc;
}
public void setOrderTypeDesc(String orderTypeDesc) {
this.orderTypeDesc = orderTypeDesc;
}
public String getOrderType() {
return orderType;

@ -1,5 +1,6 @@
package com.op.mes.mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -144,4 +145,6 @@ public interface MesReportWorkMapper {
int updateAttr2(MesReportWork workorder);
void updateReportRemark(@Param("list") List<MesReportWork> mesReportWork);
BigDecimal getReportRate(String productCode);
}

@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -372,6 +373,13 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if(sHzWorks==null){
return R.fail("未查询到子报工单");
}
//查询base_product的report_rate//箱子-大盒-小盒
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(0).getProductCode());
if(reportRate != null){
BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP);
sHzWorks.setQuantityFeedback(newQuantity);
}
//子工单报工
logger.info("==========================子工单报工开始");
sapRson = this.reportHzToSap(sHzWorks);
@ -398,7 +406,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
}else if(workOrders.size()>=3){
MesReportWork hzWorks = null;
BigDecimal gamng = null;
for(int n=0;n<workOrders.size();n++){
MesReportWork workOrder = workOrders.get(n);
@ -409,12 +417,15 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if (sHzWorks == null) {
return R.fail(workOrder.getWorkorderCode()+"未查询到报工单");
}
if(n==0){
hzWorks = sHzWorks;
if(n == (workOrders.size()-2)){
gamng = sHzWorks.getQuantityFeedback();
}
if(n == (workOrders.size()-1)){
sHzWorks.setQuantityFeedback(gamng);
}
//三层以上工单报工
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工开始");
sHzWorks.setQuantityFeedback(hzWorks.getQuantityFeedback());
sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:"
+ JSONObject.toJSONString(sapRson));

@ -273,8 +273,14 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@DS("#header.poolName")
public int reportSapCancel(MesReportWork mesReportWork) {
mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName"));
int m = mesReportWorkMapper.reportSapCancel(mesReportWork);
return m;
mesReportWorkMapper.reportSapCancel(mesReportWork);
ProOrderWorkorder son = mesReportWorkMapper.getSonWorkOrder(mesReportWork.getWorkorderCode());
while(son != null){
mesReportWork.setWorkorderCode(son.getWorkorderCode());
mesReportWorkMapper.reportSapCancel(mesReportWork);
son = mesReportWorkMapper.getSonWorkOrder(son.getWorkorderCode());
}
return 1;
}
@Override

@ -473,7 +473,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSapWorkOrder" resultType="com.op.mes.domain.MesReportWork">
select workorder_code_sap workorderCodeSap,
workorder_code workorderCode,
factory_code factoryCode
factory_code factoryCode,
product_code productCode
from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' <!--and status = 'w2'-->
order by order_code
@ -520,9 +521,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
pow.del_flag = '0'
<if test="keywords != null and keywords != ''">
and pow.order_code like concat('%', #{keywords}, '%') or
and (
pow.order_code like concat('%', #{keywords}, '%') or
pow.workorder_code_sap like concat('%', #{keywords}, '%') or
mrw.productCode like concat('%', #{keywords}, '%')
)
</if>
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
@ -692,6 +695,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mrwc.attr1 = '1' and mrwc.del_flag = '0' and mrwc.attr2 = '0'
and mrwc.parent_order = #{workorderCode}
</select>
<select id="getReportRate" resultType="java.math.BigDecimal">
select report_rate from base_product
where product_code = #{productCode}
and del_flag = '0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -303,7 +303,7 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setProductName(productNameInfo.getProdDesc());
workOrder.setBelongWorkOrder(belongWorkOrder);
workOrder.setProdType("LJ01");
workOrder.setProdType(proOrder.getOrderType());
// 将工单信息更新至数据库/**pro_order_workorder**/
proOrderWorkorderMapper.insertProOrderWorkorder(workOrder);
@ -574,7 +574,6 @@ public class ProOrderServiceImpl implements IProOrderService {
order.setPlanFactoryCode(factoryCode);
order.setFactoryCode(factoryCode);
order.setCreateBy(SecurityUtils.getUsername());
order.setOrderType("LJ01");
order.setProdType("prod");
order.setStatus("o0");
bpqo = new BaseProduct();

@ -168,6 +168,7 @@ public class QcCheckTaskIncome extends BaseEntity {
*/
private String delFlag;
private String orderType;
private String orderTypeDesc;
private String incomeTimeStart;
private String incomeTimeEnd;
private String checkTimeStart;
@ -193,6 +194,33 @@ public class QcCheckTaskIncome extends BaseEntity {
private String noOkQualityNames;
private String noOkQualityVals;
private String materialType;//来料类别
private String materialFrom;//物料来源
public String getOrderTypeDesc() {
return orderTypeDesc;
}
public void setOrderTypeDesc(String orderTypeDesc) {
this.orderTypeDesc = orderTypeDesc;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialFrom() {
return materialFrom;
}
public void setMaterialFrom(String materialFrom) {
this.materialFrom = materialFrom;
}
public String getCheckLocName() {
return checkLocName;
}

@ -256,7 +256,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
}
qcCheckTaskIncome.setNoOkQuality(noOkQuality);
/**qc_check_task**/
/**qc_check_task**///------------------zxl
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/

@ -36,13 +36,17 @@
<result property="delFlag" column="del_flag"/>
<result property="checkType" column="check_type"/>
<result property="sampleQuality" column="sample_quality"/>
<result property="orderType" column="order_type"/>
<result property="orderTypeDesc" column="order_type_desc"/>
</resultMap>
<sql id="selectQcCheckTaskIncomeVo">
select record_id, check_no, income_batch_no, order_no, material_code, material_name, quality, unit,
supplier_code, supplier_name, income_time, check_loc, check_status, check_man_code,
check_man_name, check_time, check_result, status, attr1, attr2, attr3, attr4, create_by,
create_time, update_by, update_time, factory_code, del_flag , check_type,sample_quality, noOk_quality
create_time, update_by, update_time, factory_code, del_flag , check_type,sample_quality, noOk_quality,
order_type,order_type_desc
from qc_check_task
</sql>
@ -52,7 +56,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type,qct.noOk_quality,
qct.sample_quality, qct.type_code
qct.sample_quality, qct.type_code, qct.order_type
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
@ -83,6 +87,7 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="typeCode != null ">and qct.type_code = #{typeCode}</if>
<if test="orderType != null ">and qct.order_type = #{orderType}</if>
</where>
order by qct.create_time DESC
</select>
@ -208,6 +213,7 @@
<if test="typeCode != null">type_code,</if>
<if test="sampleQuality != null">sample_quality,</if>
<if test="orderType != null">order_type,</if>
<if test="orderTypeDesc != null">order_type_desc,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -243,6 +249,7 @@
<if test="typeCode != null">#{typeCode},</if>
<if test="sampleQuality != null">#{sampleQuality},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderTypeDesc != null">#{orderTypeDesc},</if>
</trim>
</insert>

@ -412,6 +412,10 @@ public class SapItemSyncImpl implements SapItemSyncService {
qcCheckTaskIncomeDTO.setRecordId(IdUtils.fastSimpleUUID());
qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
qcCheckTaskIncomeDTO.setTypeCode("material");
/**8010 8020 8030 8040 8050 8060
8061 8062 8070 广8090 **/
qcCheckTaskIncomeDTO.setOrderType(maraTable.getString("MTART"));//物料类型
qcCheckTaskIncomeDTO.setOrderTypeDesc(maraTable.getString("MTBEZ"));//物料类型描述
qcCheckTaskIncomeDTO.setOrderNo(maraTable.getString("EBELN"));//采购订单
qcCheckTaskIncomeDTO.setSupplierCode(maraTable.getString("LIFNR"));
qcCheckTaskIncomeDTO.setSupplierName(maraTable.getString("LIFNR_NM"));

@ -262,6 +262,7 @@ public class WmsToWCSmissionController {
public AjaxResult selectSnCorrelationBarcode(@RequestBody WmsProductPutTrayCode wmsProductPutTrayCode) {
return AjaxResult.success(wmsProductPutService.selectSnCorrelationBarcode(wmsProductPutTrayCode));
}
/**
* --
*

@ -344,6 +344,12 @@ public class BaseProduct extends BaseEntity {
@Excel(name = "其它")
private String other;
/**
*
*/
@Excel(name = "报工汇率")
private Integer reportRate;
public void setCategory(String category) {
this.category = category;
}
@ -784,6 +790,14 @@ public class BaseProduct extends BaseEntity {
return mtart;
}
public void setReportRate(Integer reportRate) {
this.reportRate = reportRate;
}
public Integer getReportRate() {
return reportRate;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

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

@ -674,9 +674,83 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
return result;
}
/**
*
"MAKTX": "榄菊果蔬餐具净(海盐柠檬)1kg×10",
"KUNNR": "0001010404", //送达方
"VBELN": "0081003133", //交货单
"ZSAREA": "", //销售大区
"BZTXT1": "", //销售大区描述
"KUNNR_NM": "上海大润发有限公司(华东高新总仓)", //送达方描述
"MENGE": "6.000", //数量
"MEINS": "KAR", //单位
"LIFNR_NM": "上海中集公联集装箱储运有限公司", //货运代理描述
"TDDAT": "2202-02-09", //计划日期
"LIFNR": "0000400213", //货运代理
"VBELN_VA": "0000738138", //销售单
"MATNR": "000000010201020100"
* @param wmsSellOutEmbryo
* @return
*/
@Override
public List<WmsSellOutEmbryo> selectFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo) {
return null;
public String selectFinishedProductSales(WmsSellOutEmbryo wmsSellOutEmbryo) {
String results="提单成功";
DynamicDataSourceContextHolder.push("ds_" + wmsSellOutEmbryo.getFactoryCode());
Map<String, Object> objectMap=new HashMap<>();
// objectMap.put("S_MATNR","");//物料号,
// objectMap.put("S_TDDAT","");//String 计划运输日期
objectMap.put("VBELN_VA",wmsSellOutEmbryo.getDeliveryOrder());//交货单
R result = remoteSapService.FPinventory(objectMap);
int code = result.getCode();
String msg = result.getMsg();
if(code==200){
List<Map<String,String>> mapList= (List<Map<String, String>>) result.getData();
for ( Map<String,String> stringStringMap: mapList){
String MAKTX=stringStringMap.get("MAKTX");//物料描述
String MATNR=stringStringMap.get("MATNR");//物料号
String KUNNR=stringStringMap.get("KUNNR");//送达方
String VBELN=stringStringMap.get("VBELN");//交货单---一销售单对多交货单
String VBELN_VA=stringStringMap.get("VBELN_VA");//销售单
String MENGE=stringStringMap.get("MENGE");//数量
String MEINS=stringStringMap.get("MEINS");//单位
String TDDAT=stringStringMap.get("TDDAT");//计划日期
String KUNNR_NM=stringStringMap.get("KUNNR_NM");//送达方描述
String LIFNR=stringStringMap.get("LIFNR");//货运代理
String LIFNR_NM=stringStringMap.get("LIFNR_NM");//货运代理描述
String ZSAREA=stringStringMap.get("ZSAREA");//销售大区
String BZTXT1=stringStringMap.get("BZTXT1");//销售大区描述
WmsSellOutEmbryo wmsSellOutEmbryo1=new WmsSellOutEmbryo();
wmsSellOutEmbryo1.setId(IdUtils.fastSimpleUUID());
wmsSellOutEmbryo1.setDeliveryOrder(VBELN);//交货单号
wmsSellOutEmbryo1.setAttr1(VBELN_VA);
wmsSellOutEmbryo1.setProductCode(MATNR);
wmsSellOutEmbryo1.setProductName(MAKTX);
wmsSellOutEmbryo1.setFactoryCode(wmsSellOutEmbryo.getFactoryCode());
wmsSellOutEmbryo1.setOutQuantity(new BigDecimal("0"));
wmsSellOutEmbryo1.setAttr2(KUNNR);
wmsSellOutEmbryo1.setAttr3(KUNNR_NM);
wmsSellOutEmbryo1.setAttr4(LIFNR);
wmsSellOutEmbryo1.setAttr5(LIFNR_NM);
wmsSellOutEmbryo1.setAttr6(ZSAREA);
wmsSellOutEmbryo1.setAttr7(BZTXT1);
wmsSellOutEmbryo1.setAttr8(TDDAT);
wmsSellOutEmbryo1.setPlanQuantity(new BigDecimal(MENGE));
wmsSellOutEmbryo1.setUnitOfMeasure(MEINS);
wmsSellOutEmbryo1.setStatus("0");
wmsSellOutEmbryo1.setSapStatus("0");
wmsSellOutEmbryo1.setActiveFlag("1");
wmsSellOutEmbryo1.setCreateBy(wmsSellOutEmbryo.getCreateBy());
wmsSellOutEmbryo1.setCreateTime(new Date());
//判断有没有这个单子,。如果有的话,就跳过吧
WmsSellOutEmbryo wmsSellOutEmbryo2= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(VBELN,MATNR);
if (wmsSellOutEmbryo2==null){
wmsSellOutEmbryoMapper.insertWmsSellOutEmbryo(wmsSellOutEmbryo1);
}else {
results="已经存在";
}
}
}
return results;
}
@Override

@ -64,10 +64,11 @@
<result property="pvc" column="pvc"/>
<result property="supportPlate" column="support_plate"/>
<result property="other" column="other"/>
<result property="reportRate" column="report_rate"/>
</resultMap>
<sql id="selectBaseProductVo">
select product_id, product_code, product_desc_zh, product_model,product_desc_en, rule_code, old_product_code, parts_product_code, sku_barcode, length, width, height, gross_weight, net_weight, tare_weight, volume, unit_price, product_group, product_group_name, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, create_by, create_time, update_by, update_time, factory_code, active_flag, sync_flag, primary_uom, del_flag, bstme, basic_order, conv_order, ausme, basic_issue, conv_issue, append_flag, append_percent,mtart from base_product
select product_id, product_code, product_desc_zh, product_model,product_desc_en, rule_code, old_product_code, parts_product_code, sku_barcode, length, width, height, gross_weight, net_weight, tare_weight, volume, unit_price, product_group, product_group_name, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, create_by, create_time, update_by, update_time, factory_code, active_flag, sync_flag, primary_uom, del_flag, bstme, basic_order, conv_order, ausme, basic_issue, conv_issue, append_flag, append_percent, mtart, report_rate from base_product
</sql>
<select id="selectBaseProductList" parameterType="BaseProduct" resultMap="BaseProductResult">
@ -110,6 +111,7 @@
<if test="appendFlag != null and appendFlag != ''">and append_flag = #{appendFlag}</if>
<if test="appendPercent != null and appendPercent != ''">and append_percent = #{appendPercent}</if>
<if test="mtart != null and mtart != ''">and mtart = #{mtart}</if>
<if test="reportRate != null and reportRate != ''">and report_rate = #{reportRate}</if>
and del_flag = '0'
</where>
order by product_code asc
@ -160,6 +162,7 @@
bp.append_flag,
bp.append_percent,
bp.mtart,
bp.report_rate,
bpa.category,
bpa.pc,
bpa.iei,
@ -229,6 +232,7 @@
<if test="appendFlag != null">append_flag,</if>
<if test="appendPercent != null">append_percent,</if>
<if test="mtart != null">mtart,</if>
<if test="reportRate != null">report_rate,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">#{productId},</if>
@ -274,6 +278,7 @@
<if test="appendFlag != null">#{appendFlag},</if>
<if test="appendPercent != null">#{appendPercent},</if>
<if test="mtart != null">#{mtart},</if>
<if test="reportRate != null">#{reportRate},</if>
</trim>
</insert>
@ -321,6 +326,7 @@
<if test="appendFlag != null">append_flag = #{appendFlag},</if>
<if test="appendPercent != null">append_percent = #{appendPercent},</if>
<if test="mtart != null and mtart != ''">mtart = #{mtart},</if>
<if test="reportRate != null and reportRate != ''">report_rate = #{reportRate},</if>
</trim>
where product_id = #{productId}
</update>
@ -398,6 +404,7 @@
bp.append_flag,
bp.append_percent,
bp.mtart,
bp.report_rate,
bpa.category,
bpa.pc,
bpa.iei,

Loading…
Cancel
Save