Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
MicroCommunity
Commits
d744d9e1
Commit
d744d9e1
authored
3 years ago
by
java110
Browse files
Options
Download
Email Patches
Plain Diff
优化房屋收费 修改为cmd 模式
parent
a20991a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java
+10
-11
...erator/src/main/java/com/java110/code/TableToJsonWeb.java
java110-generator/src/main/resources/web/template_1.json
+28
-24
java110-generator/src/main/resources/web/template_1.json
service-fee/src/main/java/com/java110/fee/cmd/fee/ListRoomsWhereFeeSetCmd.java
+20
-66
...java/com/java110/fee/cmd/fee/ListRoomsWhereFeeSetCmd.java
with
58 additions
and
101 deletions
+58
-101
java110-generator/src/main/java/com/java110/code/TableToJsonWeb.java
+
10
-
11
View file @
d744d9e1
...
...
@@ -7,20 +7,19 @@ import com.java110.utils.util.StringUtil;
public
class
TableToJsonWeb
{
//show create table c_orders 用这个语句获取
public
static
final
String
createTableSql
=
"CREATE TABLE `inspection_item` (\n"
+
" `item_id` varchar(30) NOT NULL COMMENT '主键ID',\n"
+
" `item_name` varchar(256) NOT NULL COMMENT '巡检项目',\n"
+
" `community_id` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '小区ID',\n"
+
" `remark` varchar(512) DEFAULT NULL COMMENT '备注',\n"
+
")"
;
public
static
final
String
createTableSql
=
"CREATE TABLE waf_ip_black_white(\n"
+
" id varchar(64) not null COMMENT '编号',\n"
+
" type_cd varchar(64) not null COMMENT '类型',\n"
+
" ip varchar(64) not null COMMENT 'IP'\n"
+
");"
;
public
static
void
main
(
String
[]
args
)
{
String
templateName
=
"
巡检项目
"
;
//业务名称
String
templateCode
=
"
inspectionI
te
m
"
;
//表名大写
String
templateKey
=
"i
temI
d"
;
//表主键
String
templateName
=
"
黑白名单
"
;
//业务名称
String
templateCode
=
"
wafIpBlackWhi
te"
;
//表名大写
String
templateKey
=
"id"
;
//表主键
String
templateKeyName
=
"编号"
;
//主键说明
String
searchCode
=
"i
temI
d"
;
//分片字段
String
searchCode
=
"id"
;
//分片字段
String
searchName
=
"编号"
;
//分片字段说明
String
directories
=
"
property
"
;
//前端生成到那个目录下
String
directories
=
"
admin
"
;
//前端生成到那个目录下
// templateName 业务名称 业务编码名称生成后文件名 templateCode 主键 templateKey
// 业务主键名称 templateKeyName=templateName+ID 主机驼峰 searchCode 主键名称 searchName
// directories 放在前端那个目录下
...
...
This diff is collapsed.
Click to expand it.
java110-generator/src/main/resources/web/template_1.json
+
28
-
24
View file @
d744d9e1
{
"templateKeyName"
:
"编号"
,
"templateName"
:
"
巡检项目
"
,
"templateName"
:
"
黑白名单
"
,
"columns"
:
[
{
"hasDefaultValue"
:
false
,
"limitParam"
:
"
25
6"
,
"code"
:
"
itemName
"
,
"limitErrInfo"
:
"
巡检项目
不能超过
25
6"
,
"cnCode"
:
"
巡检项目
"
,
"limitParam"
:
"6
4
"
,
"code"
:
"
typeCd
"
,
"limitErrInfo"
:
"
类型
不能超过6
4
"
,
"cnCode"
:
"
类型
"
,
"limit"
:
"maxLength"
,
"show"
:
true
,
"inputType"
:
"input"
,
"inputType"
:
"select"
,
"selectValue"
:
"B,W"
,
"selectValueName"
:
"黑名单,白名单"
,
"required"
:
true
,
"desc"
:
"必填,
巡检项目
"
"desc"
:
"必填,
类型
"
},
{
"hasDefaultValue"
:
false
,
"limitParam"
:
"
512
"
,
"code"
:
"
remark
"
,
"limitErrInfo"
:
"
备注
不能超过
512
"
,
"cnCode"
:
"
备注
"
,
"limitParam"
:
"
64
"
,
"code"
:
"
ip
"
,
"limitErrInfo"
:
"
IP'
不能超过
64
"
,
"cnCode"
:
"
IP'
"
,
"limit"
:
"maxLength"
,
"show"
:
true
,
"inputType"
:
"input"
,
"required"
:
true
,
"desc"
:
"
备注
"
"desc"
:
"
必填,IP
"
}
],
"searchName"
:
"编号"
,
"directories"
:
"
property
"
,
"searchCode"
:
"i
temI
d"
,
"templateCode"
:
"
inspectionI
te
m
"
,
"directories"
:
"
admin
"
,
"searchCode"
:
"id"
,
"templateCode"
:
"
wafIpBlackWhi
te"
,
"conditions"
:
[
{
"whereCondition"
:
"equal"
,
"code"
:
"i
temI
d"
,
"name"
:
"
主键ID
"
,
"code"
:
"id"
,
"name"
:
"
编号
"
,
"inputType"
:
"input"
},
{
"whereCondition"
:
"equal"
,
"code"
:
"itemName"
,
"name"
:
"巡检项目"
,
"inputType"
:
"input"
"code"
:
"typeCd"
,
"name"
:
"类型"
,
"inputType"
:
"select"
,
"selectValue"
:
"B,W"
,
"selectValueName"
:
"黑名单,白名单"
},
{
"whereCondition"
:
"equal"
,
"code"
:
"
communityId
"
,
"name"
:
"
小区ID
"
,
"code"
:
"
ip
"
,
"name"
:
"
IP
"
,
"inputType"
:
"input"
}
],
"templateKey"
:
"i
temI
d"
}
"templateKey"
:
"id"
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
service-
api
/src/main/java/com/java110/
api/listener
/fee/ListRoomsWhereFeeSet
Listener
.java
→
service-
fee
/src/main/java/com/java110/
fee/cmd
/fee/ListRoomsWhereFeeSet
Cmd
.java
100755 → 100644
+
20
-
66
View file @
d744d9e1
package
com.java110.
api.listener
.fee
;
package
com.java110.
fee.cmd
.fee
;
import
com.alibaba.fastjson.JSONObject
;
import
com.java110.api.listener.AbstractServiceApiListener
;
import
com.java110.core.annotation.Java110Listener
;
import
com.java110.core.annotation.Java110Cmd
;
import
com.java110.core.context.DataFlowContext
;
import
com.java110.core.context.ICmdDataFlowContext
;
import
com.java110.core.event.cmd.AbstractServiceCmdListener
;
import
com.java110.core.event.cmd.CmdEvent
;
import
com.java110.dto.RoomDto
;
import
com.java110.dto.basePrivilege.BasePrivilegeDto
;
import
com.java110.dto.owner.OwnerDto
;
import
com.java110.dto.owner.OwnerRoomRelDto
;
import
com.java110.intf.community.IMenuInnerServiceSMO
;
import
com.java110.intf.community.IRoomInnerServiceSMO
;
import
com.java110.intf.user.IOwnerInnerServiceSMO
;
import
com.java110.intf.user.IOwnerRoomRelInnerServiceSMO
;
import
com.java110.intf.community.IRoomInnerServiceSMO
;
import
com.java110.dto.RoomDto
;
import
com.java110.dto.owner.OwnerDto
;
import
com.java110.dto.owner.OwnerRoomRelDto
;
import
com.java110.core.event.service.api.ServiceDataFlowEvent
;
import
com.java110.utils.constant.ServiceCodeFeeConfigConstant
;
import
com.java110.utils.exception.CmdException
;
import
com.java110.utils.util.Assert
;
import
com.java110.utils.util.BeanConvertUtil
;
import
com.java110.utils.util.StringUtil
;
import
com.java110.vo.api.ApiRoomDataVo
;
import
com.java110.vo.api.ApiRoomVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -28,12 +28,8 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
/**
* 查询需要设置费用的房屋
*/
@Java110Listener
(
"listRoomsWhereFeeSetListener"
)
public
class
ListRoomsWhereFeeSetListener
extends
AbstractServiceApiListener
{
@Java110Cmd
(
serviceCode
=
"fee.listRoomsWhereFeeSet"
)
public
class
ListRoomsWhereFeeSetCmd
extends
AbstractServiceCmdListener
{
@Autowired
private
IRoomInnerServiceSMO
roomInnerServiceSMOImpl
;
...
...
@@ -48,35 +44,17 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
private
IMenuInnerServiceSMO
menuInnerServiceSMOImpl
;
@Override
public
String
getServiceCode
()
{
return
ServiceCodeFeeConfigConstant
.
LIST_ROOMS_WHERE_FEE_SET
;
}
@Override
public
HttpMethod
getHttpMethod
()
{
return
HttpMethod
.
GET
;
}
@Override
public
int
getOrder
()
{
return
DEFAULT_ORDER
;
}
@Override
protected
void
validate
(
ServiceDataFlowEvent
event
,
JSONObject
reqJson
)
{
public
void
validate
(
CmdEvent
event
,
ICmdDataFlowContext
cmdDataFlowContext
,
JSONObject
reqJson
)
throws
CmdException
{
super
.
validatePageInfo
(
reqJson
);
Assert
.
hasKeyAndValue
(
reqJson
,
"communityId"
,
"未包含小区ID"
);
}
@Override
protected
void
doSoService
(
ServiceDataFlowEvent
event
,
DataFlowContext
context
,
JSONObject
reqJson
)
{
public
void
doCmd
(
CmdEvent
event
,
ICmdDataFlowContext
cmdDataFlowContext
,
JSONObject
reqJson
)
throws
CmdException
{
ApiRoomVo
apiRoomVo
=
new
ApiRoomVo
();
//根据 业主来定位房屋信息
if
(
reqJson
.
containsKey
(
"ownerName"
)
||
reqJson
.
containsKey
(
"idCard"
)
||
reqJson
.
containsKey
(
"ownerNameLike"
))
{
queryRoomByOwnerInfo
(
apiRoomVo
,
reqJson
,
context
);
queryRoomByOwnerInfo
(
apiRoomVo
,
reqJson
,
c
mdDataFlowC
ontext
);
return
;
}
...
...
@@ -87,10 +65,9 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
apiRoomVo
.
setTotal
(
total
);
if
(
total
>
0
)
{
List
<
RoomDto
>
roomDtoList
=
roomInnerServiceSMOImpl
.
queryRooms
(
roomDto
);
String
userId
=
context
.
getUserId
();
//获取手机号、身份证号加密标识
String
flag
=
reqJson
.
getString
(
"flag"
);
refreshRoomOwners
(
userId
,
reqJson
.
getString
(
"communityId"
),
roomDtoList
,
flag
);
refreshRoomOwners
(
reqJson
.
getString
(
"
userId
"
)
,
reqJson
.
getString
(
"communityId"
),
roomDtoList
,
flag
);
apiRoomVo
.
setRooms
(
BeanConvertUtil
.
covertBeanList
(
roomDtoList
,
ApiRoomDataVo
.
class
));
}
else
{
...
...
@@ -100,17 +77,18 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
apiRoomVo
.
setRecords
((
int
)
Math
.
ceil
((
double
)
total
/
(
double
)
row
));
ResponseEntity
<
String
>
responseEntity
=
new
ResponseEntity
<
String
>(
JSONObject
.
toJSONString
(
apiRoomVo
),
HttpStatus
.
OK
);
context
.
setResponseEntity
(
responseEntity
);
c
mdDataFlowC
ontext
.
setResponseEntity
(
responseEntity
);
}
/**
* 根据业主查询 房屋信息
*
* @param apiRoomVo
* @param reqJson
*/
private
void
queryRoomByOwnerInfo
(
ApiRoomVo
apiRoomVo
,
JSONObject
reqJson
,
DataFlowContext
context
)
{
private
void
queryRoomByOwnerInfo
(
ApiRoomVo
apiRoomVo
,
JSONObject
reqJson
,
ICmd
DataFlowContext
c
mdDataFlowC
ontext
)
{
OwnerRoomRelDto
ownerRoomRelDto
=
BeanConvertUtil
.
covertBean
(
reqJson
,
OwnerRoomRelDto
.
class
);
ownerRoomRelDto
.
setByOwnerInfo
(
true
);
...
...
@@ -130,7 +108,7 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
apiRoomVo
.
setRecords
((
int
)
Math
.
ceil
((
double
)
apiRoomVo
.
getRooms
().
size
()
/
(
double
)
row
));
ResponseEntity
<
String
>
responseEntity
=
new
ResponseEntity
<
String
>(
JSONObject
.
toJSONString
(
apiRoomVo
),
HttpStatus
.
OK
);
context
.
setResponseEntity
(
responseEntity
);
c
mdDataFlowC
ontext
.
setResponseEntity
(
responseEntity
);
}
private
List
<
RoomDto
>
refreshOwnerRooms
(
String
communityId
,
List
<
OwnerRoomRelDto
>
ownerRoomRelDtos
)
{
...
...
@@ -195,30 +173,6 @@ public class ListRoomsWhereFeeSetListener extends AbstractServiceApiListener {
}
}
public
IRoomInnerServiceSMO
getRoomInnerServiceSMOImpl
()
{
return
roomInnerServiceSMOImpl
;
}
public
void
setRoomInnerServiceSMOImpl
(
IRoomInnerServiceSMO
roomInnerServiceSMOImpl
)
{
this
.
roomInnerServiceSMOImpl
=
roomInnerServiceSMOImpl
;
}
public
IOwnerInnerServiceSMO
getOwnerInnerServiceSMOImpl
()
{
return
ownerInnerServiceSMOImpl
;
}
public
void
setOwnerInnerServiceSMOImpl
(
IOwnerInnerServiceSMO
ownerInnerServiceSMOImpl
)
{
this
.
ownerInnerServiceSMOImpl
=
ownerInnerServiceSMOImpl
;
}
public
IOwnerRoomRelInnerServiceSMO
getOwnerRoomRelInnerServiceSMOImpl
()
{
return
ownerRoomRelInnerServiceSMOImpl
;
}
public
void
setOwnerRoomRelInnerServiceSMOImpl
(
IOwnerRoomRelInnerServiceSMO
ownerRoomRelInnerServiceSMOImpl
)
{
this
.
ownerRoomRelInnerServiceSMOImpl
=
ownerRoomRelInnerServiceSMOImpl
;
}
/**
* 脱敏处理
*
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help