Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_53077510
production_ssm
提交
4cbcbaa0
P
production_ssm
项目概览
weixin_53077510
/
production_ssm
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
production_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4cbcbaa0
编写于
9月 28, 2016
作者:
M
megagao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加了文件
上级
e84304ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
336 addition
and
0 deletion
+336
-0
src/main/java/org/hqu/production_ms/domain/po/COrderPO.java
src/main/java/org/hqu/production_ms/domain/po/COrderPO.java
+128
-0
src/main/resources/mybatis/sqlMapConfig.xml
src/main/resources/mybatis/sqlMapConfig.xml
+17
-0
src/main/webapp/WEB-INF/jsp/order_add.jsp
src/main/webapp/WEB-INF/jsp/order_add.jsp
+144
-0
src/main/webapp/validatecode.jsp
src/main/webapp/validatecode.jsp
+47
-0
未找到文件。
src/main/java/org/hqu/production_ms/domain/po/COrderPO.java
0 → 100644
浏览文件 @
4cbcbaa0
package
org.hqu.production_ms.domain.po
;
import
java.math.BigDecimal
;
import
java.util.Date
;
public
class
COrderPO
{
private
String
orderId
;
private
Date
orderDate
;
private
Date
requestDate
;
private
String
note
;
private
Integer
quantity
;
private
BigDecimal
unitPrice
;
private
String
unit
;
private
String
image
;
private
String
file
;
private
Integer
status
;
private
String
customId
;
private
String
productId
;
public
String
getOrderId
()
{
return
orderId
;
}
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
==
null
?
null
:
orderId
.
trim
();
}
public
Date
getOrderDate
()
{
return
orderDate
;
}
public
void
setOrderDate
(
Date
orderDate
)
{
this
.
orderDate
=
orderDate
;
}
public
Date
getRequestDate
()
{
return
requestDate
;
}
public
void
setRequestDate
(
Date
requestDate
)
{
this
.
requestDate
=
requestDate
;
}
public
String
getNote
()
{
return
note
;
}
public
void
setNote
(
String
note
)
{
this
.
note
=
note
==
null
?
null
:
note
.
trim
();
}
public
Integer
getQuantity
()
{
return
quantity
;
}
public
void
setQuantity
(
Integer
quantity
)
{
this
.
quantity
=
quantity
;
}
public
BigDecimal
getUnitPrice
()
{
return
unitPrice
;
}
public
void
setUnitPrice
(
BigDecimal
unitPrice
)
{
this
.
unitPrice
=
unitPrice
;
}
public
String
getUnit
()
{
return
unit
;
}
public
void
setUnit
(
String
unit
)
{
this
.
unit
=
unit
==
null
?
null
:
unit
.
trim
();
}
public
String
getFile
()
{
return
file
;
}
public
void
setFile
(
String
file
)
{
this
.
file
=
file
==
null
?
null
:
file
.
trim
();
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
String
getCustomId
()
{
return
customId
;
}
public
void
setCustomId
(
String
customId
)
{
this
.
customId
=
customId
;
}
public
String
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
String
productId
)
{
this
.
productId
=
productId
;
}
public
String
getImage
()
{
return
image
;
}
public
void
setImage
(
String
image
)
{
this
.
image
=
image
;
}
}
\ No newline at end of file
src/main/resources/mybatis/sqlMapConfig.xml
0 → 100644
浏览文件 @
4cbcbaa0
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<typeAliases>
<!--
通过package, 可以直接指定package的名字, mybatis会自动扫描你指定包下面的javabean,
并且默认设置一个别名,默认的名字为: javabean 的首字母小写的非限定类名来作为它的别名。
也可在javabean 加上注解@Alias 来自定义别名, 例如: @Alias(user)
-->
<package
name=
"org.hqu.production_ms.domain"
/>
<package
name=
"org.hqu.production_ms.domain.authority"
/>
</typeAliases>
</configuration>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/order_add.jsp
0 → 100644
浏览文件 @
4cbcbaa0
<%@ page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%>
<link
href=
"js/kindeditor-4.1.10/themes/default/default.css"
type=
"text/css"
rel=
"stylesheet"
>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"js/kindeditor-4.1.10/kindeditor-all-min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"js/kindeditor-4.1.10/lang/zh_CN.js"
></script>
<div
style=
"padding:10px 10px 10px 10px"
>
<form
id=
"itemAddForm"
class=
"itemForm"
method=
"post"
>
<table
cellpadding=
"5"
>
<tr>
<td>
订购客户:
</td>
<td>
<input
id=
"custom"
class=
"easyui-combobox"
name=
"customId"
data-options=
"required:true,valueField:'customId',textField:'customName',url:'custom/get_data'"
/>
</td>
</tr>
<tr>
<td>
订购产品:
</td>
<td>
<input
id=
"product"
class=
"easyui-combobox"
name=
"productId"
data-options=
"valueField:'productId',textField:'productName',url:'product/get_data'"
/>
</td>
</tr>
<tr>
<td>
订购数量:
</td>
<td><input
class=
"easyui-numberbox"
type=
"text"
name=
"quantity"
data-options=
"min:1,max:99999999,precision:0,required:true"
/></td>
</tr>
<tr>
<td>
税前单价:
</td>
<td><input
class=
"easyui-numberbox"
type=
"text"
name=
"unitPrice"
data-options=
"min:1,max:99999999,precision:2,required:true"
/>
<input
type=
"hidden"
name=
"price"
/>
</td>
</tr>
<tr>
<td>
单位:
</td>
<td><input
class=
"easyui-textbox"
type=
"text"
name=
"unit"
data-options=
"required:true"
style=
"width: 280px;"
></input></td>
</tr>
<tr>
<td>
订单状态:
</td>
<td>
<select
id=
"cc"
class=
"easyui-combobox"
name=
"status"
style=
"width:200px;"
data-options=
"required:true,width:150"
>
<option
value=
"1"
>
未开始
</option>
<option
value=
"2"
>
已开始
</option>
<option
value=
"3"
>
订单取消
</option>
<option
value=
"4"
>
已完成
</option>
</select>
</td>
</tr>
<tr>
<td>
订购日期:
</td>
<td><input
class=
"easyui-datetimebox"
name=
"orderDate"
data-options=
"required:true,showSeconds:true"
value=
"5/5/2016 00:00:00"
style=
"width:150px"
>
</td>
</tr>
<tr>
<td>
要求日期:
</td>
<td><input
class=
"easyui-datetimebox"
name=
"requestDate"
data-options=
"required:true,showSeconds:true"
value=
"5/5/2016 00:00:00"
style=
"width:150px"
>
</td>
</tr>
<tr>
<td>
合同扫描件:
</td>
<td>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton picFileUpload"
>
上传图片
</a>
<input
type=
"hidden"
name=
"image"
/>
</td>
</tr>
<tr>
<td>
商品描述:
</td>
<td>
<textarea
style=
"width:800px;height:300px;visibility:hidden;"
name=
"note"
></textarea>
</td>
</tr>
</table>
<input
type=
"hidden"
name=
"itemParams"
/>
</form>
<div
style=
"padding:5px"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"submitForm()"
>
提交
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
onclick=
"clearForm()"
>
重置
</a>
</div>
</div>
<script
type=
"text/javascript"
>
var
itemAddEditor
;
//页面初始化完毕后执行此方法
$
(
function
(){
//创建富文本编辑器
//itemAddEditor = TAOTAO.createEditor("#itemAddForm [name=file]");
itemAddEditor
=
KindEditor
.
create
(
"
#itemAddForm [name=note]
"
,
TT
.
kingEditorParams
);
//初始化类目选择和图片上传器
TAOTAO
.
init
({
fun
:
function
(
node
){
//根据商品的分类id取商品 的规格模板,生成规格信息。第四天内容。
TAOTAO
.
changeItemParam
(
node
,
"
itemAddForm
"
);
}});
});
//提交表单
function
submitForm
(){
//有效性验证
if
(
!
$
(
'
#itemAddForm
'
).
form
(
'
validate
'
)){
$
.
messager
.
alert
(
'
提示
'
,
'
表单还未填写完成!
'
);
return
;
}
//取商品价格,单位为“分”
$
(
"
#itemAddForm [name=price]
"
).
val
(
eval
(
$
(
"
#itemAddForm [name=priceView]
"
).
val
())
*
100
);
//同步文本框中的商品描述
itemAddEditor
.
sync
();
//取商品的规格
var
paramJson
=
[];
$
(
"
#itemAddForm .params li
"
).
each
(
function
(
i
,
e
){
var
trs
=
$
(
e
).
find
(
"
tr
"
);
var
group
=
trs
.
eq
(
0
).
text
();
var
ps
=
[];
for
(
var
i
=
1
;
i
<
trs
.
length
;
i
++
){
var
tr
=
trs
.
eq
(
i
);
ps
.
push
({
"
k
"
:
$
.
trim
(
tr
.
find
(
"
td
"
).
eq
(
0
).
find
(
"
span
"
).
text
()),
"
v
"
:
$
.
trim
(
tr
.
find
(
"
input
"
).
val
())
});
}
paramJson
.
push
({
"
group
"
:
group
,
"
params
"
:
ps
});
});
//把json对象转换成字符串
paramJson
=
JSON
.
stringify
(
paramJson
);
$
(
"
#itemAddForm [name=itemParams]
"
).
val
(
paramJson
);
//ajax的post方式提交表单
//$("#itemAddForm").serialize()将表单序列号为key-value形式的字符串
$
.
post
(
"
order/insert
"
,
$
(
"
#itemAddForm
"
).
serialize
(),
function
(
data
){
if
(
data
.
status
==
200
){
$
.
messager
.
alert
(
'
提示
'
,
'
新增商品成功!
'
);
clearForm
()
}
});
}
function
clearForm
(){
$
(
'
#itemAddForm
'
).
form
(
'
reset
'
);
itemAddEditor
.
html
(
''
);
}
$
(
'
#cc
'
).
combo
({
required
:
true
,
multiple
:
true
});
</script>
src/main/webapp/validatecode.jsp
0 → 100644
浏览文件 @
4cbcbaa0
<%@ page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%>
<%@ page
import=
"java.util.Random"
%>
<%@ page
import=
"java.io.OutputStream"
%>
<%@ page
import=
"java.awt.Color"
%>
<%@ page
import=
"java.awt.Font"
%>
<%@ page
import=
"java.awt.Graphics"
%>
<%@ page
import=
"java.awt.image.BufferedImage"
%>
<%@ page
import=
"javax.imageio.ImageIO"
%>
<%
int
width
=
60
;
int
height
=
32
;
//create the image
BufferedImage
image
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_INT_RGB
);
Graphics
g
=
image
.
getGraphics
();
// set the background color
g
.
setColor
(
new
Color
(
0xDCDCDC
));
g
.
fillRect
(
0
,
0
,
width
,
height
);
// draw the border
g
.
setColor
(
Color
.
black
);
g
.
drawRect
(
0
,
0
,
width
-
1
,
height
-
1
);
// create a random instance to generate the codes
Random
rdm
=
new
Random
();
String
hash1
=
Integer
.
toHexString
(
rdm
.
nextInt
());
System
.
out
.
print
(
hash1
);
// make some confusion
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
int
x
=
rdm
.
nextInt
(
width
);
int
y
=
rdm
.
nextInt
(
height
);
g
.
drawOval
(
x
,
y
,
0
,
0
);
}
// generate a random code
String
capstr
=
hash1
.
substring
(
0
,
4
);
//将生成的验证码存入session
session
.
setAttribute
(
"validateCode"
,
capstr
);
g
.
setColor
(
new
Color
(
0
,
100
,
0
));
g
.
setFont
(
new
Font
(
"Candara"
,
Font
.
BOLD
,
24
));
g
.
drawString
(
capstr
,
8
,
24
);
g
.
dispose
();
//输出图片
response
.
setContentType
(
"image/jpeg"
);
out
.
clear
();
out
=
pageContext
.
pushBody
();
OutputStream
strm
=
response
.
getOutputStream
();
ImageIO
.
write
(
image
,
"jpeg"
,
strm
);
strm
.
close
();
%>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录