Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 126ff29e69

@ -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

@ -112,7 +112,7 @@ public class SapRFW {
}
}
public 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: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92: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: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
#命名空间
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置
@ -41,7 +41,7 @@ spring:
datasource:
ds1:
nacos:
server-addr: 175.27.215.92:8848
server-addr: 140.249.53.142:8848
dataId: sentinel-op-gateway
groupId: DEFAULT_GROUP
data-type: json

@ -26,9 +26,7 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -130,15 +130,22 @@ 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));
}
}

@ -0,0 +1,40 @@
package com.op.mes.domain;
public class BufferInfoParam {
private String reqCode;
private String reqTime;
private String factory;
private 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;
}
}

@ -0,0 +1,47 @@
/**
* Copyright 2023 json.cn
*/
package com.op.mes.domain.buffer;
import java.util.List;
/**
* Auto-generated: 2023-11-10 11:26:39
*
* @author json.cn (i@json.cn)
* @website http://www.json.cn/java2pojo/
*/
public class JsonRootBean {
private String reqCode;
private int code;
private String message;
private List<Locations> locations;
public void setReqCode(String reqCode) {
this.reqCode = reqCode;
}
public String getReqCode() {
return reqCode;
}
public void setCode(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public void setMessage(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
public void setLocations(List<Locations> locations) {
this.locations = locations;
}
public List<Locations> getLocations() {
return locations;
}
}

@ -0,0 +1,78 @@
/**
* Copyright 2023 json.cn
*/
package com.op.mes.domain.buffer;
/**
* Auto-generated: 2023-11-10 11:26:39
*
* @author json.cn (i@json.cn)
* @website http://www.json.cn/java2pojo/
*/
public class Locations {
private String location;
private String bufferType;
private boolean isBooked;
private boolean isUsed;
private boolean isOccupeid;
private String rfid;
private String reason;
private String sku;
public void setLocation(String location) {
this.location = location;
}
public String getLocation() {
return location;
}
public void setBufferType(String bufferType) {
this.bufferType = bufferType;
}
public String getBufferType() {
return bufferType;
}
public void setIsBooked(boolean isBooked) {
this.isBooked = isBooked;
}
public boolean getIsBooked() {
return isBooked;
}
public void setIsUsed(boolean isUsed) {
this.isUsed = isUsed;
}
public boolean getIsUsed() {
return isUsed;
}
public void setIsOccupeid(boolean isOccupeid) {
this.isOccupeid = isOccupeid;
}
public boolean getIsOccupeid() {
return isOccupeid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
public String getRfid() {
return rfid;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getReason() {
return reason;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getSku() {
return sku;
}
}

@ -55,5 +55,7 @@ public interface MesMapper {
List<Map<String, String>> selectcxjList();
List<Map<String, String>> selectdryingRoomListInfo();
void deleteDateByTableName0(@Param("table")String table,@Param("ymdhms")String ymdhms);
}

@ -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;
@ -412,21 +417,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: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92: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,21 +14,21 @@ 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;
private String quantity;
private String quantity;
private String meins;
private String batch;
private String batch;
public String getAufnr() {
return aufnr;

@ -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");
}

@ -128,6 +128,7 @@ public class SapOrderServiceImpl implements SapOrderService {
proOrder.setStatus("o0");
proOrder.setProdType("prod");
proOrderList.add(proOrder);
// remotePlanService.sapAddOrder(proOrder);
// remoteMesService.sapAddOrder(proOrder);
}

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

Loading…
Cancel
Save