|  |  |  | 
|---|
|  |  |  | package com.matrix.system.shopXcx.action; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.matrix.core.anotations.RemoveRequestToken; | 
|---|
|  |  |  | import com.matrix.core.anotations.SaveRequestToken; | 
|---|
|  |  |  | import com.matrix.core.constance.MatrixConstance; | 
|---|
|  |  |  | import com.matrix.core.constance.SystemErrorCode; | 
|---|
|  |  |  | import com.matrix.core.constance.SystemMessageCode; | 
|---|
|  |  |  | import com.matrix.core.exception.GlobleException; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.pojo.PaginationVO; | 
|---|
|  |  |  | import com.matrix.core.tools.ModelUtils; | 
|---|
|  |  |  | import com.matrix.core.tools.StringUtils; | 
|---|
|  |  |  | import com.matrix.core.web.BaseAction; | 
|---|
|  |  |  | import com.matrix.core.constance.SystemErrorCode; | 
|---|
|  |  |  | import com.matrix.core.anotations.RemoveRequestToken; | 
|---|
|  |  |  | import com.matrix.core.tools.WebUtil; | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysUsers; | 
|---|
|  |  |  | import com.matrix.system.common.tools.ServiceUtil; | 
|---|
|  |  |  | import com.matrix.system.hive.action.util.QueryUtil; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopPage; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.dao.ShopPageDao; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Controller; | 
|---|
|  |  |  | import com.matrix.core.exception.GlobleException; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.ResponseBody; | 
|---|
|  |  |  | import com.matrix.core.anotations.SaveRequestToken; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.tools.WebUtil; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.servlet.ModelAndView; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  | import com.matrix.system.shopXcx.bean.ShopPage; | 
|---|
|  |  |  | import org.springframework.web.servlet.ModelAndView; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @description 小程序页面 | 
|---|
|  |  |  | * @author yourName | 
|---|
|  |  |  | * @author jyy | 
|---|
|  |  |  | * @date 2020-04-03 14:56 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Controller | 
|---|
|  |  |  | 
|---|
|  |  |  | @RemoveRequestToken | 
|---|
|  |  |  | @RequestMapping(value =  "/addShopPage") | 
|---|
|  |  |  | public @ResponseBody AjaxResult addShopPage(ShopPage shopPage) { | 
|---|
|  |  |  | if (serviceUtil.addCheckRepeat("shop_page", "code", shopPage.getCode())) { | 
|---|
|  |  |  | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | if (serviceUtil.addCheckRepeatTowColumn("shop_page", "code", shopPage.getCode(),"company_id", user.getCompanyId())) { | 
|---|
|  |  |  | throw new GlobleException("code重复"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | shopPage.setCreateBy(user.getSuName()); | 
|---|
|  |  |  | shopPage.setUpdateBy(user.getSuName()); | 
|---|
|  |  |  | shopPage.setCompanyId(user.getCompanyId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | @RequestMapping(value =  "/modifyShopPage") | 
|---|
|  |  |  | public @ResponseBody AjaxResult modifyShopPage(ShopPage newShopPage) { | 
|---|
|  |  |  | ShopPage oldShopPage = WebUtil.getSessionAttribute(BEV); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | // 校验去重 | 
|---|
|  |  |  | if (serviceUtil.updateCheckRepeat("shop_page", | 
|---|
|  |  |  | if (serviceUtil.updateCheckRepeatTowColumn("shop_page", | 
|---|
|  |  |  | "company_id", user.getCompanyId(), | 
|---|
|  |  |  | "code", newShopPage.getCode(), | 
|---|
|  |  |  | "id",newShopPage.getId())) { | 
|---|
|  |  |  | throw new GlobleException("编号" + newShopPage.getCode() + "重复"); | 
|---|