|
@@ -3,19 +3,16 @@ package com.caimei.modules.order.controller;
|
|
|
|
|
|
import com.caimei.modules.order.entity.CmOrderRemark;
|
|
import com.caimei.modules.order.entity.CmOrderRemark;
|
|
import com.caimei.modules.order.service.CmOrderRemarkService;
|
|
import com.caimei.modules.order.service.CmOrderRemarkService;
|
|
-import com.caimei.modules.shiro.entity.CmMallAdminUser;
|
|
|
|
-import com.caimei.modules.shiro.service.ShiroService;
|
|
|
|
import com.caimei.utils.JsonModel;
|
|
import com.caimei.utils.JsonModel;
|
|
-import com.caimei.utils.TokenEncryptUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import java.util.Date;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 订单备注Controller
|
|
* 订单备注Controller
|
|
@@ -26,8 +23,6 @@ public class CmOrderRemarkController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CmOrderRemarkService cmOrderRemarkService;
|
|
private CmOrderRemarkService cmOrderRemarkService;
|
|
- @Autowired
|
|
|
|
- private ShiroService shiroService;
|
|
|
|
|
|
|
|
@ModelAttribute
|
|
@ModelAttribute
|
|
public CmOrderRemark get(@RequestParam(required = false) String id) {
|
|
public CmOrderRemark get(@RequestParam(required = false) String id) {
|
|
@@ -51,33 +46,4 @@ public class CmOrderRemarkController {
|
|
List<CmOrderRemark> remarksList = cmOrderRemarkService.findList(remark);
|
|
List<CmOrderRemark> remarksList = cmOrderRemarkService.findList(remark);
|
|
return JsonModel.newInstance().success(remarksList);
|
|
return JsonModel.newInstance().success(remarksList);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 保存备注
|
|
|
|
- *
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @ResponseBody
|
|
|
|
- @RequestMapping(value = "addRemarks", method = RequestMethod.POST)
|
|
|
|
- public JsonModel addRemarks(@RequestBody Map<String, String> person, HttpServletRequest httpRequest) {
|
|
|
|
- JsonModel jsonModel = JsonModel.newInstance();
|
|
|
|
- String token = httpRequest.getHeader("token");
|
|
|
|
- String decoded = TokenEncryptUtils.decoded(token);
|
|
|
|
- String[] tokens = decoded.split("#,#");
|
|
|
|
- //用户信息
|
|
|
|
- CmMallAdminUser user = shiroService.findByUserId(Integer.valueOf(tokens[1]));
|
|
|
|
- try {
|
|
|
|
- //保存备注信息
|
|
|
|
- CmOrderRemark remark = new CmOrderRemark();
|
|
|
|
- remark.setOrderID(Integer.valueOf(person.get("orderID")));
|
|
|
|
- remark.setRemarks(person.get("remarks"));
|
|
|
|
- remark.setCreateBy(user.getId());
|
|
|
|
- remark.setCreateDate(new Date());
|
|
|
|
- cmOrderRemarkService.save(remark);
|
|
|
|
- return jsonModel.success();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- return jsonModel.error("修改失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|