|
@@ -151,8 +151,8 @@ public class BackendStaffController extends BaseController {
|
|
|
@PreAuthorize("@pms.hasPermission('staff:list')")
|
|
|
public ResponseObject saveHandler(HttpServletRequest request, @RequestBody Map<String, Object> params) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
- String id = params.get("id") == null ? "0" : params.get("id").toString();
|
|
|
- String storeId = params.get("storeId") == null ? "0" : params.get("storeId").toString();
|
|
|
+ Long id = Long.valueOf(params.get("id") == null ? "0" : params.get("id").toString());
|
|
|
+ Long storeId = Long.valueOf(params.get("storeId") == null ? "0" : params.get("storeId").toString());
|
|
|
String category = params.get("category") == null ? "0" : params.get("category").toString();
|
|
|
String mobile = params.get("mobile") == null ? "" : CommonUtil.replaceXSS(params.get("mobile").toString());
|
|
|
String realName = params.get("realName") == null ? "" : CommonUtil.replaceXSS(params.get("realName").toString());
|
|
@@ -170,17 +170,17 @@ public class BackendStaffController extends BaseController {
|
|
|
}
|
|
|
|
|
|
MtStaff mtStaff = new MtStaff();
|
|
|
- if (StringUtil.isNotEmpty(id)) {
|
|
|
+ if (StringUtil.isNotEmpty(String.valueOf(id))) {
|
|
|
mtStaff = staffService.queryStaffById(Long.valueOf(id));
|
|
|
}
|
|
|
|
|
|
- if (mtStaff == null && StringUtil.isNotEmpty(id)) {
|
|
|
+ if (mtStaff == null && StringUtil.isNotEmpty(String.valueOf(id))) {
|
|
|
return getFailureResult(201, "员工信息不存在");
|
|
|
}
|
|
|
if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
|
|
|
mtStaff.setMerchantId(accountInfo.getMerchantId());
|
|
|
}
|
|
|
- mtStaff.setStoreId((long) Integer.parseInt(storeId));
|
|
|
+ mtStaff.setStoreId(storeId);
|
|
|
mtStaff.setRealName(realName);
|
|
|
if (PhoneFormatCheckUtils.isChinaPhoneLegal(mobile)) {
|
|
|
mtStaff.setMobile(mobile);
|