|
@@ -27,6 +27,7 @@ import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 退款表--供应商退款给采美Controller
|
|
* 退款表--供应商退款给采美Controller
|
|
|
|
+ *
|
|
* @author lwt
|
|
* @author lwt
|
|
* @version 2019-07-01
|
|
* @version 2019-07-01
|
|
*/
|
|
*/
|
|
@@ -34,141 +35,143 @@ import java.util.Map;
|
|
@RequestMapping(value = "${adminPath}/order/cmRefundShop")
|
|
@RequestMapping(value = "${adminPath}/order/cmRefundShop")
|
|
public class CmRefundShopController extends BaseController {
|
|
public class CmRefundShopController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private CmRefundShopService cmRefundShopService;
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CmRefundShopService cmRefundShopService;
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private CmUserOrganizeService cmUserOrganizeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CmUserOrganizeService cmUserOrganizeService;
|
|
|
|
|
|
- @ModelAttribute
|
|
|
|
- public CmRefundShop get(@RequestParam(required=false) String id) {
|
|
|
|
- CmRefundShop entity = null;
|
|
|
|
- if (StringUtils.isNotBlank(id)){
|
|
|
|
- entity = cmRefundShopService.get(id);
|
|
|
|
- }
|
|
|
|
- if (entity == null){
|
|
|
|
- entity = new CmRefundShop();
|
|
|
|
- }
|
|
|
|
- return entity;
|
|
|
|
- }
|
|
|
|
|
|
+ @ModelAttribute
|
|
|
|
+ public CmRefundShop get(@RequestParam(required = false) String id) {
|
|
|
|
+ CmRefundShop entity = null;
|
|
|
|
+ if (StringUtils.isNotBlank(id)) {
|
|
|
|
+ entity = cmRefundShopService.get(id);
|
|
|
|
+ }
|
|
|
|
+ if (entity == null) {
|
|
|
|
+ entity = new CmRefundShop();
|
|
|
|
+ }
|
|
|
|
+ return entity;
|
|
|
|
+ }
|
|
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:view")
|
|
|
|
- @RequestMapping(value = {"list", ""})
|
|
|
|
- public String list(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
- if (null != cmRefundShop.getStartTime() && !"".equals(cmRefundShop.getStartTime()) && !cmRefundShop.getStartTime().endsWith("00:00:00")) {
|
|
|
|
- model.addAttribute("startTime", cmRefundShop.getStartTime());
|
|
|
|
- cmRefundShop.setStartTime(cmRefundShop.getStartTime().trim() + " 00:00:00");
|
|
|
|
- }
|
|
|
|
- if (null != cmRefundShop.getEndTime() && !"".equals(cmRefundShop.getEndTime()) && !cmRefundShop.getEndTime().endsWith("23:59:59")) {
|
|
|
|
- model.addAttribute("endTime", cmRefundShop.getEndTime());
|
|
|
|
- cmRefundShop.setEndTime(cmRefundShop.getEndTime().trim() + " 23:59:59");
|
|
|
|
- }
|
|
|
|
- Page<CmRefundShop> page = cmRefundShopService.findPage(new Page<CmRefundShop>(request, response), cmRefundShop);
|
|
|
|
- //获取组织列表
|
|
|
|
- List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
|
|
|
|
- model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
|
|
|
|
- model.addAttribute("page", page);
|
|
|
|
- return "modules/order/cmRefundShopList";
|
|
|
|
- }
|
|
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:view")
|
|
|
|
+ @RequestMapping(value = {"list", ""})
|
|
|
|
+ public String list(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ if (null != cmRefundShop.getStartTime() && !"".equals(cmRefundShop.getStartTime()) && !cmRefundShop.getStartTime().endsWith("00:00:00")) {
|
|
|
|
+ model.addAttribute("startTime", cmRefundShop.getStartTime());
|
|
|
|
+ cmRefundShop.setStartTime(cmRefundShop.getStartTime().trim() + " 00:00:00");
|
|
|
|
+ }
|
|
|
|
+ if (null != cmRefundShop.getEndTime() && !"".equals(cmRefundShop.getEndTime()) && !cmRefundShop.getEndTime().endsWith("23:59:59")) {
|
|
|
|
+ model.addAttribute("endTime", cmRefundShop.getEndTime());
|
|
|
|
+ cmRefundShop.setEndTime(cmRefundShop.getEndTime().trim() + " 23:59:59");
|
|
|
|
+ }
|
|
|
|
+ Page<CmRefundShop> page = cmRefundShopService.findPage(new Page<CmRefundShop>(request, response), cmRefundShop);
|
|
|
|
+ //获取组织列表
|
|
|
|
+ List<CmUserOrganize> cmUserOrganizeList = cmUserOrganizeService.findOrganize();
|
|
|
|
+ model.addAttribute("cmUserOrganizeList", cmUserOrganizeList);
|
|
|
|
+ model.addAttribute("page", page);
|
|
|
|
+ return "modules/order/cmRefundShopList";
|
|
|
|
+ }
|
|
|
|
|
|
- @RequestMapping(value = "export")
|
|
|
|
- public void exports(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
- if (null != cmRefundShop.getStartTime() && !"".equals(cmRefundShop.getStartTime()) && !cmRefundShop.getStartTime().endsWith("00:00:00")) {
|
|
|
|
- cmRefundShop.setStartTime(cmRefundShop.getStartTime().trim() + " 00:00:00");
|
|
|
|
- }
|
|
|
|
- if (null != cmRefundShop.getEndTime() && !"".equals(cmRefundShop.getEndTime()) && !cmRefundShop.getEndTime().endsWith("23:59:59")) {
|
|
|
|
- cmRefundShop.setEndTime(cmRefundShop.getEndTime().trim() + " 23:59:59");
|
|
|
|
- }
|
|
|
|
- //获取订单数据
|
|
|
|
- String fileName = "退款记录列表.xls";
|
|
|
|
- String template = Global.getConfig("export.template");
|
|
|
|
- String templateFileName = template + "/refundShopList.xls";
|
|
|
|
- try {
|
|
|
|
- Map data = new HashMap<String, Object>();
|
|
|
|
- List<CmRefundShop> list = cmRefundShopService.exports(new Page<CmRefundShop>(request, response), cmRefundShop);
|
|
|
|
- data.put("list", list);
|
|
|
|
- new ExcelUtil().createExcel(templateFileName, data, fileName, response);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- addMessage(redirectAttributes, "退款记录列表导出失败!" + e.getMessage());
|
|
|
|
- logger.info(e.getMessage());
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ @RequestMapping(value = "export")
|
|
|
|
+ public void exports(CmRefundShop cmRefundShop, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
+ if (null != cmRefundShop.getStartTime() && !"".equals(cmRefundShop.getStartTime()) && !cmRefundShop.getStartTime().endsWith("00:00:00")) {
|
|
|
|
+ cmRefundShop.setStartTime(cmRefundShop.getStartTime().trim() + " 00:00:00");
|
|
|
|
+ }
|
|
|
|
+ if (null != cmRefundShop.getEndTime() && !"".equals(cmRefundShop.getEndTime()) && !cmRefundShop.getEndTime().endsWith("23:59:59")) {
|
|
|
|
+ cmRefundShop.setEndTime(cmRefundShop.getEndTime().trim() + " 23:59:59");
|
|
|
|
+ }
|
|
|
|
+ //获取订单数据
|
|
|
|
+ String fileName = "退款记录列表.xls";
|
|
|
|
+ String template = Global.getConfig("export.template");
|
|
|
|
+ String templateFileName = template + "/refundShopList.xls";
|
|
|
|
+ try {
|
|
|
|
+ Map data = new HashMap<String, Object>();
|
|
|
|
+ List<CmRefundShop> list = cmRefundShopService.exports(new Page<CmRefundShop>(request, response), cmRefundShop);
|
|
|
|
+ data.put("list", list);
|
|
|
|
+ new ExcelUtil().createExcel(templateFileName, data, fileName, response);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ addMessage(redirectAttributes, "退款记录列表导出失败!" + e.getMessage());
|
|
|
|
+ logger.info(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:view")
|
|
|
|
- @RequestMapping(value = "form")
|
|
|
|
- public String form(CmRefundShop cmRefundShop, Model model) {
|
|
|
|
- model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
- return "modules/order/cmRefundShopForm";
|
|
|
|
- }
|
|
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:view")
|
|
|
|
+ @RequestMapping(value = "form")
|
|
|
|
+ public String form(CmRefundShop cmRefundShop, Model model) {
|
|
|
|
+ model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
+ return "modules/order/cmRefundShopForm";
|
|
|
|
+ }
|
|
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
- @RequestMapping(value = "save")
|
|
|
|
- public String save(CmRefundShop cmRefundShop, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
- if (!beanValidator(model, cmRefundShop)){
|
|
|
|
- return form(cmRefundShop, model);
|
|
|
|
- }
|
|
|
|
- cmRefundShopService.save(cmRefundShop);
|
|
|
|
- addMessage(redirectAttributes, "保存退款表--供应商退款给采美成功");
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
|
|
|
|
- }
|
|
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
+ @RequestMapping(value = "save")
|
|
|
|
+ public String save(CmRefundShop cmRefundShop, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
+ if (!beanValidator(model, cmRefundShop)) {
|
|
|
|
+ return form(cmRefundShop, model);
|
|
|
|
+ }
|
|
|
|
+ cmRefundShopService.save(cmRefundShop);
|
|
|
|
+ addMessage(redirectAttributes, "保存退款表--供应商退款给采美成功");
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/order/cmRefundShop/?repage";
|
|
|
|
+ }
|
|
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:delete")
|
|
|
|
- @RequestMapping(value = "delete")
|
|
|
|
- public String delete(CmRefundShop cmRefundShop, RedirectAttributes redirectAttributes) {
|
|
|
|
- cmRefundShopService.delete(cmRefundShop);
|
|
|
|
- addMessage(redirectAttributes, "删除退款表--供应商退款给采美成功");
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
|
|
|
|
- }
|
|
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:delete")
|
|
|
|
+ @RequestMapping(value = "delete")
|
|
|
|
+ public String delete(CmRefundShop cmRefundShop, RedirectAttributes redirectAttributes) {
|
|
|
|
+ cmRefundShopService.delete(cmRefundShop);
|
|
|
|
+ addMessage(redirectAttributes, "删除退款表--供应商退款给采美成功");
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/order/cmRefundShop/?repage";
|
|
|
|
+ }
|
|
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
- @RequestMapping(value = "toRefund")
|
|
|
|
- public String toRefund(CmRefundShop cmRefundShop, String[] shopOrderIDs, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
- try {
|
|
|
|
- cmRefundShopService.toRefund(cmRefundShop, shopOrderIDs);
|
|
|
|
- model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info(e.getMessage());
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isEmpty(cmRefundShop.getId()))
|
|
|
|
- return "modules/order/cmRefundShopForm";
|
|
|
|
- else
|
|
|
|
- return "modules/order/cmRefundShopDetail";
|
|
|
|
- }
|
|
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
+ @RequestMapping(value = "toRefund")
|
|
|
|
+ public String toRefund(CmRefundShop cmRefundShop, String[] shopOrderIDs, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
+ try {
|
|
|
|
+ cmRefundShopService.toRefund(cmRefundShop, shopOrderIDs);
|
|
|
|
+ model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.info(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isEmpty(cmRefundShop.getId())) {
|
|
|
|
+ return "modules/order/cmRefundShopForm";
|
|
|
|
+ } else {
|
|
|
|
+ return "modules/order/cmRefundShopDetail";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 退款操作 shopOrderInfo ==> value = 子订单ID_退款金额
|
|
|
|
- * @param cmRefundShop
|
|
|
|
- * @param refundInfo
|
|
|
|
- * @param model
|
|
|
|
- * @param redirectAttributes
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
- @RequestMapping(value = "refund")
|
|
|
|
- public String refund(CmRefundShop cmRefundShop, String[] refundInfo, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
- try {
|
|
|
|
- cmRefundShopService.refund(cmRefundShop, refundInfo);
|
|
|
|
- model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.info(e.getMessage());
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 退款操作 shopOrderInfo ==> value = 子订单ID_退款金额
|
|
|
|
+ *
|
|
|
|
+ * @param cmRefundShop
|
|
|
|
+ * @param refundInfo
|
|
|
|
+ * @param model
|
|
|
|
+ * @param redirectAttributes
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:edit")
|
|
|
|
+ @RequestMapping(value = "refund")
|
|
|
|
+ public String refund(CmRefundShop cmRefundShop, String[] refundInfo, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
+ try {
|
|
|
|
+ cmRefundShopService.refund(cmRefundShop, refundInfo);
|
|
|
|
+ model.addAttribute("cmRefundShop", cmRefundShop);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.info(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/order/cmRefundShop/?repage";
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 撤销退款
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("order:cmRefundShop:delete")
|
|
|
|
- @RequestMapping(value = "revocation")
|
|
|
|
- public String revocation(String id){
|
|
|
|
- try {
|
|
|
|
- cmRefundShopService.revocation(id);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/order/cmRefundShop/?repage";
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 撤销退款
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("order:cmRefundShop:delete")
|
|
|
|
+ @RequestMapping(value = "revocation")
|
|
|
|
+ public String revocation(String id) {
|
|
|
|
+ try {
|
|
|
|
+ cmRefundShopService.revocation(id);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/order/cmRefundShop/?repage";
|
|
|
|
+ }
|
|
}
|
|
}
|