发布一个k8s部署视频:https://edu.csdn.net/course/detail/26967
课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。
腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518
第二个视频发布 https://edu.csdn.net/course/detail/27109
腾讯课堂连接地址https://ke.qq.com/course/484107?tuin=ba64518
介绍主要的k8s资源的使用配置和命令。包括configmap,pod,service,replicaset,namespace,deployment,daemonset,ingress,pv,pvc,sc,role,rolebinding,clusterrole,clusterrolebinding,secret,serviceaccount,statefulset,job,cronjob,podDisruptionbudget,podSecurityPolicy,networkPolicy,resourceQuota,limitrange,endpoint,event,conponentstatus,node,apiservice,controllerRevision等。
第三个视频发布:https://edu.csdn.net/course/detail/27574
详细介绍helm命令,学习helm chart语法,编写helm chart。深入分析各项目源码,学习编写helm插件
————————————————------------------------------------------------------------------------------------------------------------------
execute command denied to user 'test_update'@'%' for routine 'who_wms.exist'. Stacktrace follows:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: execute command denied to user 'test_update'@'%' for routine 'who_wms.exist'
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2683)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2144)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2310)
at grails.orm.PagedResultList.<init>(PagedResultList.java:43)
at grails.orm.HibernateCriteriaBuilder.createPagedResultList(HibernateCriteriaBuilder.java:163)
at com.zy.wms.salse.OrderInfo$$EQKX6pt7.search(OrderInfo.groovy:68)
at com.zy.wms.warehouse.OrderPickingController.readyToPickingOrderListData(OrderPickingController.groovy:49)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
if (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1")) {
outingAreaSql += "AND osd.depot_area_id IN(${params.qDepotAreas}) ";
outingAreaSqlGoodAllIn=" and not exist (( select depot_area_id from who_wms_outing_stock_detail osd where order_id = osd.order_id) not IN (${params.qDepotAreas}))"
}
sqlRestriction("order_id IN (SELECT DISTINCT(osd.order_id) FROM who_wms_outing_stock_detail osd" +
" WHERE osd.status = 1 ${outingDateSql} ${outingAreaSql} ) and order_id IN (SELECT DISTINCT(osd.order_id) FROM who_wms_outing_stock_detail osd " +
" WHERE osd.status = 1 ${outingAreaSqlGoodAllIn} ) ")
正解exists,不过sql还是有错误
if (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1")) {
outingAreaSqlGoodAllIn=" and not exists (select depot_area_id from who_wms_outing_stock_detail osd where order_id = osd.order_id and depot_area_id not IN (${params.qDepotAreas}))"
}
sqlRestriction(" order_id IN (SELECT DISTINCT(osd.order_id) FROM who_wms_outing_stock_detail osd " +
" WHERE osd.status = 1 ${outingDateSql} ${outingAreaSqlGoodAllIn} ) ")
没错了,但是查出来数据不正确
/**
* count拣货订单列表
* @param params
* @return
*/
public Long countReadyToPickingOrder(Map<String, Object> params){
String sqlStr="""
select
count(*) as count
from
who_wms_order_info oi
where
oi.depot_id in
"""
List depotIds=params.depotIds ? params.depotIds : [-1L]
String depotIdsStr="(";
for(int i=0;i<depotIds.size();i++){
depotIdsStr+=depotIds[i]+","
}
if(depotIdsStr.length()>1){
depotIdsStr=depotIdsStr.substring(0,depotIdsStr.length()-1)
}
depotIdsStr+=")"
sqlStr+= depotIdsStr
if (params.qStartDate) {
sqlStr+=" and oi.pay_time>="+DateUtils.getSecondFromDateString(params.qStartDate as String, "MM/dd/yyyy")
}
if (params.qEndDate) {
sqlStr+=" and oi.pay_time<"+ (DateUtils.getSecondFromDateString(params.qEndDate as String, "MM/dd/yyyy") + 86400)
}
if (params.qOrderGoodsNum) {
if (params.qOrderGoodsNum == '1') {
sqlStr+=" and oi.goods_num=1"
} else if (params.qOrderGoodsNum == '3') {
sqlStr+=" and oi.goods_num>0"
} else {
sqlStr+=" and oi.goods_num>1"
}
}
if (params.qOrderInfoType == '1' && params.qOrderInfoTypeText) {
sqlStr+=" and oi.order_sn like "+"%" + params.qOrderInfoTypeText + "%"
}
//根据库区查询
if (params.qOutingStartDate || params.qOutingEndDate || (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1"))) {
String outingDateSql = ""
if (params.qOutingStartDate) {
outingDateSql += " AND gmt_created >= " + DateUtils.getSecondFromDateString(params.qOutingStartDate as String, "MM/dd/yyyy")
}
if (params.qOutingEndDate) {
String endTime = params.qOutingEndDate + " 23:59:59";
outingDateSql += " AND gmt_created <= " + DateUtils.getSecondFromDateString(endTime, "MM/dd/yyyy HH:mm:ss")
}
String outingAreaSqlGoodAllIn = ""
if (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1")) {
outingAreaSqlGoodAllIn=" and not exists (select osd.depot_area_id from who_wms_outing_stock_detail osd where oi.order_id = osd.order_id and osd.depot_area_id not IN (${params.qDepotAreas}))"
}
String subQueryStr="""
and oi.order_id IN (
SELECT
DISTINCT(osd.order_id)
FROM
who_wms_outing_stock_detail osd
WHERE
osd.status = 1
${outingDateSql} ${outingAreaSqlGoodAllIn}
)
"""
sqlStr+=subQueryStr
}
if (params.qIsShiped) {
if (params.qIsShiped == '10') {
sqlStr+=" and oi.order_status="+ ConstantValue.ORDER_STATUS_RETURN
} else {
sqlStr+=" and oi.is_shiped="+ ( params.qIsShiped as Integer)
sqlStr+=" and oi.order_status="+ ConstantValue.ORDER_STATUS_CONFIRM
}
}
if (params.qIsProblemOrder) {
sqlStr+=" and oi.is_problems_order="+ ConstantValue.STATUS_NON_PROBLEM_ORDER
}
//过滤已标记缺货未处理的订单
if (params.qOosOrder == 1) {
Set set = new HashSet()
OrderGoods.findAllByOosNumGreaterThanEquals(1).each {
set.add(it.orderInfoId)
}
if (set.size() > 0) {
Iterator it=set.iterator();
String idsStr=" and oi.order_id not in("
while(it.hasNext()){
Long id=it.next() as Long
idsStr+=id+","
}
idsStr=idsStr.substring(0,idsStr.length()-1)
idsStr+=")"
sqlStr+=idsStr
}
}
if (params.depotId) {
sqlStr+=" and oi.depot_id="+(params.depotId as Long)
}
if (params.qCod) {
if (params.qCod == "1") {
sqlStr+=" and oi.pay_name='COD'"
} else if (params.qCod == "2") {
//平台订单
//eq('orderSourceType', 4)
} else {
sqlStr+=" and oi.pay_name='COD'"
//ne('orderSourceType', 4)
}
}
Sql sql = new Sql(DataSourceUtils.dataSource)
def count=sql.firstRow(sqlStr)
sql.close()
return count.getProperty("count") as Long
}
/**
*拣货订单列表查询
* @param params
* @return
*/
public List<OrderInfo> searchReadyToPickingOrder(Map<String, Object> params){
String sqlStr="""
select
oi.order_id ,
oi.add_time ,
oi.cod_shipping_price ,
oi.currency ,
oi.depot_id ,
oi.goods_num ,
oi.invoice_no,
oi.is_has_contraband ,
oi.is_problems_order ,
oi.is_return_processing ,
oi.is_shiped ,
oi.language_site,
oi.last_update,
oi.order_amount,
oi.order_pack_admin_id,
oi.order_pack_time,
oi.order_sn,
oi.order_status,
oi.pay_id,
oi.pay_name,
oi.pay_status||'' as pay_status,
oi.pay_time,
oi.picking_wall_status,
oi.prepare_pay_time,
oi.problems_order_uptime,
oi.rate,
oi.real_shipping_fee,
oi.real_shipping_id,
oi.real_shipping_name,
oi.remark,
oi.shipping_id,
oi.shipping_name,
oi.shipping_status||"" as shipping_status,
oi.shipping_time,
oi.user_id
from
who_wms_order_info oi
where
oi.depot_id in
"""
List depotIds=params.depotIds ? params.depotIds : [-1L]
String depotIdsStr="(";
for(int i=0;i<depotIds.size();i++){
depotIdsStr+=depotIds[i]+","
}
if(depotIdsStr.length()>1){
depotIdsStr=depotIdsStr.substring(0,depotIdsStr.length()-1)
}
depotIdsStr+=")"
sqlStr+= depotIdsStr
if (params.qStartDate) {
sqlStr+=" and oi.pay_time>="+DateUtils.getSecondFromDateString(params.qStartDate as String, "MM/dd/yyyy")
}
if (params.qEndDate) {
sqlStr+=" and oi.pay_time<"+ (DateUtils.getSecondFromDateString(params.qEndDate as String, "MM/dd/yyyy") + 86400)
}
if (params.qOrderGoodsNum) {
if (params.qOrderGoodsNum == '1') {
sqlStr+=" and oi.goods_num=1"
} else if (params.qOrderGoodsNum == '3') {
sqlStr+=" and oi.goods_num>0"
} else {
sqlStr+=" and oi.goods_num>1"
}
}
if (params.qOrderInfoType == '1' && params.qOrderInfoTypeText) {
sqlStr+=" and oi.order_sn like "+"%" + params.qOrderInfoTypeText + "%"
}
//根据库区查询
if (params.qOutingStartDate || params.qOutingEndDate || (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1"))) {
String outingDateSql = ""
if (params.qOutingStartDate) {
outingDateSql += " AND gmt_created >= " + DateUtils.getSecondFromDateString(params.qOutingStartDate as String, "MM/dd/yyyy")
}
if (params.qOutingEndDate) {
String endTime = params.qOutingEndDate + " 23:59:59";
outingDateSql += " AND gmt_created <= " + DateUtils.getSecondFromDateString(endTime, "MM/dd/yyyy HH:mm:ss")
}
String outingAreaSqlGoodAllIn = ""
if (params.qDepotAreas && !params.qDepotAreas.toString().contains("-1")) {
outingAreaSqlGoodAllIn=" and not exists (select osd.depot_area_id from who_wms_outing_stock_detail osd where oi.order_id = osd.order_id and osd.depot_area_id not IN (${params.qDepotAreas}))"
}
String subQueryStr="""
and oi.order_id IN (
SELECT
DISTINCT(osd.order_id)
FROM
who_wms_outing_stock_detail osd
WHERE
osd.status = 1
${outingDateSql} ${outingAreaSqlGoodAllIn}
)
"""
sqlStr+=subQueryStr
}
if (params.qIsShiped) {
if (params.qIsShiped == '10') {
sqlStr+=" and oi.order_status="+ ConstantValue.ORDER_STATUS_RETURN
} else {
sqlStr+=" and oi.is_shiped="+ ( params.qIsShiped as Integer)
sqlStr+=" and oi.order_status="+ ConstantValue.ORDER_STATUS_CONFIRM
}
}
if (params.qIsProblemOrder) {
sqlStr+=" and oi.is_problems_order="+ ConstantValue.STATUS_NON_PROBLEM_ORDER
}
//过滤已标记缺货未处理的订单
if (params.qOosOrder == 1) {
Set set = new HashSet()
OrderGoods.findAllByOosNumGreaterThanEquals(1).each {
set.add(it.orderInfoId)
}
if (set.size() > 0) {
Iterator it=set.iterator();
String idsStr=" and oi.order_id not in("
while(it.hasNext()){
Long id=it.next() as Long
idsStr+=id+","
}
idsStr=idsStr.substring(0,idsStr.length()-1)
idsStr+=")"
sqlStr+=idsStr
}
}
if (params.depotId) {
sqlStr+=" and oi.depot_id="+(params.depotId as Long)
}
if (params.qCod) {
if (params.qCod == "1") {
sqlStr+=" and oi.pay_name='COD'"
} else if (params.qCod == "2") {
//平台订单
//eq('orderSourceType', 4)
} else {
sqlStr+=" and oi.pay_name='COD'"
//ne('orderSourceType', 4)
}
}
sqlStr+=" order by oi.prepare_pay_time asc "
sqlStr+=" limit ${params.offset},${params.max}"
Sql sql = new Sql(DataSourceUtils.dataSource)
List<GroovyRowResult> rowResultList = sql.rows(sqlStr)
sql.close()
LinkedList<OrderInfo> resultList = new LinkedList<>()
if (rowResultList != null && rowResultList.size() != 0) {
rowResultList.each {
OrderInfo info=new OrderInfo()
info.id=it.getProperty("order_id") as Long
info.addTime=it.getProperty("add_time") as Long
info.codShippingPrice=it.getProperty("cod_shipping_price") as Double
info.currency=it.getProperty("currency") as String
info.depotId=it.getProperty("depot_id") as Long
info.goodsNum=it.getProperty("goods_num") as Long
info.invoiceNo=it.getProperty("invoice_no") as String
info.isHasContraband=it.getProperty("is_has_contraband") as Integer
info.isProblemsOrder=it.getProperty("is_problems_order") as Integer
info.isReturnProcessing=it.getProperty("is_return_processing") as Integer
info.isShiped=it.getProperty("is_shiped") as Integer
info.languageSite=it.getProperty("language_site") as Integer
info.lastUpdate=it.getProperty("last_update") as Long
info.orderAmount=it.getProperty("order_amount") as Double
info.orderPackAdminId=it.getProperty("order_pack_admin_id") as Long
info.orderSn=it.getProperty("order_sn") as String
info.payId=it.getProperty("pay_id") as Long
info.payName=it.getProperty("pay_name") as String
info.payStatus=it.getProperty("pay_status") as Integer
info.payTime=it.getProperty("pay_time") as Long
info.pickingWallStatus=it.getProperty("picking_wall_status") as Integer
info.preparePayTime=it.getProperty("prepare_pay_time") as Long
info.problemsOrderUptime=it.getProperty("problems_order_uptime") as Long
info.rate=it.getProperty("rate") as Double
info.realShippingFee=it.getProperty("real_shipping_fee") as Double
info.realShippingId=it.getProperty("real_shipping_id") as Long
info.realShippingName=it.getProperty("real_shipping_name") as String
info.remark=it.getProperty("remark") as String
info.shippingId=it.getProperty("shipping_id") as Long
info.shippingName=it.getProperty("shipping_name") as String
info.shippingStatus=it.getProperty("shipping_status") as Integer
info.shippingTime=it.getProperty("shipping_time") as Long
info.userId=it.getProperty("user_id") as Long
resultList.add(info)
}
}
return resultList
}
改进后采用手写sql方式,查询数据正确