Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
Aidea
Project
Project
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
sa_aidea
Aidea
Commits
1fdef6e4
Commit
1fdef6e4
authored
Nov 27, 2020
by
卜远杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开票
parent
d0db96f5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1941 additions
and
10 deletions
+1941
-10
pom.xml
aidea-modules/invoice-module-web/pom.xml
+30
-0
invoiceform.html
...eb/src/main/webapp/WEB-INF/views/invoice/invoiceform.html
+194
-0
invoicelist.html
...eb/src/main/webapp/WEB-INF/views/invoice/invoicelist.html
+388
-0
pom.xml
aidea-modules/invoice-module/pom.xml
+27
-0
InvoiceMapper.java
...e/src/main/java/com/cftech/invoice/dao/InvoiceMapper.java
+14
-0
InvoiceMapper.xml
...le/src/main/java/com/cftech/invoice/dao/InvoiceMapper.xml
+199
-0
Invoice.java
...odule/src/main/java/com/cftech/invoice/model/Invoice.java
+78
-0
InvoiceDto.java
...le/src/main/java/com/cftech/invoice/model/InvoiceDto.java
+51
-0
InvoiceService.java
.../main/java/com/cftech/invoice/service/InvoiceService.java
+14
-0
InvoiceServiceImpl.java
...a/com/cftech/invoice/service/impl/InvoiceServiceImpl.java
+31
-0
InvoiceController.java
...c/main/java/com/cftech/invoice/web/InvoiceController.java
+198
-0
orderlist.html
...le-web/src/main/webapp/WEB-INF/views/order/orderlist.html
+249
-3
pom.xml
aidea-modules/order-module/pom.xml
+17
-0
OrderMapper.xml
...module/src/main/java/com/cftech/order/dao/OrderMapper.xml
+18
-2
Order.java
...er-module/src/main/java/com/cftech/order/model/Order.java
+25
-1
OrderService.java
.../src/main/java/com/cftech/order/service/OrderService.java
+8
-0
OrderServiceImpl.java
.../java/com/cftech/order/service/impl/OrderServiceImpl.java
+75
-0
InvoiceUtil.java
...ule/src/main/java/com/cftech/order/utils/InvoiceUtil.java
+207
-0
MobileOrderController.java
...main/java/com/cftech/order/web/MobileOrderController.java
+12
-0
OrderController.java
...e/src/main/java/com/cftech/order/web/OrderController.java
+63
-1
pom.xml
aidea-modules/pom.xml
+2
-0
productform.html
...eb/src/main/webapp/WEB-INF/views/product/productform.html
+10
-0
ProductMapper.xml
...le/src/main/java/com/cftech/product/dao/ProductMapper.xml
+8
-2
Product.java
...odule/src/main/java/com/cftech/product/model/Product.java
+4
-0
common-test.properties
cftech-common-web/src/main/resources/common-test.properties
+18
-0
qyuserlist.html
...c/main/webapp/WEB-INF/views/managerqyuser/qyuserlist.html
+1
-1
No files found.
aidea-modules/invoice-module-web/pom.xml
0 → 100644
View file @
1fdef6e4
<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 http://maven.apache.org/maven-v4_0_0.xsd"
>
<parent>
<artifactId>
aidea-modules
</artifactId>
<groupId>
com.cftech
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
invoice-module-web
</artifactId>
<packaging>
war
</packaging>
<name>
invoice-module-web Maven Webapp
</name>
<url>
http://maven.apache.org
</url>
<dependencies>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
3.8.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
invoice-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
<finalName>
invoice-module-web
</finalName>
</build>
</project>
aidea-modules/invoice-module-web/src/main/webapp/WEB-INF/views/invoice/invoiceform.html
0 → 100644
View file @
1fdef6e4
<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html>
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<base
href=
"#springUrl('/assets/adminlte/')"
/>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<title>
工作台
</title>
<!-- Tell the browser to be responsive to screen width -->
<meta
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
name=
"viewport"
>
<!-- Bootstrap 3.3.5 -->
<link
rel=
"stylesheet"
href=
"bootstrap/css/bootstrap.min.css"
>
<!-- Font Awesome -->
<link
rel=
"stylesheet"
href=
"plugins/font-awesome/css/font-awesome.min.css"
>
<!-- Ionicons -->
<link
rel=
"stylesheet"
href=
"plugins/ionicons/css/ionicons.min.css"
>
<!-- DataTables -->
<link
rel=
"stylesheet"
href=
"plugins/datatables/dataTables.bootstrap.css"
>
<!-- Theme style -->
<link
rel=
"stylesheet"
href=
"dist/css/AdminLTE.min.css"
>
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link
rel=
"stylesheet"
href=
"dist/css/skins/_all-skins.min.css"
>
<!-- iCheck -->
<link
rel=
"stylesheet"
href=
"plugins/iCheck/flat/blue.css"
>
<!-- Date Picker -->
<link
rel=
"stylesheet"
href=
"plugins/datepicker/datepicker3.css"
>
<!-- Daterange picker -->
<link
rel=
"stylesheet"
href=
"plugins/daterangepicker/daterangepicker-bs3.css"
>
<!-- bootstrap wysihtml5 - text editor -->
<link
rel=
"stylesheet"
href=
"plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css"
>
<!--validate css-->
<link
rel=
"stylesheet"
href=
"plugins/jquery-validation/css/validate.css"
>
<!--fileinput css-->
<link
rel=
"stylesheet"
href=
"plugins/bootstrap-fileinput/bootstrap-fileinput.css"
>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<!-- END HEAD -->
<body
class=
"hold-transition skin-blue sidebar-mini"
>
<div
class=
"wrapper"
>
<div
class=
"content-wrapper"
style=
"margin-left:0;"
>
<section
class=
"content-header"
>
<h1>
开票信息管理
<small>
开票信息
</small>
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"#"
><i
class=
"fa fa-dashboard"
></i>
首页
</a></li>
<li><a
class=
"active"
>
开票信息
</a></li>
</ol>
</section>
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<!-- general form elements disabled -->
<div
class=
"box box-primary"
>
<form
role=
"form"
id=
"myForm"
>
<input
name=
"id"
value=
"$!{data.id}"
hidden=
"true"
/>
<div
class=
"box-body"
>
</div>
<div
class=
"box-footer"
>
#if($shiro.hasPermission("qy:invoice:edit"))
<input
class=
"btn btn-primary"
id=
"save"
value=
"保存"
type=
"submit"
>
#end
<a
href=
"#springUrl('/a/invoice/list')"
class=
"btn btn-default"
>
取消
</a>
</div>
</form>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div
class=
"control-sidebar-bg"
></div>
</div>
<!-- ./wrapper -->
<script
src=
"plugins/jQuery/jQuery-2.1.4.min.js"
></script>
<!-- Bootstrap 3.3.5 -->
<script
src=
"bootstrap/js/bootstrap.min.js"
></script>
<!-- DataTables -->
<script
src=
"plugins/datatables/jquery.dataTables.min.js"
></script>
<script
src=
"plugins/datatables/extensions/i18n/lanauage_ch.js"
></script>
<script
src=
"plugins/datatables/dataTables.bootstrap.min.js"
></script>
<!-- SlimScroll -->
<script
src=
"plugins/slimScroll/jquery.slimscroll.min.js"
></script>
<!-- FastClick -->
<script
src=
"plugins/fastclick/fastclick.min.js"
></script>
<!--fileinput js-->
<script
src=
"plugins/bootstrap-fileinput/bootstrap-fileinput.js"
></script>
<!-- AdminLTE App -->
<script
src=
"dist/js/app.min.js"
></script>
<script
src=
"plugins/bootstrap-maxlength/bootstrap-maxlength.min.js"
type=
"text/javascript"
></script>
<script
src=
"plugins/security/sha256.js"
type=
"text/javascript"
></script>
<script
src=
"plugins/jquery-validation/js/jquery.validate.min.js"
></script>
<script
src=
"js/jquery.form.min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"plugins/ueditor-min-1.4.3/ueditor.config.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"plugins/ueditor-min-1.4.3/ueditor.all.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"plugins/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"
></script>
<script
src=
"common/js/cfapp.js"
></script>
<!-- END PAGE LEVEL PLUGINS -->
<script>
$
().
ready
(
function
()
{
Cfapp
.
init
();
recdTypeAdd
.
init
();
});
var
recdTypeAdd
=
function
()
{
var
initForm
=
function
()
{
var
initFormCtrl
=
function
()
{
bindEvent
();
};
var
bindEvent
=
function
()
{
$
(
"#myForm"
).
validate
({
rules
:
{},
messages
:
{},
submitHandler
:
function
(
form
)
{
$
(
"#save"
).
attr
(
"disabled"
,
true
);
$
.
getJSON
(
"#springUrl('/a/invoice/formData')"
,
$
(
"#myForm"
).
serialize
(),
function
(
returnobj
)
{
$
(
"#save"
).
attr
(
"disabled"
,
false
);
if
(
returnobj
.
errorNo
==
2
)
{
//保存成功
Cfapp
.
confirm
({
message
:
"添加成功"
,
btnoktext
:
"继续添加"
,
btncanceltext
:
"关闭"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/invoice/form')"
;
},
cancel
:
function
()
{
location
.
href
=
"#springUrl('/a/invoice/list')"
;
}
});
}
else
if
(
returnobj
.
errorNo
==
0
)
{
//修改成功
Cfapp
.
alert
({
message
:
"更新成功"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/invoice/list')"
;
}
});
}
else
{
Cfapp
.
alert
({
message
:
"创建失败"
,
btntext
:
"确定"
,
success
:
function
()
{
location
.
href
=
"#springUrl('/a/invoice/list')"
;
}
});
}
});
}
})
}
initFormCtrl
();
}
return
{
//main function to initiate the module
init
:
function
()
{
initForm
();
}
};
}();
</script>
</body>
<!-- END BODY -->
</html>
\ No newline at end of file
aidea-modules/invoice-module-web/src/main/webapp/WEB-INF/views/invoice/invoicelist.html
0 → 100644
View file @
1fdef6e4
This diff is collapsed.
Click to expand it.
aidea-modules/invoice-module/pom.xml
0 → 100644
View file @
1fdef6e4
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
aidea-modules
</artifactId>
<groupId>
com.cftech
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
invoice-module
</artifactId>
<dependencies>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
sys-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.nuonuo
</groupId>
<artifactId>
open-sdk
</artifactId>
<version>
1.0.4.1
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/dao/InvoiceMapper.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
dao
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.core.generic.GenericDao
;
/**
* 开票信息Mapper
*
* @author Buyj
* @date: 2020-11-25 09:32
*/
public
interface
InvoiceMapper
extends
GenericDao
<
Invoice
>
{
}
\ No newline at end of file
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/dao/InvoiceMapper.xml
0 → 100644
View file @
1fdef6e4
<?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.cftech.invoice.dao.InvoiceMapper"
>
<resultMap
id=
"resultMap"
type=
"com.cftech.invoice.model.Invoice"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"invoice_title"
property=
"invoiceTitle"
/>
<result
column=
"invoice_content"
property=
"invoiceContent"
/>
<result
column=
"unit_tax_number"
property=
"unitTaxNumber"
/>
<result
column=
"invoice_type"
property=
"invoiceType"
/>
<result
column=
"invoice_form"
property=
"invoiceForm"
/>
<result
column=
"clerk_id"
property=
"clerkId"
/>
<result
column=
"order_id"
property=
"orderId"
/>
<result
column=
"push_mode"
property=
"pushMode"
/>
<result
column=
"email"
property=
"email"
/>
<result
column=
"invoice_serial_num"
property=
"invoiceSerialNum"
/>
<result
column=
"product_id"
property=
"productId"
/>
<result
column=
"accounts_id"
property=
"accountsId"
/>
<result
column=
"del_flag"
property=
"delFlag"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"description"
property=
"description"
/>
<result
column=
"create_by"
property=
"createBy"
/>
<result
column=
"update_by"
property=
"updateBy"
/>
</resultMap>
<sql
id=
"sqlWhere"
>
<if
test=
"conds!=null"
>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND|OR"
>
<foreach
collection=
"conds.conds"
index=
"index"
item=
"cond"
>
${cond.linkType}
<if
test=
"cond.condType == 'EQUAL'"
>
${cond.param} = #{cond.value}
</if>
<if
test=
"cond.condType == 'NOTEQUAL'"
>
${cond.param}
<>
#{cond.value}
</if>
<if
test=
"cond.condType == 'GREATEQUAL'"
>
${cond.param}
>
= #{cond.value}
</if>
<if
test=
"cond.condType == 'GREATTHAN'"
>
${cond.param}
>
#{cond.value}
</if>
<if
test=
"cond.condType == 'LESSEQUAL'"
>
${cond.param}
<
= #{cond.value}
</if>
<if
test=
"cond.condType == 'LESSTHAN'"
>
${cond.param}
<
#{cond.value}
</if>
<if
test=
"cond.condType == 'BETWEEN'"
>
${cond.param} BETWEEN #{cond.startValue} AND
#{cond.endValue}
</if>
<if
test=
"cond.condType == 'ISNULL'"
>
${cond.param} IS NULL
</if>
<if
test=
"cond.condType == 'NOTNULL'"
>
${cond.param} IS NOT NULL
</if>
<if
test=
"cond.condType == 'LIKE'"
>
${cond.param} LIKE #{cond.value}
</if>
<if
test=
"cond.condType == 'IN'"
>
${cond.param} IN
<foreach
item=
"item"
index=
"index"
collection=
"cond.value"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</foreach>
</trim>
</if>
</sql>
<sql
id=
"sqlColumns"
>
id,
invoice_title,
invoice_content,
unit_tax_number,
invoice_type,
invoice_form,
clerk_id,
order_id,
push_mode,
email,
invoice_serial_num,
product_id,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
</sql>
<insert
id=
"save"
parameterType=
"com.cftech.invoice.model.Invoice"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into t_aidea_invoice
(
<include
refid=
"sqlColumns"
/>
)
values
(
#{id, jdbcType=BIGINT},
#{invoiceTitle, jdbcType=VARCHAR},
#{invoiceContent, jdbcType=VARCHAR},
#{unitTaxNumber, jdbcType=VARCHAR},
#{invoiceType, jdbcType=VARCHAR},
#{invoiceForm, jdbcType=VARCHAR},
#{clerkId, jdbcType=VARCHAR},
#{orderId, jdbcType=VARCHAR},
#{pushMode, jdbcType=VARCHAR},
#{email, jdbcType=VARCHAR},
#{invoiceSerialNum, jdbcType=VARCHAR},
#{productId, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT},
#{delFlag, jdbcType=TINYINT},
#{status, jdbcType=VARCHAR},
now(),
now(),
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}
)
</insert>
<select
id=
"fetchById"
parameterType=
"java.lang.Long"
resultMap=
"resultMap"
>
SELECT
<include
refid=
"sqlColumns"
/>
FROM t_aidea_invoice t
WHERE t.id=#{id}
</select>
<select
id=
"count"
parameterType=
"java.util.Map"
resultType=
"java.lang.Integer"
>
SELECT COUNT(1) FROM t_aidea_invoice
<include
refid=
"sqlWhere"
/>
</select>
<select
id=
"fetchSearchByPage"
parameterType=
"java.util.Map"
resultMap=
"resultMap"
>
SELECT
<include
refid=
"sqlColumns"
/>
FROM t_aidea_invoice
<include
refid=
"sqlWhere"
/>
<if
test=
"sort!=null"
>
ORDER BY ${sort.param} ${sort.type}
</if>
<if
test=
"limit>0"
>
limit #{offset},#{limit}
</if>
</select>
<update
id=
"update"
parameterType=
"com.cftech.invoice.model.Invoice"
>
update t_aidea_invoice
<set>
<if
test=
"id != null"
>
id = #{id, jdbcType=BIGINT},
</if>
<if
test=
"invoiceTitle != null"
>
invoice_title = #{invoiceTitle, jdbcType=VARCHAR},
</if>
<if
test=
"invoiceContent != null"
>
invoice_content = #{invoiceContent, jdbcType=VARCHAR},
</if>
<if
test=
"unitTaxNumber != null"
>
unit_tax_number = #{unitTaxNumber, jdbcType=VARCHAR},
</if>
<if
test=
"invoiceType != null"
>
invoice_type = #{invoiceType, jdbcType=VARCHAR},
</if>
<if
test=
"invoiceForm != null"
>
invoice_form = #{invoiceForm, jdbcType=VARCHAR},
</if>
<if
test=
"clerkId != null"
>
clerk_id = #{clerkId, jdbcType=VARCHAR},
</if>
<if
test=
"orderId != null"
>
order_id = #{orderId, jdbcType=VARCHAR},
</if>
<if
test=
"pushMode != null"
>
push_mode = #{pushMode, jdbcType=VARCHAR},
</if>
<if
test=
"email != null"
>
email = #{email, jdbcType=VARCHAR},
</if>
<if
test=
"invoiceSerialNum != null"
>
invoice_serial_num = #{invoiceSerialNum, jdbcType=VARCHAR},
</if>
<if
test=
"productId != null"
>
product_id = #{productId, jdbcType=VARCHAR},
</if>
<if
test=
"accountsId != null"
>
accounts_id = #{accountsId, jdbcType=BIGINT},
</if>
<if
test=
"delFlag != null"
>
del_flag = #{delFlag, jdbcType=TINYINT},
</if>
<if
test=
"status != null"
>
status = #{status, jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime, jdbcType=TIMESTAMP},
</if>
<if
test=
"description != null"
>
description = #{description, jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy, jdbcType=BIGINT},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy, jdbcType=BIGINT},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
<update
id=
"delete"
parameterType=
"java.lang.Long"
>
update t_aidea_invoice set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/model/Invoice.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
model
;
import
com.cftech.core.poi.ExportConfig
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 开票信息
*
* @author Buyj
* @date: 2020-11-25 09:32
*/
@Data
public
class
Invoice
implements
Serializable
{
/** 主键id */
private
Long
id
;
/** 发票抬头 */
@ExportConfig
(
value
=
"发票抬头"
,
width
=
100
,
showLevel
=
1
)
private
String
invoiceTitle
;
/** 发票内容 */
@ExportConfig
(
value
=
"发票内容"
,
width
=
100
,
showLevel
=
1
)
private
String
invoiceContent
;
/** 单位税号 */
@ExportConfig
(
value
=
"单位税号"
,
width
=
100
,
showLevel
=
1
)
private
String
unitTaxNumber
;
/** 发票类型(1:蓝票,2红票) */
@ExportConfig
(
value
=
"发票类型"
,
width
=
100
,
showLevel
=
1
)
private
String
invoiceType
;
/** 来源(0:移动端 1:后台) */
@ExportConfig
(
value
=
"来源"
,
width
=
100
,
showLevel
=
1
)
private
String
invoiceForm
;
/** 开票人id(移动端传opendId,后台传userid) */
@ExportConfig
(
value
=
"开票人"
,
width
=
100
,
showLevel
=
1
)
private
String
clerkId
;
/** 订单ID */
@ExportConfig
(
value
=
"订单编码"
,
width
=
100
,
showLevel
=
1
)
private
String
orderId
;
/** 推送方式(0:邮箱) */
@ExportConfig
(
value
=
"推送方式"
,
width
=
100
,
showLevel
=
1
)
private
String
pushMode
;
/** 推送邮箱 */
@ExportConfig
(
value
=
"推送邮箱"
,
width
=
100
,
showLevel
=
1
)
private
String
email
;
/** 发票流水号 */
@ExportConfig
(
value
=
"发票流水号"
,
width
=
100
,
showLevel
=
1
)
private
String
invoiceSerialNum
;
/** 商品ID 逗号隔开 */
private
String
productId
;
/** 所属的账号 */
private
Long
accountsId
;
/** 删除标识 */
private
boolean
delFlag
;
/** 状态 */
/**
* 状态( 0:个人 1:企业 )
*/
@ExportConfig
(
value
=
"抬头类型"
)
private
String
status
;
/** 创建时间 */
private
Date
createTime
;
/** 更新时间 */
private
Date
updateTime
;
/** 备注 */
private
String
description
;
/** 创建人 */
private
Long
createBy
;
/** 更新人 */
private
Long
updateBy
;
public
Invoice
()
{
this
.
delFlag
=
false
;
this
.
status
=
"0"
;
}
}
\ No newline at end of file
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/model/InvoiceDto.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
model
;
import
lombok.Data
;
/**
* 移动端开票所需传的参数
* @author BuYJ
*/
@Data
public
class
InvoiceDto
{
/**
* 订单ID 逗号隔开
*/
private
String
id
;
/**
* 抬头类型(0:个人 1:企业)
*/
private
String
type
;
/**
* 发票税号
*/
private
String
unitTaxNumber
;
/**
* 发票抬头
*/
private
String
invoiceTitle
;
/**
* 发票内容
*/
private
String
invoiceContent
;
/**
* 开票人ID
*/
private
String
openId
;
/**
* 邮箱
*/
private
String
email
;
private
String
appId
;
}
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/service/InvoiceService.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
service
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.core.generic.GenericService
;
/**
* 开票信息Service
*
* @author Buyj
* @date: 2020-11-25 09:32
*/
public
interface
InvoiceService
extends
GenericService
<
Invoice
>
{
}
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/service/impl/InvoiceServiceImpl.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
service
.
impl
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.invoice.dao.InvoiceMapper
;
import
com.cftech.invoice.service.InvoiceService
;
import
com.cftech.core.generic.GenericDao
;
import
com.cftech.core.generic.GenericServiceImpl
;
import
com.cftech.core.sql.Conds
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
/**
* 开票信息ServiceImpl
*
* @author Buyj
* @date: 2020-11-25 09:32
*/
@Service
(
"invoiceService"
)
public
class
InvoiceServiceImpl
extends
GenericServiceImpl
<
Invoice
>
implements
InvoiceService
{
@Autowired
@Qualifier
(
"invoiceMapper"
)
private
InvoiceMapper
invoiceMapper
;
@Override
public
GenericDao
<
Invoice
>
getGenericMapper
()
{
return
invoiceMapper
;
}
}
\ No newline at end of file
aidea-modules/invoice-module/src/main/java/com/cftech/invoice/web/InvoiceController.java
0 → 100644
View file @
1fdef6e4
package
com
.
cftech
.
invoice
.
web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.invoice.service.InvoiceService
;
import
com.cftech.core.poi.ExcelKit
;
import
com.cftech.core.scope.OrderType
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.Constants
;
import
com.cftech.sys.security.PermissionSign
;
import
com.cftech.sys.security.UserUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.List
;
/**
* 开票信息Controller
* <p>
* 权限字符串说明:
* 查看:public static final String INVOICE_VIEW = "qy:invoice:view"
* 查看:public static final String INVOICE_EDIT = "qy:invoice:edit"
*
* @author Buyj
* @date: 2020-11-25 09:32
*/
@Slf4j
@Controller
@RequestMapping
(
"/a/invoice"
)
public
class
InvoiceController
{
public
static
final
String
INVOICE_VIEW
=
"qy:invoice:view"
;
public
static
final
String
INVOICE_EDIT
=
"qy:invoice:edit"
;
@Autowired
private
InvoiceService
invoiceService
;
//列表页面
@RequiresPermissions
(
value
=
INVOICE_VIEW
)
@RequestMapping
(
"/list"
)
public
String
list
(
HttpServletRequest
request
,
Model
model
)
{
Long
accountId
=
UserUtils
.
getmpaccounts
(
request
);
model
.
addAttribute
(
"accountId"
,
accountId
);
return
"invoice/invoicelist"
;
}
//编辑页面(新增、修改)
@RequiresPermissions
(
value
=
INVOICE_VIEW
)
@RequestMapping
(
"/form"
)
public
String
form
(
HttpServletRequest
request
,
String
id
,
Model
model
)
{
if
(!
StringUtils
.
isEmpty
(
id
))
{
Invoice
invoice
=
invoiceService
.
fetchById
(
id
);
model
.
addAttribute
(
"data"
,
invoice
);
}
return
"invoice/invoiceform"
;
}
//提交数据(新增、修改)
@RequiresPermissions
(
value
=
INVOICE_EDIT
)
@RequestMapping
(
"/formData"
)
@ResponseBody
public
JSONObject
formData
(
Invoice
invoice
,
Model
model
,
HttpServletRequest
request
)
{
Long
accountsId
=
UserUtils
.
getmpaccounts
(
request
);
JSONObject
rtnJson
=
new
JSONObject
();
try
{
if
(
invoice
!=
null
&&
invoice
.
getId
()
!=
null
)
{
invoice
.
setUpdateBy
(
UserUtils
.
getUser
().
getId
());
invoiceService
.
update
(
invoice
);
rtnJson
.
put
(
"errorNo"
,
0
);
}
else
{
invoice
.
setAccountsId
(
accountsId
);
invoice
.
setDelFlag
(
false
);
invoice
.
setAccountsId
(
UserUtils
.
getmpaccounts
(
request
));
invoice
.
setCreateBy
(
UserUtils
.
getUser
().
getId
());
invoice
.
setUpdateBy
(
UserUtils
.
getUser
().
getId
());
invoiceService
.
save
(
invoice
);
rtnJson
.
put
(
"errorNo"
,
2
);
}
}
catch
(
Exception
e
)
{
rtnJson
.
put
(
"errorNo"
,
1
);
}
return
rtnJson
;
}
//获取列表数据
@RequiresPermissions
(
value
=
INVOICE_VIEW
)
@RequestMapping
(
value
=
"/listData"
)
@ResponseBody
public
JSONObject
listData
(
int
iDisplayStart
,
int
iDisplayLength
,
Invoice
invoice
,
HttpServletRequest
request
)
{
Long
accountsId
=
UserUtils
.
getmpaccounts
(
request
);
Conds
conds
=
new
Conds
();
conds
.
equal
(
"del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"accounts_id"
,
accountsId
);
if
(!
StringUtils
.
isEmpty
(
invoice
.
getInvoiceTitle
())){
conds
.
like
(
"invoice_title"
,
invoice
.
getInvoiceTitle
());
}
Sort
sort
=
new
Sort
(
"create_time"
,
OrderType
.
DESC
);
List
<
Invoice
>
list
=
invoiceService
.
fetchSearchByPage
(
conds
,
sort
,
iDisplayStart
,
iDisplayLength
);
Integer
counts
=
invoiceService
.
count
(
conds
);
JSONObject
rtnJson
=
new
JSONObject
();
rtnJson
.
put
(
"iTotalRecords"
,
counts
);
rtnJson
.
put
(
"iTotalDisplayRecords"
,
counts
);
rtnJson
.
put
(
"aaData"
,
list
);
return
rtnJson
;
}
//删除数据
@RequiresPermissions
(
value
=
INVOICE_EDIT
)
@RequestMapping
(
"/delete"
)
@ResponseBody
public
JSONObject
delete
(
String
id
)
{
JSONObject
rtnJosn
=
new
JSONObject
();
try
{
invoiceService
.
delete
(
id
);
rtnJosn
.
put
(
"errorNo"
,
0
);
}
catch
(
Exception
e
)
{
rtnJosn
.
put
(
"errorNo"
,
1
);
}
return
rtnJosn
;
}
@RequestMapping
(
"/exportExcel"
)
@RequiresPermissions
(
value
=
INVOICE_VIEW
)
public
void
exportExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Invoice
invoice
)
{
Long
accountId
=
UserUtils
.
getmpaccounts
(
request
);
Sort
sort
=
new
Sort
(
"create_time"
,
OrderType
.
ASC
);
Conds
conds
=
new
Conds
();
if
(!
StringUtils
.
isEmpty
(
invoice
.
getInvoiceTitle
())){
conds
.
like
(
"invoice_title"
,
invoice
.
getInvoiceTitle
());
}
conds
.
equal
(
"del_flag"
,
0
);
conds
.
equal
(
"accounts_id"
,
accountId
);
List
<
Invoice
>
list
=
invoiceService
.
fetchSearchByPage
(
conds
,
sort
,
0
,
0
);
if
(
list
.
size
()
>
0
){
for
(
Invoice
invoiceObj
:
list
)
{
invoiceObj
.
setInvoiceType
(
StringUtils
.
isEmpty
(
invoiceObj
.
getInvoiceType
())
?
""
:
invoiceObj
.
getInvoiceType
().
equals
(
"1"
)
?
"正票"
:
"红票"
);
invoiceObj
.
setInvoiceForm
(
StringUtils
.
isEmpty
(
invoiceObj
.
getInvoiceForm
())
?
""
:
invoiceObj
.
getInvoiceForm
().
equals
(
"0"
)
?
"移动端"
:
"后台"
);
invoiceObj
.
setPushMode
(
StringUtils
.
isEmpty
(
invoiceObj
.
getPushMode
())
?
""
:
"邮箱"
);
invoiceObj
.
setStatus
(
StringUtils
.
isEmpty
(
invoiceObj
.
getStatus
())
?
""
:
invoiceObj
.
getStatus
().
equals
(
"0"
)
?
"个人"
:
"企业"
);
}
}
ExcelKit
.
$Export
(
Invoice
.
class
,
response
).
toExcel
(
list
,
"开票信息信息"
);
}
@RequestMapping
(
"/templateExcel"
)
@RequiresPermissions
(
value
=
INVOICE_VIEW
)
public
void
templateExcel
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
ExcelKit
.
$Export
(
Invoice
.
class
,
response
).
toExcel
(
null
,
"开票信息信息"
);
}
@RequestMapping
(
"/importExcel"
)
@RequiresPermissions
(
value
=
INVOICE_EDIT
)
public
String
importExcel
(
HttpServletRequest
request
,
MultipartFile
file
,
Model
model
)
{
Long
accountId
=
UserUtils
.
getmpaccounts
(
request
);
if
(
file
==
null
)
{
return
list
(
request
,
model
);
}
// 构造临时路径来存储上传的文件
String
uploadPath
=
System
.
getProperty
(
"java.io.tmpdir"
);
File
uploadDir
=
new
File
(
uploadPath
);
if
(!
uploadDir
.
exists
())
{
uploadDir
.
mkdir
();
}
String
fileName
=
file
.
getOriginalFilename
();
String
filePath
=
uploadPath
+
File
.
separator
+
fileName
;
File
storeFile
=
new
File
(
filePath
);
try
{
file
.
transferTo
(
storeFile
);
ExcelKit
.
$Import
().
setEmptyCellValue
(
""
).
readExcel
(
storeFile
,
rowData
->
{
if
(!
StringUtils
.
isEmpty
(
rowData
.
get
(
0
)))
{
Invoice
invoice
=
new
Invoice
();
invoice
.
setAccountsId
(
accountId
);
invoiceService
.
save
(
invoice
);
}
});
}
catch
(
IOException
e
)
{
log
.
error
(
e
.
getMessage
());
}
return
list
(
request
,
model
);
}
}
aidea-modules/order-module-web/src/main/webapp/WEB-INF/views/order/orderlist.html
View file @
1fdef6e4
This diff is collapsed.
Click to expand it.
aidea-modules/order-module/pom.xml
View file @
1fdef6e4
...
...
@@ -17,5 +17,22 @@
<artifactId>
order-detail-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.nuonuo
</groupId>
<artifactId>
open-sdk
</artifactId>
<version>
1.0.4.1
</version>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
invoice-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.cftech
</groupId>
<artifactId>
product-module
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
aidea-modules/order-module/src/main/java/com/cftech/order/dao/OrderMapper.xml
View file @
1fdef6e4
...
...
@@ -72,6 +72,11 @@
<result
column=
"address_des"
property=
"addressDes"
/>
<result
column=
"consultCode"
property=
"consultCode"
/>
<result
column=
"nickName"
property=
"nickName"
/>
<result
column=
"format"
property=
"format"
/>
<result
column=
"price"
property=
"price"
/>
<result
column=
"memberName"
property=
"memberName"
/>
<result
column=
"memberPhone"
property=
"memberPhone"
/>
<result
column=
"address"
property=
"address"
/>
<result
column=
"order_time"
property=
"orderTime"
/>
<result
column=
"cancel_time"
property=
"cancelTime"
/>
<result
column=
"sendExpressDateStr"
property=
"sendExpressDateStr"
/>
...
...
@@ -113,6 +118,8 @@
o.id,
o.openid,
t.product_number,
t.format,
t.price,
o.consult_id,
t.product_name,
o.number,
...
...
@@ -131,7 +138,10 @@
d.drugs_num,
o.courier_number,
o.address_des,
t.id as productId
t.id as productId,
CONVERT ( AES_DECRYPT( m.`name`, 'aideakey' ) USING UTF8 ) memberName,
CONVERT ( AES_DECRYPT( m.phone, 'aideakey' ) USING UTF8 ) memberPhone,
a.address
</sql>
<sql
id=
"sqlColumnFrom"
>
...
...
@@ -319,13 +329,19 @@
order_time,
cancel_time,
DATE_FORMAT(aw.send_express_date, '%Y-%m-%d %H:%i') sendExpressDateStr,
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr
DATE_FORMAT(aw.accept_express_date, '%Y-%m-%d %H:%i') acceptExpressDateStr,
t.id as productId,
CONVERT ( AES_DECRYPT( m.`name`, 'aideakey' ) USING UTF8 ) memberName,
CONVERT ( AES_DECRYPT( m.phone, 'aideakey' ) USING UTF8 ) memberPhone,
a.address
FROM t_order o
LEFT JOIN t_aidea_consult_sheet cs ON o.consult_id = cs.id
LEFT JOIN t_shipping_address s ON o.address_id = s.id
LEFT JOIN t_order_details d ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
LEFT JOIN wx_mp_fanss f ON f.openid = o.openid
LEFT JOIN wx_mp_member m on m.open_id = o.openid
LEFT JOIN t_shipping_address a on a.id = o.address_id
LEFT JOIN t_aidea_waybill aw ON o.id = aw.order_id
<include
refid=
"sqlWhere"
/>
<if
test=
"userid != null"
>
AND (o.service_id = ${userid} or o.doctor_id =${userid} or o.clerk_id = ${userid})
</if>
...
...
aidea-modules/order-module/src/main/java/com/cftech/order/model/Order.java
View file @
1fdef6e4
...
...
@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
* @author Licc
* @date: 2020-10-10 14:20
*/
@Data
public
class
Order
extends
OrderDetail
implements
Serializable
{
/* 主键id */
...
...
@@ -80,8 +81,8 @@ public class Order extends OrderDetail implements Serializable {
@ExportConfig
(
value
=
"订单员id"
,
width
=
100
,
showLevel
=
1
)
private
Long
clerkId
;
/* 创建时间 */
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
private
String
createTimeStr
;
/* 更新时间 */
private
Date
updateTime
;
...
...
@@ -99,12 +100,35 @@ public class Order extends OrderDetail implements Serializable {
private
Long
productId
;
/**
* 购方地址
*/
private
String
address
;
private
List
<
ProductVO
>
list
;
private
Date
cancelTime
;
/**
* 规格
*/
private
String
format
;
/**
* 商品单价
*/
private
Double
price
;
/**
* 会员名称
*/
private
String
memberName
;
/**
* 会员手机
*/
private
String
memberPhone
;
/**
* 搜索字段
*/
...
...
aidea-modules/order-module/src/main/java/com/cftech/order/service/OrderService.java
View file @
1fdef6e4
...
...
@@ -3,6 +3,7 @@ package com.cftech.order.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.invoice.model.InvoiceDto
;
import
com.cftech.order.model.*
;
import
com.cftech.core.generic.GenericService
;
...
...
@@ -74,4 +75,11 @@ public interface OrderService extends GenericService<Order> {
* @param openid
*/
Integer
isThreeUsers
(
String
openid
);
/**
* 开票
* @param invoiceDto
* @return
*/
JSONObject
invoice
(
InvoiceDto
invoiceDto
);
}
aidea-modules/order-module/src/main/java/com/cftech/order/service/impl/OrderServiceImpl.java
View file @
1fdef6e4
package
com
.
cftech
.
order
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.service.MpAccountsService
;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.Constants
;
import
com.cftech.core.util.StringUtils
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.invoice.model.InvoiceDto
;
import
com.cftech.invoice.service.InvoiceService
;
import
com.cftech.order.model.*
;
import
com.cftech.order.dao.OrderMapper
;
import
com.cftech.order.service.OrderService
;
...
...
@@ -13,12 +19,14 @@ import com.cftech.core.generic.GenericDao;
import
com.cftech.core.generic.GenericServiceImpl
;
import
com.cftech.core.sql.Conds
;
import
com.cftech.order.utils.InvoiceUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.Serializable
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -40,6 +48,14 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
private
MpAccountsService
mpAccountsService
;
private
Order
orders
;
@Autowired
private
InvoiceUtil
invoiceUtil
;
@Autowired
private
InvoiceService
invoiceService
;
@Override
public
GenericDao
<
Order
>
getGenericMapper
()
{
return
orderMapper
;
...
...
@@ -274,4 +290,63 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return
orderMapper
.
isThreeUsers
(
openid
);
}
@Override
public
JSONObject
invoice
(
InvoiceDto
invoiceDto
)
{
JSONObject
jsonObject
=
new
JSONObject
();
MpAccountsEntity
mpAccountsEntity
=
null
;
if
(
StringUtils
.
isNotBlank
(
invoiceDto
.
getAppId
())){
mpAccountsEntity
=
mpAccountsService
.
getMpAccountsAppid
(
invoiceDto
.
getAppId
());
}
else
{
jsonObject
.
put
(
"errorNo"
,
"2"
);
jsonObject
.
put
(
"errorMsg"
,
"appId不能为空"
);
return
jsonObject
;
}
try
{
Conds
conds
=
new
Conds
();
conds
.
in
(
"o.id"
,
invoiceDto
.
getId
().
split
(
","
));
conds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
List
<
Order
>
list
=
orderMapper
.
fetchSearchBy
(
conds
,
null
,
0
,
0
,
null
);
if
(
list
.
size
()
>
0
){
for
(
Order
order
:
list
){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
order
.
setCreateTimeStr
(
format
.
format
(
order
.
getCreateTime
()));
String
str
=
invoiceUtil
.
startInvoice
(
order
,
order
.
getNickName
(),
invoiceDto
.
getEmail
(),
"0"
,
"0"
);
JSONObject
json
=
JSON
.
parseObject
(
str
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
json
.
getString
(
"code"
))
&&
json
.
getString
(
"code"
).
equals
(
"E0000"
)){
//开票成功 添加一条开票记录
//流水号
String
invoiceSerialNum
=
json
.
getJSONObject
(
"result"
).
getString
(
"invoiceSerialNum"
);
Invoice
invoice
=
new
Invoice
();
//发票抬头
if
(
invoiceDto
.
getType
().
equals
(
"1"
)){
//抬头类型为公司则设置发票抬头
invoice
.
setInvoiceTitle
(
invoiceDto
.
getInvoiceTitle
());
}
invoice
.
setInvoiceContent
(
invoiceDto
.
getInvoiceContent
());
invoice
.
setInvoiceType
(
"1"
);
invoice
.
setInvoiceForm
(
"1"
);
invoice
.
setClerkId
(
order
.
getMemberName
());
invoice
.
setOrderId
(
order
.
getNumber
());
invoice
.
setPushMode
(
"0"
);
invoice
.
setEmail
(
invoiceDto
.
getEmail
());
invoice
.
setStatus
(
"0"
);
invoice
.
setInvoiceSerialNum
(
invoiceSerialNum
);
invoice
.
setAccountsId
(
mpAccountsEntity
.
getId
());
invoiceService
.
save
(
invoice
);
jsonObject
.
put
(
"errorNo"
,
0
);
}
else
{
jsonObject
.
put
(
"errorNo"
,
1
);
jsonObject
.
put
(
"errorMsg"
,
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isEmpty
(
json
.
getString
(
"describe"
))
?
json
.
getString
(
"message"
)
:
json
.
getString
(
"describe"
));
}
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
jsonObject
.
put
(
"errorNo"
,
"1"
);
jsonObject
.
put
(
"errorMsg"
,
"程序异常"
);
}
return
jsonObject
;
}
}
\ No newline at end of file
aidea-modules/order-module/src/main/java/com/cftech/order/utils/InvoiceUtil.java
0 → 100644
View file @
1fdef6e4
This diff is collapsed.
Click to expand it.
aidea-modules/order-module/src/main/java/com/cftech/order/web/MobileOrderController.java
View file @
1fdef6e4
package
com
.
cftech
.
order
.
web
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cftech.invoice.model.InvoiceDto
;
import
com.cftech.order.model.OrderMobileDto
;
import
com.cftech.order.service.OrderService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -57,4 +58,15 @@ public class MobileOrderController {
public
JSONObject
orderList
(
OrderMobileDto
orderMobileDto
)
{
return
orderService
.
orderList
(
orderMobileDto
);
}
/**
* 开票接口
* @Author BuYJ
* @param invoiceDto
* @return
*/
@RequestMapping
(
value
=
"/invoice"
,
method
=
{
RequestMethod
.
POST
},
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
JSONObject
invoice
(
@RequestBody
InvoiceDto
invoiceDto
){
return
orderService
.
invoice
(
invoiceDto
);
}
}
aidea-modules/order-module/src/main/java/com/cftech/order/web/OrderController.java
View file @
1fdef6e4
package
com
.
cftech
.
order
.
web
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.cftech.core.util.SystemConfig
;
import
com.cftech.invoice.model.Invoice
;
import
com.cftech.invoice.service.InvoiceService
;
import
com.cftech.accounts.model.MpAccountsEntity
;
import
com.cftech.accounts.service.MpAccountsService
;
import
com.cftech.base.org.api.QyMsgUtil
;
...
...
@@ -20,6 +24,7 @@ import com.cftech.core.sql.Conds;
import
com.cftech.core.sql.Sort
;
import
com.cftech.core.util.Constants
;
import
com.cftech.order.utils.DoubleJSONFilter
;
import
com.cftech.order.utils.InvoiceUtil
;
import
com.cftech.orderdetail.web.OrderDetailsController
;
import
com.cftech.sys.security.UserUtils
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -38,7 +43,6 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.File
;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -68,6 +72,12 @@ public class OrderController {
@Autowired
private
OrderDetailsController
orderDetailsController
;
@Autowired
private
InvoiceService
invoiceService
;
@Autowired
private
InvoiceUtil
invoiceUtil
;
@Autowired
private
MpAccountsService
accountsService
;
...
...
@@ -228,6 +238,58 @@ public class OrderController {
return
rtnJson
;
}
//开发票
@RequiresPermissions
(
value
=
ORDER_EDIT
)
@RequestMapping
(
"/invoice"
)
@ResponseBody
public
JSONObject
invoice
(
String
id
,
HttpServletRequest
request
,
String
email
){
JSONObject
jsonObject
=
new
JSONObject
();
Long
userid
=
UserUtils
.
getUser
().
getUserid
();
Long
accountsId
=
UserUtils
.
getmpaccounts
(
request
);
try
{
Conds
conds
=
new
Conds
();
conds
.
in
(
"o.id"
,
id
.
split
(
","
));
conds
.
equal
(
"o.del_flag"
,
Constants
.
DEL_FLAG_0
);
conds
.
equal
(
"o.accounts_id"
,
accountsId
);
List
<
Order
>
list
=
orderService
.
fetchSearchBy
(
conds
,
null
,
0
,
0
,
userid
);
if
(
list
.
size
()
>
0
){
for
(
Order
order
:
list
){
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
order
.
setCreateTimeStr
(
format
.
format
(
order
.
getCreateTime
()));
String
str
=
invoiceUtil
.
startInvoice
(
order
,
String
.
valueOf
(
userid
),
email
,
"0"
,
"1"
);
JSONObject
json
=
JSON
.
parseObject
(
str
);
if
(
StringUtils
.
isNotBlank
(
json
.
getString
(
"code"
))
&&
json
.
getString
(
"code"
).
equals
(
"E0000"
)){
//开票成功 添加一条开票记录
//流水号
String
invoiceSerialNum
=
json
.
getJSONObject
(
"result"
).
getString
(
"invoiceSerialNum"
);
Invoice
invoice
=
new
Invoice
();
//发票抬头
//invoice.setInvoiceTitle("0");
invoice
.
setInvoiceContent
(
"商品费用"
);
invoice
.
setInvoiceType
(
"1"
);
invoice
.
setInvoiceForm
(
"1"
);
invoice
.
setClerkId
(
SystemConfig
.
p
.
getProperty
(
"CLERK"
));
invoice
.
setOrderId
(
order
.
getNumber
());
invoice
.
setPushMode
(
"0"
);
invoice
.
setEmail
(
email
);
invoice
.
setStatus
(
"0"
);
invoice
.
setInvoiceSerialNum
(
invoiceSerialNum
);
invoice
.
setAccountsId
(
accountsId
);
invoiceService
.
save
(
invoice
);
jsonObject
.
put
(
"errorNo"
,
0
);
}
else
{
jsonObject
.
put
(
"errorNo"
,
1
);
jsonObject
.
put
(
"errorMsg"
,
StringUtils
.
isEmpty
(
json
.
getString
(
"describe"
))
?
json
.
getString
(
"message"
)
:
json
.
getString
(
"describe"
));
}
}
}
}
catch
(
Exception
e
)
{
jsonObject
.
put
(
"errorNo"
,
1
);
}
return
jsonObject
;
}
//删除数据
@RequiresPermissions
(
value
=
ORDER_EDIT
)
@RequestMapping
(
"/delete"
)
...
...
aidea-modules/pom.xml
View file @
1fdef6e4
...
...
@@ -32,6 +32,8 @@
<module>
waybill-module-web
</module>
<module>
authentication-module
</module>
<module>
authentication-module-web
</module>
<module>
invoice-module
</module>
<module>
invoice-module-web
</module>
</modules>
...
...
aidea-modules/product-module-web/src/main/webapp/WEB-INF/views/product/productform.html
View file @
1fdef6e4
...
...
@@ -208,6 +208,16 @@
name=
"price"
placeholder=
"价格"
>
</div>
<div
class=
"form-group form-md-line-input col-md-12"
>
<label>
单位
</label>
<select
name=
"unit"
class=
"form-control pull-right"
>
<option
label=
"盒"
value=
"盒"
>
盒
</option>
<option
label=
"瓶"
value=
"瓶"
#
if
($
data
.
unit =
=
'瓶')
selected
#
end
>
瓶
</option>
<option
label=
"包"
value=
"包"
#
if
($
data
.
unit =
=
'包')
selected
#
end
>
包
</option>
</select>
</div>
<input
type=
"hidden"
id=
"redingType"
name=
"redingType"
value=
"$!{data.isreading}"
/>
<input
type=
"hidden"
id=
"sizeType"
name=
"sizeType"
value=
"$!{data.size}"
/>
<div
class=
"form-group form-md-line-input col-md-12"
>
...
...
aidea-modules/product-module/src/main/java/com/cftech/product/dao/ProductMapper.xml
View file @
1fdef6e4
...
...
@@ -33,6 +33,7 @@
<result
column=
"reading"
property=
"reading"
/>
<result
column=
"size"
property=
"size"
/>
<result
column=
"isreading"
property=
"isreading"
/>
<result
column=
"unit"
property=
"unit"
/>
</resultMap>
<sql
id=
"sqlWhere"
>
...
...
@@ -92,7 +93,8 @@
is_rs,
reading,
size,
isreading
isreading,
unit
</sql>
<sql
id=
"productList"
>
...
...
@@ -159,7 +161,8 @@
#{isRs,jdbcType=VARCHAR},
#{reading,jdbcType=VARCHAR},
#{size, jdbcType=BIGINT},
#{isreading, jdbcType=BIGINT}
#{isreading, jdbcType=BIGINT},
#{unit,jdbcType=VARCHAR}
)
</insert>
...
...
@@ -347,6 +350,9 @@
<if
test=
"size != null"
>
size = #{size, jdbcType=BIGINT},
</if>
<if
test=
"unit != null"
>
unit = #{unit , jdbcType=VARCHAR},
</if>
<if
test=
"isreading != null"
>
isreading = #{isreading , jdbcType=BIGINT}
</if>
...
...
aidea-modules/product-module/src/main/java/com/cftech/product/model/Product.java
View file @
1fdef6e4
...
...
@@ -134,6 +134,10 @@ public class Product implements Serializable {
*/
@ExportConfig
(
value
=
"销量"
,
width
=
200
)
private
String
reading
;
/**
* 单位
*/
private
String
unit
;
/* 所属的账号 */
private
Long
accountsId
;
/* 删除标识 */
...
...
cftech-common-web/src/main/resources/common-test.properties
View file @
1fdef6e4
...
...
@@ -58,6 +58,24 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
#\u987A\u4E30\u6708\u7ED3\u5361\u53F7
sf.monthlyCard
=
7551234567
#INVOICE
INVOICE_TOKEN
=
4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX
=
91321000MA22HQQ953
INVOICE_TAX
=
339901999999824
SALER_TEL
=
0514-82360278
SALER_ADDRESS
=
\u
626C
\u
5DDE
\u
5E02
\u9097\u
6C5F
\u
533A
\u
79D1
\u6280\u
56ED
\u
8DEF18
\u
53F7
APP_KEY
=
SD76454598
APP_SECRET
=
SD25624CC1DF4AB7
KAIHUHANG_ADDRESS
=
\u
6C5F
\u
82CF
\u
94F6
\u
884C
\u
626C
\u
5DDE
\u5510\u
57CE
\u
652F
\u
884C 90160188000128434
CLERK
=
\u5415\u5029
CHECKER
=
\u7530\u
59DD
PAYEE
=
\u
6C6A
\u
8A00
\u
52C7
INVOICE_API
=
nuonuo.ElectronInvoice.requestBillingNew
INVOICE_URL
=
https://sandbox.nuonuocs.cn/open/v1/services
...
...
qy-modules/qy-orgunit-module-web/src/main/webapp/WEB-INF/views/managerqyuser/qyuserlist.html
View file @
1fdef6e4
...
...
@@ -502,7 +502,7 @@
success
:
function
()
{
$
.
ajax
({
"type"
:
"post"
,
"url"
:
setPeakValUrl
,
"url"
:
setPeakValUrl
,
"dataType"
:
"json"
,
"data"
:
{
id
:
$
(
"#peakId"
).
val
(),
peakVal
:
$
(
"#peakVal"
).
val
(),
_csrf_header
:
csrfheader
.
value
,
_csrf
:
csrftoken
.
value
},
//以json格式传递
"success"
:
function
(
data
)
{
...
...
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