|
|
|
|
84
|
* 保存对象
|
84
|
* 保存对象
|
85
|
* @return
|
85
|
* @return
|
86
|
*/
|
86
|
*/
|
|
|
87
|
+ @CrossOrigin(origins = "*", maxAge = 3600)
|
87
|
@RequestMapping(value="/official/taOfficeContact",method= RequestMethod.POST)
|
88
|
@RequestMapping(value="/official/taOfficeContact",method= RequestMethod.POST)
|
88
|
- public ResponseBean taOfficeContactAdd(HttpServletRequest request, HttpServletResponse response){
|
|
|
89
|
- TaOfficeContact taOfficeContact = new TaOfficeContact();
|
|
|
90
|
- //跨域请求,*代表允许全部类型
|
|
|
91
|
- response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
92
|
- //允许请求方式
|
|
|
93
|
- response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
|
|
|
94
|
- //用来指定本次预检请求的有效期,单位为秒,在此期间不用发出另一条预检请求
|
|
|
95
|
- response.setHeader("Access-Control-Max-Age", "3600");
|
|
|
96
|
- //请求包含的字段内容,如有多个可用哪个逗号分隔如下
|
|
|
97
|
- response.setHeader("Access-Control-Allow-Headers", "content-type,x-requested-with,Authorization, x-ui-request,lang");
|
|
|
98
|
- //访问控制允许凭据,true为允许
|
|
|
99
|
- response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
|
|
|
89
|
+ public ResponseBean taOfficeContactAdd(@RequestBody TaOfficeContact taOfficeContact){
|
100
|
ResponseBean responseBean = new ResponseBean();
|
90
|
ResponseBean responseBean = new ResponseBean();
|
101
|
try {
|
91
|
try {
|
102
|
- Map<String, String[]> parameterMap = request.getParameterMap();
|
|
|
103
|
-
|
|
|
104
|
// 主键格式 20200611001 日期 + 数字, 数字 3 位, 前面补 0
|
92
|
// 主键格式 20200611001 日期 + 数字, 数字 3 位, 前面补 0
|
105
|
String today = DateUtils.todayCompact();
|
93
|
String today = DateUtils.todayCompact();
|
106
|
Integer no = dbUtils.nextVal(SEQ_PREFIX + "-" + today);
|
94
|
Integer no = dbUtils.nextVal(SEQ_PREFIX + "-" + today);
|
107
|
taOfficeContact.setSerialNo(StringUtils.lpad(no.toString(), "0", 3));
|
95
|
taOfficeContact.setSerialNo(StringUtils.lpad(no.toString(), "0", 3));
|
108
|
- taOfficeContact.setCompany(request.getParameter("company"));
|
|
|
109
|
taOfficeContact.setCreateDate(LocalDateTime.now());
|
96
|
taOfficeContact.setCreateDate(LocalDateTime.now());
|
110
|
- taOfficeContact.setDemand(request.getParameter("demand"));
|
|
|
111
|
- taOfficeContact.setEmail(request.getParameter("email"));
|
|
|
112
|
- taOfficeContact.setName(request.getParameter("name"));
|
|
|
113
|
- taOfficeContact.setPhone(request.getParameter("phone"));
|
|
|
114
|
taOfficeContact.setStatus(CommConstant.STATUS_NORMAL);
|
97
|
taOfficeContact.setStatus(CommConstant.STATUS_NORMAL);
|
115
|
if (iTaOfficeContactService.save(taOfficeContact)){
|
98
|
if (iTaOfficeContactService.save(taOfficeContact)){
|
116
|
responseBean.addSuccess(taOfficeContact);
|
99
|
responseBean.addSuccess(taOfficeContact);
|
|
|
|
|
124
|
}
|
107
|
}
|
125
|
return responseBean;
|
108
|
return responseBean;
|
126
|
}
|
109
|
}
|
127
|
-
|
|
|
128
|
- /**
|
|
|
129
|
- * 保存对象
|
|
|
130
|
- *
|
|
|
131
|
- * @return
|
|
|
132
|
- */
|
|
|
133
|
- @RequestMapping(value="/official/taOfficeContact",method= RequestMethod.OPTIONS)
|
|
|
134
|
- public ResponseBean taOfficeContactOptions(HttpServletRequest request, HttpServletResponse response){
|
|
|
135
|
- //跨域请求,*代表允许全部类型
|
|
|
136
|
- response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
137
|
- //允许请求方式
|
|
|
138
|
- response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
|
|
|
139
|
- //用来指定本次预检请求的有效期,单位为秒,在此期间不用发出另一条预检请求
|
|
|
140
|
- response.setHeader("Access-Control-Max-Age", "3600");
|
|
|
141
|
- //请求包含的字段内容,如有多个可用哪个逗号分隔如下
|
|
|
142
|
- response.setHeader("Access-Control-Allow-Headers", "content-type,x-requested-with,Authorization, x-ui-request,lang");
|
|
|
143
|
- //访问控制允许凭据,true为允许
|
|
|
144
|
- response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
|
145
|
- response.setCharacterEncoding("utf-8");
|
|
|
146
|
-
|
|
|
147
|
- return ResponseBean.success("success");
|
|
|
148
|
- }
|
|
|
|
|
110
|
+//
|
|
|
111
|
+// /**
|
|
|
112
|
+// * 保存对象
|
|
|
113
|
+// *
|
|
|
114
|
+// * @return
|
|
|
115
|
+// */
|
|
|
116
|
+// @RequestMapping(value="/official/taOfficeContact",method= RequestMethod.OPTIONS)
|
|
|
117
|
+// public ResponseBean taOfficeContactOptions(HttpServletRequest request, HttpServletResponse response){
|
|
|
118
|
+// //跨域请求,*代表允许全部类型
|
|
|
119
|
+// response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
120
|
+// //允许请求方式
|
|
|
121
|
+// response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
|
|
|
122
|
+// //用来指定本次预检请求的有效期,单位为秒,在此期间不用发出另一条预检请求
|
|
|
123
|
+// response.setHeader("Access-Control-Max-Age", "3600");
|
|
|
124
|
+// //请求包含的字段内容,如有多个可用哪个逗号分隔如下
|
|
|
125
|
+// response.setHeader("Access-Control-Allow-Headers", "content-type,x-requested-with,Authorization, x-ui-request,lang");
|
|
|
126
|
+// //访问控制允许凭据,true为允许
|
|
|
127
|
+// response.setHeader("Access-Control-Allow-Credentials", "true");
|
|
|
128
|
+// response.setCharacterEncoding("utf-8");
|
|
|
129
|
+//
|
|
|
130
|
+// return ResponseBean.success("success");
|
|
|
131
|
+// }
|
149
|
|
132
|
|
150
|
/**
|
133
|
/**
|
151
|
* 根据id删除对象
|
134
|
* 根据id删除对象
|