Commit a4b0c516 by huluobin

other copy source

parent 4b804777
spring:
datasource:
druid:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://gz-cdb-lnrmt5zh.sql.tencentcdb.com:61369/bailun_other?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root
password: "#7kfnymAM$Y9-Ntf"
type: org.apache.commons.dbcp.BasicDataSource
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.blt.other.other_cost.dto
configuration:
map-underscore-to-camel-case: true
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
logging:
file: other/log/other.log
level:
com.blt.other.other_cost.dao: debug
url:
api:
baseServerUrl: http://www.bailuntec.com
baseFinansysUrl: http://cw.bailuntec.com
getExchangeRateApi: ${url.api.baseServerUrl}/api/ExchangeRate/GetExchangeRate
# 获取耗材
getConsumablesApi: ${url.api.baseFinansysUrl}/Cashier/Cashier/BuyCashierRecordList
costTypeKind:
logisticsSubjectCode: 22222
spring:
datasource:
druid:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/bailun_other?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=GMT&useSSL=false
username: root
password: root
filters: stat
initial-size: 1
min-idle: 1
max-active: 20
max-wait: -1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: SELECT 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
thymeleaf:
prefix: classpath:/templates/
suffix: .html
cache: false
resources:
static-locations: classpath:/resources/, classpath:/static/
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.blt.other.other_database.model
configuration:
map-underscore-to-camel-case: true
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
logging:
file: other/log/other.log
costTypeKind:
logisticsSubjectCode: 22222
\ No newline at end of file
server:
port: 8085
servlet:
context-path: /logistic/fee
spring:
profiles:
active: prod
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.other_cost.dao.CostDao">
<select id="getLogisticsCostList" resultType="com.blt.other.other_cost.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name
feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND
c.cost_status = 4
AND d.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.kind_name = '物流费'
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form
manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name
feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb, 0 as costId1, c.id as costId
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND
c.cost_status = 4
AND c.kind_name = '物流费'
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as
manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, 0 as costId
FROM buy b
WHERE b.sku_type_name = '物流费'
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
<select id="getCostList" resultType="com.blt.other.other_cost.dto.CostDto">
select * from cost where last_modify_date &gt;= #{startDate} and last_modify_date &lt;= #{endDate}
</select>
<!--管理成本:查询付款单+收款单+借还单+采购单-->
<select id="selectManageCost" resultType="com.blt.other.other_cost.dto.ManageCostDto">
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND c.cost_status = 4
AND c.logistics_supplier_id is null AND c.company_value =2 AND d.kind_name not in ('百伦咨询服务费','物流费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,d.kind_name feeSubType,d.amount amount,c.dic currency,
d.amount * c.to_rmb_rate amountRmb, d.id as costId1, c.id as costId
FROM user u, cost c, cost_detail d, type_relation t
WHERE c.create_userid = u.userid AND c.cost_no = d.cost_no AND t.fee_type = c.type_name AND c.cost_form = 1 AND c.cost_status = 4
AND c.logistics_supplier_id is null AND c.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND d.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND d.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.company_value =2 AND c1.kind_name not in ('百伦咨询服务费','物流费')
AND exists (SELECT 1 FROM cost c2 WHERE c1.company_value = c2.company_value AND c1.type_name = c2.type_name
AND c2.create_userid = u.userid AND t.fee_type = c2.type_name AND c2.cost_form = 1 AND c2.cost_status = 4
AND c2.logistics_supplier_id is null)
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND c1.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c1.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c1.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c1.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c1.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c1.cost_no no,c1.bank_company receiveUnit,c1.cost_reason reason,c1.pay_time payTime,c1.cost_form manageCostType,u.departmentname1 departmentName,
c1.company_value companyValue,c1.company_name companyName,t.manage_cost_type feeSuperType,c1.kind_name feeSubType,-c1.amount amount,c1.dic currency,
-c1.amount * c1.to_rmb_rate amountRmb, 0 as costId1, c1.id as costId
FROM user u, type_relation t ,cost c1
WHERE c1.create_userid = u.userid AND t.fee_type = c1.type_name AND c1.cost_form = 2 AND c1.cost_status = 4
AND c1.company_value in (1,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c1.kind_name not in ('百伦咨询服务费')
AND exists (SELECT 1 FROM cost c2 WHERE c1.company_value = c2.company_value AND c1.type_name = c2.type_name
AND c2.create_userid = u.userid AND t.fee_type = c2.type_name AND c2.cost_form = 1 AND c2.cost_status = 4
AND c2.logistics_supplier_id is null)
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND c1.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c1.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c1.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c1.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c1.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c1.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c1.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT c.cost_no no,c.bank_company receiveUnit,c.cost_reason reason,c.pay_time payTime,c.cost_form manageCostType,u.departmentname1 departmentName,
c.company_value companyValue,c.company_name companyName,t.manage_cost_type feeSuperType,c.kind_name feeSubType,c.amount amount,c.dic currency,
c.amount * c.to_rmb_rate amountRmb, 0 as costId1, c.id as costId
FROM user u, cost c, type_relation t
WHERE c.create_userid = u.userid AND t.fee_type = c.type_name AND c.cost_form = 3 AND c.is_lend = 2 AND c.cost_status = 4
AND c.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND c.kind_name not in ('百伦咨询服务费')
<if test="feeSuperType != null and feeSuperType != ''">AND t.manage_cost_type = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND c.kind_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND u.departmentname1 = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND c.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND c.company_name = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND c.create_userid = #{createUserId}</if>
<if test="payUserId != null and payUserId != ''">AND c.pay_user_id = #{payUserId}</if>
<if test="startDate != null">AND c.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND c.pay_time <![CDATA[<]]>#{endDate}</if>
UNION
SELECT b.buyno no,b.suppliername receiveUnit,b.note reason,b.pay_time payTime,0 as manageCostType,b.departmentname departmentName,
b.company_value companyValue,b.company companyName,b.sku_type_name feeSuperType,b.sku_type_name feeSubType,
b.amount amount,'CNY',b.amount amountRmb, 0 as costId1, b.id as costId
FROM buy b
WHERE b.company_value in (1,2,3,5,7,8,11,46,48,50,53,59,60,61,66,69) AND b.sku_type_name in ('固定资产','低值易耗品')
and b.buystatus <![CDATA[>]]> 3 and b.buystatus <![CDATA[<]]> 7 and b.buy_type <![CDATA[<]]> 3
<if test="feeSuperType != null and feeSuperType != ''">AND b.sku_type_name = #{feeSuperType}</if>
<if test="feeSubType != null and feeSubType != ''">AND b.sku_type_name = #{feeSubType}</if>
<if test="departmentName != null and departmentName != ''">AND b.departmentname = #{departmentName}</if>
<if test="companyValueList != null and companyValueList.size() > 0">
AND b.company_value in
<foreach collection="companyValueList" item="companyValue" index="index" open="(" close=")" separator=",">
<if test="companyValue != null and companyValue != 0"> #{companyValue}</if>
</foreach>
</if>
<if test="companyName != null and companyName != ''">AND b.company = #{companyName}</if>
<if test="createUserId != null and createUserId != ''">AND b.createuserid = #{createUserId}</if>
<if test="startDate != null">AND b.pay_time <![CDATA[>=]]> #{startDate}</if>
<if test="endDate != null">AND b.pay_time <![CDATA[<]]>#{endDate}</if>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.blt.other.other_cost.dao.CostDicDao">
<update id="updateCostDicCny">
update cost set to_rmb_rate = 1 where dic = 'CNY' and to_rmb_rate != 1
</update>
<update id="updateCostDicOther">
update cost set to_rmb_rate = #{to_rmb_rate} where dic = #{dic} and to_rmb_rate = 1
</update>
<select id="selectCostDicGroupDic" resultType="java.util.Map">
select dic, to_rmb_rate from cost where dic != "CNY" and to_rmb_rate != 1 group by dic order by pay_time desc;
</select>
</mapper>
\ No newline at end of file
Manifest-Version: 1.0
Implementation-Title: cost-core-copy
Implementation-Version: 0.0.1-SNAPSHOT
Start-Class: com.blt.other.CostCoreCopyApplication
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Build-Jdk-Spec: 1.8
Spring-Boot-Version: 2.2.1.RELEASE
Created-By: Maven Archiver 3.4.0
Main-Class: org.springframework.boot.loader.JarLauncher
version=0.0.1-SNAPSHOT
groupId=com.blt
artifactId=cost-core-copy
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.blt</groupId>
<artifactId>cost-core-copy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>cost-core-copy</name>
<description>blt other purcharse</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mybatis.version>3.4.1</mybatis.version>
<mybatis.spring.version>1.3.2</mybatis.spring.version>
<mysql.version>5.1.47</mysql.version>
<pagehelper.spring.boot.starter>1.2.5</pagehelper.spring.boot.starter>
<druid.spring.boot.starter>1.1.9</druid.spring.boot.starter>
<pagehelper>5.0.0</pagehelper>
<pagehelper.spring.boot.autoconfigure>1.2.5</pagehelper.spring.boot.autoconfigure>
<commons.io>2.4</commons.io>
<fastjson>1.2.47</fastjson>
</properties>
<dependencies>
<!-- fastjson begin -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson}</version>
</dependency>
<!-- fastjson end -->
<!-- spring boot 热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- spring boot 热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.spring.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 分页插件 begin-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.spring.boot.starter}</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>${pagehelper}</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
<version>${pagehelper.spring.boot.autoconfigure}</version>
</dependency>
<!-- pagehelper end-->
<!-- alibaba druid 数据库连接池-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.spring.boot.starter}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment