opt:增加websocket监听首页
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.common.mnt.websocket;
|
||||
package org.nl.common.websocket;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.common.websocket;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.database.eas.dao.HomeBillCounts;
|
||||
import org.springframework.stereotype.Component;
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
|
||||
@ServerEndpoint("/webSocket/SendHomeInfo/{sid}")
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SendHomeWebSocketServer {
|
||||
|
||||
/**
|
||||
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
|
||||
*/
|
||||
private static CopyOnWriteArraySet<SendHomeWebSocketServer> webSocketSet = new CopyOnWriteArraySet<>();
|
||||
|
||||
/**静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。*/
|
||||
private static int onlineCount = 0;
|
||||
|
||||
|
||||
/**与某个客户端的连接会话,需要通过它来给客户端发送数据*/
|
||||
private Session session;
|
||||
/**
|
||||
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
|
||||
*/
|
||||
/**
|
||||
* 接收sid
|
||||
*/
|
||||
private String sid = "";
|
||||
|
||||
/**
|
||||
* 连接建立成功调用的方法
|
||||
*/
|
||||
@OnOpen
|
||||
public void onOpen(Session session, @PathParam("sid") String sid) {
|
||||
this.session = session;
|
||||
//如果存在就先删除一个,防止重复推送消息
|
||||
webSocketSet.removeIf(webSocket -> webSocket.sid.equals(sid));
|
||||
webSocketSet.add(this);
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接关闭调用的方法
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
webSocketSet.remove(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到客户端消息后调用的方法
|
||||
*
|
||||
* @param message 客户端发送过来的消息
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
System.out.println(webSocketSet.size() + "_接收到消息_" + session.getId());
|
||||
}
|
||||
|
||||
@OnError
|
||||
public void onError(Session session, Throwable error) {
|
||||
//log.error("发生错误");
|
||||
webSocketSet.remove(session);
|
||||
error.printStackTrace();
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
Integer d = 1;
|
||||
return session;
|
||||
}
|
||||
// 发送消息,在定时任务中会调用此方法
|
||||
public void sendMessage(String message) throws IOException {
|
||||
this.session.getBasicRemote().sendText(message);
|
||||
}
|
||||
|
||||
|
||||
public void sendDataToClient(List<HomeBillCounts> data) {
|
||||
try {
|
||||
if (this.session != null&& data != null && !data.isEmpty()) {
|
||||
this.session.getBasicRemote().sendText(JSON.toJSONString(data));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("发送消息给客户端失败", e);
|
||||
}
|
||||
}
|
||||
public static synchronized int getOnlineCount() {
|
||||
return onlineCount;
|
||||
}
|
||||
|
||||
public static CopyOnWriteArraySet<SendHomeWebSocketServer> getWebSocketSet() {
|
||||
return webSocketSet;
|
||||
}
|
||||
|
||||
|
||||
public void setSession(Session session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.common.mnt.websocket;
|
||||
package org.nl.common.websocket;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.common.mnt.websocket;
|
||||
package org.nl.common.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -81,20 +81,20 @@ public class WebSocketServer {
|
||||
*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("收到来" + sid + "的信息:" + message);
|
||||
// log.info("收到来"+sid+"的信息:"+message);
|
||||
//群发消息
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
item.sendMessage(message);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
//log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OnError
|
||||
public void onError(Session session, Throwable error) {
|
||||
log.error("发生错误");
|
||||
//log.error("发生错误");
|
||||
error.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class WebSocketServer {
|
||||
*/
|
||||
public static void sendInfo(SocketMsg socketMsg, @PathParam("sid") String sid) throws IOException {
|
||||
String message = JSONObject.toJSONString(socketMsg);
|
||||
log.debug("推送消息到" + sid + ",推送内容:" + message);
|
||||
// log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
//这里可以设定只推送给这个sid的,为null则全部推送
|
||||
@@ -14,9 +14,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.enums.NoticeEnum;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.mnt.websocket.MsgType;
|
||||
import org.nl.common.mnt.websocket.SocketMsg;
|
||||
import org.nl.common.mnt.websocket.WebSocketServer;
|
||||
import org.nl.common.websocket.MsgType;
|
||||
import org.nl.common.websocket.SocketMsg;
|
||||
import org.nl.common.websocket.WebSocketServer;
|
||||
import org.nl.common.websocket.SocketMsg;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
|
||||
import org.nl.system.service.notice.ISysNoticeService;
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.base.CommonPage;
|
||||
@@ -57,7 +58,17 @@ public class EasOutInBillController {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.audit(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* APP升级
|
||||
* @return APP升级
|
||||
*/
|
||||
@PostMapping("/appUpdate")
|
||||
@Log("审核")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check(EasOutInBill:edit')")
|
||||
public CommonResult<JSONArray> appUpdate() {
|
||||
return RestBusinessTemplate.execute(() -> easOutInBillService.appUpdate());
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页显示出入库单据数量
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.database.eas.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.Data;
|
||||
import lombok.Builder;
|
||||
@@ -25,7 +26,6 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* eas单据id
|
||||
*/
|
||||
@@ -89,6 +89,16 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
*/
|
||||
private String cjsj;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String bmmc;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String bmbm;
|
||||
|
||||
|
||||
/**
|
||||
* 业务时间
|
||||
@@ -144,7 +154,6 @@ public class EasOutInBill extends Model<EasOutInBill> {
|
||||
private String update_time;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取主键值
|
||||
*
|
||||
|
||||
@@ -48,6 +48,16 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
||||
*/
|
||||
private String djid;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String bmmc;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String bmbm;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
@@ -109,9 +119,6 @@ public class EasOutInBillDetail extends Model<EasOutInBillDetail> {
|
||||
private String cjr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分录序号
|
||||
*/
|
||||
|
||||
@@ -38,4 +38,9 @@ public interface EasOutInBillDetailMapper extends BaseMapper<EasOutInBillDetail>
|
||||
@DS("mysql_srm")
|
||||
List<EasOutInBillDetail> selectSrmPageWithInventory();
|
||||
|
||||
void deleteInfo(@Param("days") String days);
|
||||
|
||||
void deleteDetail(@Param("ids") Set<String> ids);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
FROM
|
||||
MEIAMSYSTEM.V_UC_OUTINBILL
|
||||
WHERE DJZT = '提交' OR DJZT = '保存'
|
||||
WHERE DJZT = '提交'
|
||||
AND TO_DATE(cjsj, 'YYYY-MM-DD') >= TRUNC(SYSDATE) - INTERVAL '2' DAY(3)
|
||||
</select>
|
||||
<select id="selectSrmPageWithInventory" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
@@ -65,15 +65,19 @@
|
||||
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectSrmPage" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
SELECT
|
||||
E.*,
|
||||
I.CURSTOREQTY AS KCSL
|
||||
FROM
|
||||
MEIAMSYSTEM.V_UC_OUTINBILL E
|
||||
LEFT JOIN MEIAMSYSTEM.V_UC_INVENTORYINFO I ON E.CKBM = I.WAREHOUSENO
|
||||
AND E.WLBM = I.MATERIALNO WHERE E.DJZT='保存' ORDER BY ID
|
||||
</select>
|
||||
<delete id="deleteInfo">
|
||||
DELETE FROM eas_out_in_bill WHERE cjsj < #{days}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDetail">
|
||||
DELETE
|
||||
FROM eas_out_in_bill_detail
|
||||
WHERE djid IN
|
||||
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="queryInventoryInfo" resultType="org.nl.wms.database.eas.dao.EasOutInBillDetail">
|
||||
SELECT *
|
||||
FROM V_UC_INVENTORYINFO
|
||||
@@ -97,7 +101,7 @@
|
||||
</select>
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="false">
|
||||
insert into eas_out_in_bill_detail(id,djid, djlx, ywlx, djbh, zzbm, zzmc, btbz, djzt, cjsj, ywrq, cjr, flid, flxh,
|
||||
wlbm, wlmc, ggxh, pc, jldw, jbjldw, fzjldw, sl, jbsl, fzsl, ckbm, ckmc, kwbm, kwmc, flbz, sysl, code, cksj, llr,tjkwbm,tjkwmc,kcsl,djly,trackno,update_id,update_name,update_time,czsl)
|
||||
wlbm, wlmc, ggxh, pc, jldw, jbjldw, fzjldw, sl, jbsl, fzsl, ckbm, ckmc, kwbm, kwmc, flbz, sysl, code, cksj, llr,tjkwbm,tjkwmc,kcsl,djly,trackno,update_id,update_name,update_time,czsl,bmbm,bmmc)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.djid}, #{entity.djlx}, #{entity.ywlx}, #{entity.djbh}, #{entity.zzbm}, #{entity.zzmc},
|
||||
@@ -105,7 +109,7 @@
|
||||
#{entity.flxh}, #{entity.wlbm}, #{entity.wlmc}, #{entity.ggxh}, #{entity.pc}, #{entity.jldw},
|
||||
#{entity.jbjldw}, #{entity.fzjldw}, #{entity.sl}, #{entity.jbsl}, #{entity.fzsl}, #{entity.ckbm},
|
||||
#{entity.ckmc}, #{entity.kwbm}, #{entity.kwmc}, #{entity.flbz}, #{entity.sysl}, #{entity.code},
|
||||
#{entity.cksj}, #{entity.llr}, #{entity.tjkwbm}, #{entity.tjkwmc}, #{entity.kcsl}, #{entity.djly}, #{entity.trackno}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time}, #{entity.czsl})
|
||||
#{entity.cksj}, #{entity.llr}, #{entity.tjkwbm}, #{entity.tjkwmc}, #{entity.kcsl}, #{entity.djly}, #{entity.trackno}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time}, #{entity.czsl}, #{entity.bmbm}, #{entity.bmmc})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
SELECT *
|
||||
FROM MEIAMSYSTEM.V_UC_OUTINBILL
|
||||
WHERE
|
||||
djzt = '保存'
|
||||
djzt = '提交'
|
||||
</select>
|
||||
<select id="queryBillList" resultType="org.nl.wms.database.eas.dto.EasOutInBillDto">
|
||||
SELECT
|
||||
@@ -28,7 +28,7 @@
|
||||
SELECT *
|
||||
FROM MEIAMSYSTEM.V_UC_OUTINBILL
|
||||
WHERE
|
||||
djzt = '保存' OR djzt = '提交'
|
||||
djzt = '提交'
|
||||
</select>
|
||||
|
||||
<select id="queryExistBills" resultType="java.lang.String">
|
||||
@@ -77,12 +77,12 @@
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="false">
|
||||
insert into eas_out_in_bill(id,djid, djbh,djlx, ywlx, zzbm, zzmc, ckmc, ckbm, djzt, cjsj, ywrq, cjr, btbz,
|
||||
cksj, llr,djly,update_id,update_name,update_time)
|
||||
cksj, llr,djly,update_id,update_name,update_time,bmbm,bmmc)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
( #{entity.id},#{entity.djid}, #{entity.djbh},#{entity.djlx}, #{entity.ywlx}, #{entity.zzbm},
|
||||
#{entity.zzmc}, #{entity.ckmc}, #{entity.ckbm}, #{entity.djzt}, #{entity.cjsj}, #{entity.ywrq},
|
||||
#{entity.cjr}, #{entity.btbz}, #{entity.cksj}, #{entity.llr}, #{entity.djly}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time})
|
||||
#{entity.cjr}, #{entity.btbz}, #{entity.cksj}, #{entity.llr}, #{entity.djly}, #{entity.update_id}, #{entity.update_name}, #{entity.update_time}, #{entity.bmbm}, #{entity.bmmc})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.database.eas.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.base.CommonPage;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
@@ -27,13 +28,17 @@ public interface IeasOutInBillService extends IService<EasOutInBill> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* APP升级
|
||||
*/
|
||||
JSONArray appUpdate();
|
||||
|
||||
/**
|
||||
* 首页显示出入库单据数量
|
||||
* @return JSONObject
|
||||
*/
|
||||
List<HomeBillCounts> getBillsCount();
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
|
||||
@@ -23,10 +23,7 @@ import javax.annotation.Resource;
|
||||
import org.nl.common.base.CommonPage;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -56,22 +53,50 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
|
||||
.eq(ObjectUtil.isNotEmpty(params), EasOutInBillDetail::getDjid, params.getDjid())
|
||||
);
|
||||
List<EasOutInBillDetail> easOutInBillDetailList = result.getRecords();
|
||||
//List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
||||
// easOutInBillDetailList.forEach(bill -> {
|
||||
// //查询库存信息
|
||||
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
||||
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
||||
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
|
||||
// && Objects.equals(inventory.getPc(), bill.getPc())
|
||||
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
|
||||
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
||||
// .collect(Collectors.toList());
|
||||
// //将库存数量赋值给单据
|
||||
// if (CollectionUtils.isNotEmpty(matchedInventory)) {
|
||||
// bill.setKcsl(matchedInventory.get(0).getKcsl());
|
||||
// }
|
||||
// });
|
||||
List<InventoryInfo> inventoryInfoList = queryInventoryInfoList(easOutInBillDetailList);
|
||||
easOutInBillDetailList.forEach(bill -> {
|
||||
//查询库存信息
|
||||
List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
.filter(inventory -> {
|
||||
boolean isMatched = true;
|
||||
if (bill.getZzbm() != null && !bill.getZzbm().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getZzbm(), bill.getZzbm());
|
||||
}
|
||||
if (bill.getCkbm() != null && !bill.getCkbm().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getCkbm(), bill.getCkbm());
|
||||
}
|
||||
if (bill.getWlbm() != null && !bill.getWlbm().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getWlbm(), bill.getWlbm());
|
||||
}
|
||||
// 批次
|
||||
if (bill.getPc() != null && !bill.getPc().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getPc(), bill.getPc());
|
||||
}
|
||||
// 跟踪号
|
||||
if (bill.getTrackno() != null && !bill.getTrackno().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getTrackno(), bill.getTrackno());
|
||||
}
|
||||
if (bill.getKwbm() != null && !bill.getKwbm().isEmpty()) {
|
||||
isMatched &= Objects.equals(inventory.getKwbm(), bill.getKwbm());
|
||||
}
|
||||
return isMatched;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
// List<InventoryInfo> matchedInventory = inventoryInfoList.stream()
|
||||
// .filter(inventory -> Objects.equals(inventory.getZzbm(), bill.getZzbm())
|
||||
// && Objects.equals(inventory.getCkbm(), bill.getCkbm())
|
||||
// && Objects.equals(inventory.getWlbm(), bill.getWlbm())
|
||||
// && Objects.equals(inventory.getPc(), bill.getPc())
|
||||
// && Objects.equals(inventory.getTrackno(), bill.getTrackno())
|
||||
// && Objects.equals(inventory.getKwbm(), bill.getKwbm()))
|
||||
// .collect(Collectors.toList());
|
||||
//将库存数量赋值给单据
|
||||
Optional<InventoryInfo> minKcsl = matchedInventory.stream()
|
||||
.min(Comparator.comparing(InventoryInfo::getKcsl));
|
||||
minKcsl.ifPresent(m -> {
|
||||
bill.setKcsl(m.getKcsl());
|
||||
});
|
||||
});
|
||||
result.setRecords(easOutInBillDetailList);
|
||||
return CommonPage.getPage(result);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.database.eas.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -72,6 +73,19 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
return easOutInBillMapper.getBillsCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray appUpdate() {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
JSONObject version= new JSONObject();
|
||||
// 获取静态文件的路径
|
||||
String staticFilePath = Objects.requireNonNull(getClass().getClassLoader().getResource("sq.apk")).getPath();
|
||||
// 构建下载链接
|
||||
String downloadUrl = "http://localhost/download/" + staticFilePath;
|
||||
version.put("url", downloadUrl); // 将下载链接放入JSON对象中
|
||||
version.put("versionName", "1.0.0");
|
||||
jsonArray.add(version);
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
@@ -190,7 +204,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
try {
|
||||
easOutInBillMapper.insert(entity);
|
||||
} catch (Exception e) {
|
||||
log.error("已存在相同单据ID的数据,单据ID为:"+entity.getDjid()+",异常信息:"+e.toString());
|
||||
log.error("已存在相同单据ID的数据,单据ID为:" + entity.getDjid() + ",异常信息:" + e.toString());
|
||||
}
|
||||
}
|
||||
}, pool);
|
||||
@@ -200,7 +214,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
try {
|
||||
easOutInBillDetailMapper.insert(entity);
|
||||
} catch (Exception e) {
|
||||
log.error("已存在相同单据明细ID的数据,单据ID为:"+entity.getDjid()+",异常信息:"+e.toString());
|
||||
log.error("已存在相同单据明细ID的数据,单据ID为:" + entity.getDjid() + ",异常信息:" + e.toString());
|
||||
}
|
||||
}
|
||||
}, pool);
|
||||
@@ -227,7 +241,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
||||
public void audit(Set<String> ids) {
|
||||
if(CollectionUtils.isEmpty(ids)){
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
throw new BadRequestException("id不能为空!");
|
||||
}
|
||||
//所有主表
|
||||
@@ -237,29 +251,29 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
//报文组合
|
||||
if (CollectionUtils.isNotEmpty(easOutInBillList)) {
|
||||
|
||||
easOutInBillList.forEach(b -> {
|
||||
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d ->
|
||||
Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(billDetails)) {
|
||||
b.setInWhUser(SecurityUtils.getCurrentNickName()==null?"admin":SecurityUtils.getCurrentNickName());
|
||||
b.setEntrys(billDetails);
|
||||
}
|
||||
});
|
||||
List<EasOutInBillDto> easBills = easOutInBillList.stream().filter(r -> "1".equals(r.getDjly())).collect(Collectors.toList());
|
||||
List<EasOutInBillDto> srmBills = easOutInBillList.stream().filter(r -> "2".equals(r.getDjly())).collect(Collectors.toList());
|
||||
//eas单据推送
|
||||
if (CollectionUtils.isNotEmpty(easBills)) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncEasAuditBills(easBills);
|
||||
}, pool);
|
||||
}
|
||||
//srm单据推送
|
||||
if (CollectionUtils.isNotEmpty(srmBills)) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncSrmAuditBills(srmBills);
|
||||
}, pool);
|
||||
easOutInBillList.forEach(b -> {
|
||||
List<EasOutInBillDetailDto> billDetails = easOutInBillDetailList.stream().filter(d ->
|
||||
Objects.equals(d.getDjid(), b.getBillId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(billDetails)) {
|
||||
b.setInWhUser(SecurityUtils.getCurrentNickName() == null ? "admin" : SecurityUtils.getCurrentNickName());
|
||||
b.setEntrys(billDetails);
|
||||
}
|
||||
});
|
||||
List<EasOutInBillDto> easBills = easOutInBillList.stream().filter(r -> "1".equals(r.getDjly())).collect(Collectors.toList());
|
||||
List<EasOutInBillDto> srmBills = easOutInBillList.stream().filter(r -> "2".equals(r.getDjly())).collect(Collectors.toList());
|
||||
//eas单据推送
|
||||
if (CollectionUtils.isNotEmpty(easBills)) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncEasAuditBills(easBills);
|
||||
}, pool);
|
||||
}
|
||||
//srm单据推送
|
||||
if (CollectionUtils.isNotEmpty(srmBills)) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
syncSrmAuditBills(srmBills);
|
||||
}, pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -268,7 +282,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
public void syncEasAuditBills(List<EasOutInBillDto> bills) {
|
||||
for (EasOutInBillDto bill : bills) {
|
||||
try {
|
||||
EasData easData =new EasData();
|
||||
EasData easData = new EasData();
|
||||
easData.setData(bill);
|
||||
// String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||
// wmsToEasService.sendWebService(billJson);
|
||||
@@ -301,46 +315,41 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
|
||||
// easOutInBillMapper.update(null, new UpdateWrapper<EasOutInBill>().set("djzt", "提交").in("djid", billIds));
|
||||
// }
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||
public void asyncAuditBill(EasOutInBillDto bill) {
|
||||
try {
|
||||
if(bill.getDjly().equals("1"))
|
||||
{
|
||||
MsgDto msgDto =new MsgDto();
|
||||
EasData easData =new EasData();
|
||||
easData.setData(bill);
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||
msgDto =wmsToEasService.sendWebService(billJson);
|
||||
if(msgDto!=null)
|
||||
{
|
||||
if(msgDto.getResult()==0)
|
||||
{
|
||||
throw new BadRequestException(msgDto.getMsg());
|
||||
}
|
||||
try {
|
||||
if (bill.getDjly().equals("1")) {
|
||||
MsgDto msgDto = new MsgDto();
|
||||
EasData easData = new EasData();
|
||||
easData.setData(bill);
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue);
|
||||
msgDto = wmsToEasService.sendWebService(billJson);
|
||||
if (msgDto != null) {
|
||||
if (msgDto.getResult() == 0) {
|
||||
throw new BadRequestException(msgDto.getMsg());
|
||||
}
|
||||
}else{
|
||||
SrmMsgDto srmMsgDto =new SrmMsgDto();
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
if(srmMsgDto!=null)
|
||||
{
|
||||
if(srmMsgDto.getSuccess().equals("false"))
|
||||
{
|
||||
throw new BadRequestException(srmMsgDto.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
easOutInBillMapper.update(null, new UpdateWrapper<EasOutInBill>().set("djzt", "审核").set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()));
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
throw new BadRequestException(e.toString());
|
||||
} else {
|
||||
SrmMsgDto srmMsgDto = new SrmMsgDto();
|
||||
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
|
||||
srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
||||
if (srmMsgDto != null) {
|
||||
if (srmMsgDto.getSuccess().equals("false")) {
|
||||
throw new BadRequestException(srmMsgDto.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
easOutInBillMapper.update(null, new UpdateWrapper<EasOutInBill>().set("djzt", "审核").set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()));
|
||||
} catch (Exception e) {
|
||||
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
|
||||
throw new BadRequestException(e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
|
||||
@@ -2,15 +2,21 @@ package org.nl.wms.schedule;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.websocket.SendHomeWebSocketServer;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
|
||||
import org.nl.wms.database.eas.dao.HomeBillCounts;
|
||||
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
|
||||
import org.nl.wms.database.eas.service.IeasOutInBillService;
|
||||
import org.nl.wms.ext.eas.WmsToEasService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
@@ -19,7 +25,10 @@ import org.springframework.stereotype.Component;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.nl.wms.database.eas.dao.EasOutInBill;
|
||||
@@ -33,21 +42,18 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
public class EasBillSchedule {
|
||||
|
||||
@Resource
|
||||
private IeasOutInBillService easOutInBillService;
|
||||
|
||||
@Resource
|
||||
private EasOutInBillDetailMapper easOutInBillDetailMapper;
|
||||
|
||||
@Resource
|
||||
private WmsToEasService wmsToEasService;
|
||||
|
||||
|
||||
/**
|
||||
* eas单据数据同步
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
//@Scheduled(cron = "0/120 * * * * *")
|
||||
@Scheduled(cron = "0/30 * * * * *")
|
||||
public void getEasOutInBills() {
|
||||
// 获取eas视图查询未提交的单据
|
||||
List<EasOutInBillDetail> easOutInBillDetails = easOutInBillDetailMapper.selectPageWithInventory();
|
||||
@@ -77,12 +83,13 @@ public class EasBillSchedule {
|
||||
bill.setSl(bill.getSl().abs());
|
||||
}
|
||||
bill.setId(IdUtil.getStringId());
|
||||
bill.setDjzt("保存");
|
||||
bill.setDjzt("提交");
|
||||
bill.setDjly("2");
|
||||
bill.setCode(IdUtil.getStringId());
|
||||
bill.setSysl(bill.getSl());
|
||||
bill.setCzsl(BigDecimal.ZERO);
|
||||
bill.setKcsl(BigDecimal.ZERO);})
|
||||
bill.setKcsl(BigDecimal.ZERO);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
insertEasBills.addAll(insertSrmBills);
|
||||
}
|
||||
@@ -91,40 +98,42 @@ public class EasBillSchedule {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页信息推送
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
// @Scheduled(cron = "0/20 * * * * *")
|
||||
//@PostConstruct
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertNewWorkOrders() {
|
||||
log.error("开始调用webService接口:-----------------------*************");
|
||||
// 创建 entrys 中的第一条数据
|
||||
JSONObject entry1 = new JSONObject();
|
||||
entry1.put("seq", "1");
|
||||
entry1.put("entryId", "09fcf1b66ccc4a42bb45dd890274e60c");
|
||||
entry1.put("qty", "1200");
|
||||
entry1.put("warehouseNo", "C0154");
|
||||
entry1.put("locationNo", "A01.01");
|
||||
entry1.put("unitNo", "PCS");
|
||||
entry1.put("remark", "分录摘要");
|
||||
// 创建 entrys 列表
|
||||
JSONArray entrys = new JSONArray();
|
||||
entrys.add(entry1);
|
||||
// 创建 data 数据
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("billId", "2ZN2Zm4qTheGPDQDi8weqVAKt14=");
|
||||
data.put("billNo", "NLRK230900300");
|
||||
data.put("bizDate", "2024-03-24");
|
||||
data.put("billType", "CGRKD");
|
||||
data.put("description", "摘要");
|
||||
data.put("entrys", entrys);
|
||||
// 创建整个数据结构
|
||||
JSONObject jsonData = new JSONObject();
|
||||
jsonData.put("type", "WMS");
|
||||
jsonData.put("method", "DealOutInBill");
|
||||
jsonData.put("data", data);
|
||||
//wmsToEasService.sendWebService(jsonData.toJSONString());
|
||||
log.error("结束调用webService接口:-----------------------*************");
|
||||
@Scheduled(cron = "0/15 * * * * *")
|
||||
public void sendHomeInfoTask() {
|
||||
//StopWatch stopWatch = new StopWatch();
|
||||
//stopWatch.start();
|
||||
CopyOnWriteArraySet<SendHomeWebSocketServer> webSocketSet =
|
||||
SendHomeWebSocketServer.getWebSocketSet();
|
||||
if (webSocketSet.size() > 0) {
|
||||
webSocketSet.forEach(c -> {
|
||||
c.sendDataToClient(easOutInBillService.getBillsCount());
|
||||
});
|
||||
}
|
||||
//stopWatch.stop();
|
||||
//System.out.println("1task-首页及头部信息推送-sendHomeInfoTask-花费时间----------------------------------------------------------------****************************************************************= totalTime = " + stopWatch.getTotalTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时清空单据
|
||||
*/
|
||||
@Async("taskExecutor")
|
||||
@Scheduled(cron = "0/86400 * * * * *")
|
||||
public void autoDeleteTask() {
|
||||
LocalDate threeMonthsAgo = LocalDate.now().minusMonths(3);
|
||||
String days = threeMonthsAgo.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
//查询三个月前的数据
|
||||
LambdaQueryWrapper<EasOutInBill> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.lt(EasOutInBill::getCjsj, days);
|
||||
List<EasOutInBill> oldBills = easOutInBillService.list(queryWrapper);
|
||||
Set<String> ids = oldBills.stream().map(EasOutInBill::getDjid).collect(Collectors.toSet());
|
||||
easOutInBillDetailMapper.deleteInfo(days);
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
easOutInBillDetailMapper.deleteDetail(ids);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8011
|
||||
port: 8012
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
@@ -10,35 +10,22 @@ spring:
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
username: ${DB_USER:generallu}
|
||||
password: ${DB_PWD:123456}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.10.188.30}:${DB_PORT:3306}/${DB_NAME:nuoli_v1.0}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:wms_third}
|
||||
password: ${DB_PWD:NOBLElift@!#wms}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.10.188.30}:${DB_PORT:3306}/${DB_NAME:nuoli_v1.0}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:wms_third}
|
||||
# password: ${DB_PWD:NOBLElift@!#wms}
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
oracle_eas:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@localhost:1521:orcl
|
||||
username: ${DB_USER:user1}
|
||||
password: ${DB_PWD:Noble12319}
|
||||
url: jdbc:oracle:thin:@192.168.100.97:1521:orcl
|
||||
username: ${DB_USER:stuser}
|
||||
password: ${DB_PWD:stuser123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.100.97:1521:orcl
|
||||
# username: ${DB_USER:stuser}
|
||||
# password: ${DB_PWD:stuser123}
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
sqlserver:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://10.93.41.2\WINCC;DatabaseName=马钢_RH
|
||||
|
||||
153
nlsso-server/src/main/resources/config/application-devLocal.yml
Normal file
153
nlsso-server/src/main/resources/config/application-devLocal.yml
Normal file
@@ -0,0 +1,153 @@
|
||||
server:
|
||||
port: 8012
|
||||
#配置数据源
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: mysql
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:generallu}
|
||||
password: ${DB_PWD:123456}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:wms_third}
|
||||
password: ${DB_PWD:NOBLElift@!#wms}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
oracle_eas:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@localhost:1521:orcl
|
||||
username: ${DB_USER:user1}
|
||||
password: ${DB_PWD:Noble12319}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
sqlserver:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://10.93.41.2\WINCC;DatabaseName=马钢_RH
|
||||
username: ${DB_USER:sa}
|
||||
password: ${DB_PWD:123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
redis:
|
||||
#数据库索引
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
database: 3
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
#是否开启 swagger-ui
|
||||
swagger:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
path: ~/file/
|
||||
avatar: ~/avatar/
|
||||
linux:
|
||||
path: /home/eladmin/file/
|
||||
avatar: /home/eladmin/avatar/
|
||||
windows:
|
||||
path: C:\eladmin\file\
|
||||
avatar: C:\eladmin\avatar\
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix: Bearer
|
||||
sso:
|
||||
# Ticket有效期 (单位: 秒),默认五分钟
|
||||
ticket-timeout: 300
|
||||
# 所有允许的授权回调地址
|
||||
allow-url: "*"
|
||||
# 是否打开单点注销功能
|
||||
is-slo: true
|
||||
# ------- SSO-模式三相关配置 (下面的配置在SSO模式三并且 is-slo=true 时打开)
|
||||
# 是否打开模式三
|
||||
isHttp: true
|
||||
# 接口调用秘钥(用于SSO模式三的单点注销功能)
|
||||
secretkey: kQwIOrYvnXmSDkwEiFngrKidMcdrgKor
|
||||
# ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器(文档有步骤说明)
|
||||
is-read-cookie: true
|
||||
is-print: false
|
||||
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
|
||||
token-session-check-login: false
|
||||
alone-redis:
|
||||
# Redis数据库索引(默认为0)
|
||||
database: 1
|
||||
# Redis服务器地址
|
||||
host: 127.0.0.1
|
||||
# Redis服务器连接端口
|
||||
port: 6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
@@ -10,22 +10,24 @@ spring:
|
||||
datasource:
|
||||
mysql:
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.93.41.198}:${DB_PORT:3306}/${DB_NAME:rl_mg_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:123456}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
mysql_srm:
|
||||
# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:nl_sq_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# username: ${DB_USER:wms_third}
|
||||
# password: ${DB_PWD:NOBLElift@!#wms}
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.10.188.30}:${DB_PORT:3306}/${DB_NAME:nuoli_v1.0}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:10.10.188.32}:${DB_PORT:3306}/${DB_NAME:nuoli_v1.0}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:wms_third}
|
||||
password: ${DB_PWD:NOBLElift@!#wms}
|
||||
password: ${DB_PWD:NOBLElift@#wms}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
oracle_eas:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@192.168.100.97:1521:orcl
|
||||
url: jdbc:oracle:thin:@192.168.100.98:1521:orcl
|
||||
username: ${DB_USER:stuser}
|
||||
password: ${DB_PWD:stuser123}
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
|
||||
@@ -3,6 +3,8 @@ server:
|
||||
relaxed-query-chars: [ '|','{','}','[',']' ] #字符问题:https://blog.csdn.net/CanYue_Yi/article/details/109182577
|
||||
relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118
|
||||
spring:
|
||||
profiles:
|
||||
active: devLocal
|
||||
datasource:
|
||||
druid:
|
||||
initial-size: 5 #初始化时建立物理连接的个数
|
||||
@@ -45,8 +47,6 @@ spring:
|
||||
login-password: admin
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
@@ -191,12 +191,25 @@ jetcache:
|
||||
maxTotal: 50 # 连接池中的最大连接数
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
#easConfig:
|
||||
# host: http://192.168.100.9:6896/ormrpc/services/
|
||||
# user: mes_eas2
|
||||
# password: eas@123456
|
||||
# datacenter: orcl
|
||||
# wsdlService: WSNLMESFacade
|
||||
# operationName: dealTask
|
||||
# dataType: MEIAMSYSTEM
|
||||
# deleteTask: 86400000
|
||||
#srmConfig:
|
||||
# host: http://10.10.188.31:8080/nuoli-srm/wmsBaseApi/receiveWmsInWhOrderAck
|
||||
easConfig:
|
||||
host: http://192.168.100.100:8080/ormrpc/services/
|
||||
host: http://192.168.100.100:8080//ormrpc/services/
|
||||
user: user
|
||||
password: Noble123!9
|
||||
datacenter: test
|
||||
wsdlService: WSNLMESFacade
|
||||
operationName: dealTask
|
||||
syncInfo: 30000
|
||||
deleteInfo: 30000
|
||||
srmConfig:
|
||||
host: http://10.10.188.30:8080/nuoli-srm/wmsBaseApi/receiveWmsInWhOrderAck
|
||||
|
||||
@@ -68,6 +68,93 @@ https://juejin.cn/post/6844903775631572999
|
||||
<queueSize>500</queueSize>
|
||||
<appender-ref ref="FILE"/>
|
||||
</appender>
|
||||
<springProfile name="devLocal">
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc.audit" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.baomidou.mybatisplus.core.MybatisConfiguration" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.redisson.command.RedisExecutor" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.reflections.Reflections" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.redisson.connection.ClientConnectionsEntry" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.mybatis.spring.mapper.ClassPathMapperScanner" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.baomidou.dynamic.datasource.DynamicRoutingDataSource" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.redisson.connection.pool.MasterPubSubConnectionPool" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.redisson.connection.pool.MasterConnectionPool" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.redisson.Version" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="com.alibaba.druid.pool.DruidDataSource" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.nl.config.RedisConfig" level="INFO" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.apache" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="io.netty" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="io.lettuce" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="com.fasterxml" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="org.quartz" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="com.google" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="springfox" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="log4jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
<logger name="nl.basjes" level="ERROR" additivity="true">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="DEBUG">
|
||||
|
||||
Reference in New Issue
Block a user