烘房看板接口

highway
Yangwl 1 year ago
parent 122b7aec05
commit cec59e4bc4

@ -1,5 +1,5 @@
#for test only!
#Fri Oct 13 09:43:21 CST 2023
#Mon Nov 06 18:11:07 CST 2023
jco.destination.pool_capacity=true
jco.client.lang=zh
jco.client.ashost=192.168.0.54

@ -42,7 +42,7 @@ public class SapRFW {
}
public static class lt_gs
public class lt_gs
{
String conf_activity1;
String conf_activity2;
@ -112,7 +112,7 @@ public class SapRFW {
}
}
public static class lt_hw{
public class lt_hw{
String material;
String entry_qnt;

@ -16,16 +16,16 @@ spring:
# password: sfnacos2023
# 服务注册地址
#--spring.cloud.nacos.discovery.namespace=chj --spring.cloud.nacos.config.namespace=chj
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -84,7 +84,8 @@ public class HttpUtils {
conn.setRequestProperty("connection" , "Keep-Alive");
conn.setRequestProperty("user-agent" , "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset" , "utf-8");
conn.setRequestProperty("contentType" , "utf-8");
// conn.setRequestProperty("contentType" , "utf-8");
conn.setRequestProperty("content-Type", "application/json; charset=utf-8");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());

@ -16,16 +16,16 @@ spring:
# username: nacos
# password: sfnacos2023
# namespace: lanju-op
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -142,15 +142,20 @@ public class WCSInterfaceController extends BaseController {
* @param
*/
@PostMapping("/dryRoomData")
public AjaxResult getDryRoomData(@RequestBody BoardDTO boardDTO){
@PostMapping("/dryRoomDataHeader")
public AjaxResult dryRoomDataHeader(@RequestBody BoardDTO boardDTO){
if(StringUtils.isBlank(boardDTO.getFactory())){
return error("[factory] is not null");
}
return success(wCInterfaceService.getDryRoomData(boardDTO));
return success(wCInterfaceService.dryRoomDataHeader(boardDTO));
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());
@PostMapping("/dryRoomDataCarousel")
public AjaxResult getDryRoomData(@RequestBody BoardDTO boardDTO){
if(StringUtils.isBlank(boardDTO.getFactory())){
return error("[factory] is not null");
}
return success(wCInterfaceService.dryRoomDataCarousel(boardDTO));
}
}

@ -54,4 +54,6 @@ public interface MesMapper {
void addSapLog(SysSapLog sysSapLog);
List<Map<String, String>> selectcxjList();
List<Map<String, String>> selectdryingRoomListInfo();
}

@ -37,5 +37,7 @@ public interface IWCSInterfaceService {
R reportWork(MesReportWork mesReportWork);
Map getDryRoomData(BoardDTO boardDTO);
Map dryRoomDataHeader(BoardDTO boardDTO);
Map dryRoomDataCarousel(BoardDTO boardDTO);
}

@ -1,14 +1,19 @@
package com.op.mes.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.http.HttpUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.BufferInfoParam;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.MesShift;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.buffer.JsonRootBean;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesReportWorkMapper;
@ -403,21 +408,118 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
@Override
public Map getDryRoomData(BoardDTO boardDTO) {
public Map dryRoomDataHeader(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key
//成型机清单
Map map=new HashMap();
List<Map<String,String>> eqmapList = mesMapper.selectcxjList();
/**
*
*/
long cxzc = eqmapList.stream()
.filter(e -> e.get("status").equals("1")&&e.get("equipment_type_code").equals("equ_type_cxj")&&!e.get("del_flag").equals("1"))
.count();
/**
*
*/
long hfauto = eqmapList.stream()
.filter(e -> e.get("status").equals("1") &&e.get("equipment_type_code").equals("equ_type_hf")&&!e.get("del_flag").equals("1"))
.count();
/**
*
*/
long spzc = eqmapList.stream()
.filter(e -> e.get("status").equals("1") &&e.get("equipment_type_code").equals("equ_type_spj")&&!e.get("del_flag").equals("1"))
.count();
BufferInfoParam bufferInfoParam=new BufferInfoParam();
bufferInfoParam.setReqCode(IdUtils.fastSimpleUUID());
bufferInfoParam.setReqTime(DateUtils.dateTimeNow());
//成型缓存区
bufferInfoParam.setBufferType("10");
bufferInfoParam.setFactory(boardDTO.getFactory());
try {
String res= HttpUtils.sendPost("http://192.168.202.23:5001/api/ReceivingAndFeedingMaterials/bufferInfoSync", JSON.toJSONString(bufferInfoParam));
JsonRootBean jsonRootBean=JSONObject.parseObject(res,JsonRootBean.class);
long count = jsonRootBean.getLocations().stream()
.filter(obj -> !obj.getRfid().isEmpty())
.count();
map.put("hcnumber",count);
}catch (Exception e){
e.printStackTrace();
}
map.put("cxzc",cxzc);
map.put("hfauto",hfauto);
map.put("spzc",spzc);
map.put("result",eqmapList);
return map;
}
public static void main(String args[]){
DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate today = LocalDate.now();
LocalDate lastMonth3 = today.plus(-3, ChronoUnit.MONTHS);
System.out.println("7天之前的日期为:"+lastMonth3.getYear());
@Override
public Map dryRoomDataCarousel(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push("ds_"+boardDTO.getFactory());// 这是数据源的key
Map map=new HashMap();
//查询烘房信息
List<Map<String,String>> dryingRoomListInfo = mesMapper.selectdryingRoomListInfo();
map.put("dryingroomList",dryingRoomListInfo);
return map;
}
// public static void main(String[] args) {
// param param=new param();
// param.setReqCode(IdUtils.fastSimpleUUID());
// param.setReqTime(DateUtils.dateTimeNow());
// param.setBufferType("10");
// param.setFactory("999");
// try {
// String res= HttpUtils.sendPost("http://192.168.109.36:5001/api/ReceivingAndFeedingMaterials/bufferInfoSync", JSON.toJSONString(param));
// System.out.println(res);
// }catch (Exception e){
// System.out.println(e.getMessage());
// }
//
// }
// static class param{
// String reqCode;
// String reqTime;
// String factory;
// String bufferType;
//
// public String getReqCode() {
// return reqCode;
// }
//
// public void setReqCode(String reqCode) {
// this.reqCode = reqCode;
// }
//
// public String getReqTime() {
// return reqTime;
// }
//
// public void setReqTime(String reqTime) {
// this.reqTime = reqTime;
// }
//
// public String getFactory() {
// return factory;
// }
//
// public void setFactory(String factory) {
// this.factory = factory;
// }
//
// public String getBufferType() {
// return bufferType;
// }
//
// public void setBufferType(String bufferType) {
// this.bufferType = bufferType;
// }
// }
}

@ -13,15 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -168,8 +168,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where create_time >= #{startDate} and #{endDate}>create_time
</select>
<select id="selectcxjList" resultType="java.util.Map">
SELECT * FROM [dbo].[base_equipment] WHERE equipment_type_code='equ_type_cxj'
SELECT * FROM [dbo].[base_equipment]
</select>
<select id="selectdryingRoomListInfo" resultType="java.util.Map">
SELECT
CONVERT(INT, SUBSTRING(PivotTable.equipment_code, 2, LEN(PivotTable.equipment_code) - 1)) as i,
PivotTable.*,
DATEDIFF(MINUTE, T2.last_update_time, GETDATE()) as waitmin
FROM
(
SELECT
be.equipment_code,
be.status,
bea.isvalue,
bea.property
FROM
base_equipment be
LEFT JOIN base_equipment_attached bea ON be.equipment_code = bea.device_code
WHERE
be.equipment_type_code = 'equ_type_hf'
AND del_flag = '0'
) AS SourceTable PIVOT ( MAX ( isvalue ) FOR property IN ( [dollyNumber], [Intheoven], [temperature] ) ) AS PivotTable LEFT JOIN base_equipment_attached T2 ON PivotTable.equipment_code=T2.device_code WHERE T2.property='dollyNumber'
ORDER BY i asc
</select>
<delete id="deleteBkDateByTable">
delete from mes_material_transfer_result
where create_time >= #{startDate} and #{endDate}>create_time

@ -352,4 +352,6 @@ public class SapController extends BaseController {
return R.ok();
}
}

@ -14,15 +14,15 @@ package com.op.sap.domain.vo;
*/
public class SapMaterialPosting {
private String aufnr;
/**
* 261
* 退262
*
*/
private String aufnr;
private String bwart;
private String plant;
private String lgort;
private String matnr;

@ -205,6 +205,82 @@ public class SapItemSyncImpl implements SapItemSyncService {
JCoTable jCoTable = func.getTableParameterList().getTable("L_ITEM");
System.out.println(jCoTable);
JCoParameterList AUFNR = func.getImportParameterList();
System.out.println(AUFNR);
//订单
if (!StringUtils.isNull(sapMaterialPosting.getAufnr())){
// AUFNR.appendRow();
// AUFNR.setValue(Constants.SIGN, "I");
// AUFNR.setValue(Constants.OPTION, "EQ");
// AUFNR.setValue(Constants.LOW, sapMaterialPosting.getAufnr());
}
// //移动类型
// if (!StringUtils.isNull(sapMaterialPosting.getBwart())){
// JCoTable S_MATNR = func.getTableParameterList().getTable("BWART");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getBwart());
// }
// //工厂
// if (!StringUtils.isNull(sapMaterialPosting.getPlant())){
// JCoTable S_MATNR = func.getTableParameterList().getTable("PLANT");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getPlant());
// }
// /**
// * 物料信息
// */
// if (!StringUtils.isNull(sapMaterialPosting.getMatnr())){
// JCoTable S_MATNR = func.getTableParameterList().getTable("MATNR");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getMatnr());
// }
// //数量
// if (!StringUtils.isNull(sapMaterialPosting.getQuantity())){
// JCoTable S_MATNR = func.getTableParameterList().getTable("QUANTITY");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getQuantity());
// }
// //单位
// if (!StringUtils.isNull(sapMaterialPosting.getMeins())){
// JCoTable S_MATNR = func.getTableParameterList().getTable("MEINS");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getMeins());
// }
// //批号
// JCoTable S_MATNR = func.getTableParameterList().getTable("BATCH");
// S_MATNR.appendRow();
// S_MATNR.setValue(Constants.SIGN, "I");
// S_MATNR.setValue(Constants.OPTION, "EQ");
// S_MATNR.setValue(Constants.LOW, sapMaterialPosting.getBatch());
// 获取调用 RFC 函数对象
func.execute(dest);
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_RETURN");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String RETCODE = maraTable.getString("RETCODE");
System.out.println(RETCODE);
}
// JCoRecordMetaData metaData = maraTable.getRecordMetaData();
// System.out.println("###" + metaData.toString());
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}

@ -13,15 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -13,15 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 140.249.53.142:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

Loading…
Cancel
Save