Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-java
Commits
a40368a1
Commit
a40368a1
authored
Jul 16, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单部分SKU仓库按自定义规则计算头程费; 新增一些工具类, 可以推送消息到企业微信
parent
8f3432a9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
363 additions
and
2 deletions
+363
-2
OrderSyncJob.java
...s-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
+0
-0
DcBaseOmsConfigCostFirstMapper.java
.../com/bailuntec/mapper/DcBaseOmsConfigCostFirstMapper.java
+125
-0
DcBaseOmsConfigCostFirstMapper.xml
...a/com/bailuntec/mapper/DcBaseOmsConfigCostFirstMapper.xml
+0
-0
pom.xml
data-common/pom.xml
+5
-0
DcBaseOmsConfigCostFirst.java
...com/bailuntec/domain/entity/DcBaseOmsConfigCostFirst.java
+118
-0
DcBaseOmsConfigCostFirstExample.java
...untec/domain/example/DcBaseOmsConfigCostFirstExample.java
+0
-0
ExceptionUtil.java
...mmon/src/main/java/com/bailuntec/utils/ExceptionUtil.java
+25
-0
RedisUtil.java
data-common/src/main/java/com/bailuntec/utils/RedisUtil.java
+29
-0
RobotWorkWeixin.java
...on/src/main/java/com/bailuntec/utils/RobotWorkWeixin.java
+46
-0
mybatis-config.xml
data-common/src/main/resources/mybatis-config.xml
+2
-2
redis.properties
data-common/src/main/resources/redis.properties
+4
-0
pom.xml
data-parent/pom.xml
+9
-0
No files found.
data-base/base-sync-oms-order/src/main/java/com/bailuntec/job/OrderSyncJob.java
View file @
a40368a1
This diff is collapsed.
Click to expand it.
data-base/base-sync-oms-order/src/main/java/com/bailuntec/mapper/DcBaseOmsConfigCostFirstMapper.java
0 → 100644
View file @
a40368a1
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.entity.DcBaseOmsConfigCostFirst
;
import
com.bailuntec.domain.example.DcBaseOmsConfigCostFirstExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
DcBaseOmsConfigCostFirstMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
long
countByExample
(
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
deleteByExample
(
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
insert
(
DcBaseOmsConfigCostFirst
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
insertSelective
(
DcBaseOmsConfigCostFirst
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseOmsConfigCostFirst
selectOneByExample
(
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
List
<
DcBaseOmsConfigCostFirst
>
selectByExample
(
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
DcBaseOmsConfigCostFirst
selectByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
DcBaseOmsConfigCostFirst
record
,
@Param
(
"example"
)
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
DcBaseOmsConfigCostFirst
record
,
@Param
(
"example"
)
DcBaseOmsConfigCostFirstExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
DcBaseOmsConfigCostFirst
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
DcBaseOmsConfigCostFirst
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsert
(
DcBaseOmsConfigCostFirst
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcBaseOmsConfigCostFirst
record
);
}
\ No newline at end of file
data-base/base-sync-oms-order/src/main/java/com/bailuntec/mapper/DcBaseOmsConfigCostFirstMapper.xml
0 → 100644
View file @
a40368a1
This diff is collapsed.
Click to expand it.
data-common/pom.xml
View file @
a40368a1
...
@@ -14,6 +14,11 @@
...
@@ -14,6 +14,11 @@
<dependencies>
<dependencies>
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
...
...
data-common/src/main/java/com/bailuntec/domain/entity/DcBaseOmsConfigCostFirst.java
0 → 100644
View file @
a40368a1
package
com
.
bailuntec
.
domain
.
entity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
DcBaseOmsConfigCostFirst
{
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_config_cost_first.id
*
* @mbg.generated
*/
private
Integer
id
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_config_cost_first.bailun_sku
*
* @mbg.generated
*/
private
String
bailunSku
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_config_cost_first.warehouse_code
*
* @mbg.generated
*/
private
String
warehouseCode
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_config_cost_first.price
*
* @mbg.generated
*/
private
BigDecimal
price
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_oms_config_cost_first.company_id
*
* @mbg.generated
*/
private
Integer
companyId
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", bailunSku="
).
append
(
bailunSku
);
sb
.
append
(
", warehouseCode="
).
append
(
warehouseCode
);
sb
.
append
(
", price="
).
append
(
price
);
sb
.
append
(
", companyId="
).
append
(
companyId
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
DcBaseOmsConfigCostFirst
other
=
(
DcBaseOmsConfigCostFirst
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getBailunSku
()
==
null
?
other
.
getBailunSku
()
==
null
:
this
.
getBailunSku
().
equals
(
other
.
getBailunSku
()))
&&
(
this
.
getWarehouseCode
()
==
null
?
other
.
getWarehouseCode
()
==
null
:
this
.
getWarehouseCode
().
equals
(
other
.
getWarehouseCode
()))
&&
(
this
.
getPrice
()
==
null
?
other
.
getPrice
()
==
null
:
this
.
getPrice
().
equals
(
other
.
getPrice
()))
&&
(
this
.
getCompanyId
()
==
null
?
other
.
getCompanyId
()
==
null
:
this
.
getCompanyId
().
equals
(
other
.
getCompanyId
()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_oms_config_cost_first
*
* @mbg.generated
*/
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getBailunSku
()
==
null
)
?
0
:
getBailunSku
().
hashCode
());
result
=
prime
*
result
+
((
getWarehouseCode
()
==
null
)
?
0
:
getWarehouseCode
().
hashCode
());
result
=
prime
*
result
+
((
getPrice
()
==
null
)
?
0
:
getPrice
().
hashCode
());
result
=
prime
*
result
+
((
getCompanyId
()
==
null
)
?
0
:
getCompanyId
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcBaseOmsConfigCostFirstExample.java
0 → 100644
View file @
a40368a1
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/utils/ExceptionUtil.java
0 → 100644
View file @
a40368a1
package
com
.
bailuntec
.
utils
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
public
class
ExceptionUtil
{
/**
* 将Throwable异常转换为字符串.
*
* @param cause 需要转换的异常
* @return 转换后的异常字符串
*/
public
static
String
transform
(
final
Throwable
cause
)
{
if
(
null
==
cause
)
{
return
""
;
}
StringWriter
result
=
new
StringWriter
();
try
(
PrintWriter
writer
=
new
PrintWriter
(
result
))
{
cause
.
printStackTrace
(
writer
);
}
return
result
.
toString
();
}
}
data-common/src/main/java/com/bailuntec/utils/RedisUtil.java
0 → 100644
View file @
a40368a1
package
com
.
bailuntec
.
utils
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.JedisPool
;
public
class
RedisUtil
{
private
final
static
PropertiesUtil
propertiesUtil
=
PropertiesUtil
.
getInstance
(
"redis"
);
private
static
JedisPool
jedisPool
;
private
RedisUtil
()
{
}
public
static
Jedis
getResource
()
{
synchronized
(
RedisUtil
.
class
)
{
if
(
jedisPool
==
null
)
{
jedisPool
=
new
JedisPool
(
propertiesUtil
.
getPropertyAsString
(
"host"
),
propertiesUtil
.
getPropertyAsInt
(
"port"
));
}
return
jedisPool
.
getResource
();
}
}
public
static
void
destory
()
{
synchronized
(
RedisUtil
.
class
)
{
if
(
jedisPool
!=
null
)
{
jedisPool
.
destroy
();
}
}
}
}
data-common/src/main/java/com/bailuntec/utils/RobotWorkWeixin.java
0 → 100644
View file @
a40368a1
package
com
.
bailuntec
.
utils
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.*
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.JedisPool
;
import
redis.clients.jedis.params.SetParams
;
import
java.io.IOException
;
@Slf4j
public
final
class
RobotWorkWeixin
{
private
final
static
OkHttpClient
client
=
OkHttpUtil
.
getInstance
();
/**
* 推送消息到企业微信机器人
* 如果计算的Key值在Redis存在, 则一天内不会重复推送
* @param webhook 微信回调地址
* @param content 异常内容
*/
public
static
void
push
(
final
String
webhook
,
final
String
content
)
{
Jedis
jedis
=
RedisUtil
.
getResource
();
String
contentSub
=
content
.
length
()
>
2000
?
content
.
substring
(
0
,
2000
):
content
;
String
key
=
DigestUtils
.
md5DigestAsHex
((
webhook
+
contentSub
).
getBytes
());
if
(!
jedis
.
exists
(
key
))
{
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"msgtype\": \"text\",\"text\": {\"content\": \""
+
contentSub
+
"\"}}"
);
Request
request
=
new
Request
.
Builder
()
.
url
(
webhook
)
.
post
(
body
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
Response
response
=
null
;
try
{
response
=
client
.
newCall
(
request
).
execute
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"回调企业微信机器人失败"
,
e
);
}
finally
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
jedis
.
setex
(
key
,
86400
,
contentSub
);
}
jedis
.
close
();
}
}
data-common/src/main/resources/mybatis-config.xml
View file @
a40368a1
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
"http://mybatis.org/dtd/mybatis-3-config.dtd">
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<configuration>
<!--<properties resource="db-tj.properties"/>-->
<!--<properties resource="db-tj.properties"/>-->
<!-- <properties resource="db-dev.properties"/>--
>
<properties
resource=
"db-dev.properties"
/
>
<properties
resource=
"db-prod.properties"
/
>
<!-- <properties resource="db-prod.properties"/>--
>
<settings>
<settings>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/>
</settings>
</settings>
...
...
data-common/src/main/resources/redis.properties
0 → 100644
View file @
a40368a1
#host=127.0.0.1
host
=
redis.blt.com
port
=
6379
\ No newline at end of file
data-parent/pom.xml
View file @
a40368a1
...
@@ -45,12 +45,21 @@
...
@@ -45,12 +45,21 @@
<elastic-job-lite-core.version>
2.1.5
</elastic-job-lite-core.version>
<elastic-job-lite-core.version>
2.1.5
</elastic-job-lite-core.version>
<druid.version>
1.1.12
</druid.version>
<druid.version>
1.1.12
</druid.version>
<docker-maven-plugin.version>
1.2.0
</docker-maven-plugin.version>
<docker-maven-plugin.version>
1.2.0
</docker-maven-plugin.version>
<jedis.version>
3.0.1
</jedis.version>
<skipDockerBuild>
true
</skipDockerBuild>
<skipDockerBuild>
true
</skipDockerBuild>
</properties>
</properties>
<dependencyManagement>
<dependencyManagement>
<dependencies>
<!--这下面进行依赖管理 -->
<dependencies>
<!--这下面进行依赖管理 -->
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
<version>
${jedis.version}
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<groupId>
com.alibaba
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment