|
@@ -4,9 +4,8 @@ import com.caimei.constants.ShopStatus;
|
|
import com.caimei.modules.opensearch.CoreServiceUitls;
|
|
import com.caimei.modules.opensearch.CoreServiceUitls;
|
|
import com.caimei.modules.sys.utils.CmMsgUtils;
|
|
import com.caimei.modules.sys.utils.CmMsgUtils;
|
|
import com.caimei.modules.sys.utils.SMSUtils;
|
|
import com.caimei.modules.sys.utils.SMSUtils;
|
|
-import com.caimei.modules.user.aop.OperationLogAnnotation;
|
|
|
|
-import com.caimei.modules.user.aop.OperationLogShop;
|
|
|
|
import com.caimei.modules.user.dao.CmUserDao;
|
|
import com.caimei.modules.user.dao.CmUserDao;
|
|
|
|
+import com.caimei.modules.user.dao.NewCmShopDao;
|
|
import com.caimei.modules.user.entity.CmMessage;
|
|
import com.caimei.modules.user.entity.CmMessage;
|
|
import com.caimei.modules.user.entity.CmOperationUser;
|
|
import com.caimei.modules.user.entity.CmOperationUser;
|
|
import com.caimei.modules.user.entity.CmUser;
|
|
import com.caimei.modules.user.entity.CmUser;
|
|
@@ -64,11 +63,8 @@ public class NewCmShopController extends BaseController {
|
|
private CmOperationUserService cmOperationUserService;
|
|
private CmOperationUserService cmOperationUserService;
|
|
@Autowired
|
|
@Autowired
|
|
private CmUserDao cmUserDao;
|
|
private CmUserDao cmUserDao;
|
|
-
|
|
|
|
- public static NewCmShop newcm;
|
|
|
|
- public static CmUser cmus;
|
|
|
|
- public static int id;
|
|
|
|
- public static String auditNo;
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private NewCmShopDao newCmShopDao;
|
|
|
|
|
|
@ModelAttribute
|
|
@ModelAttribute
|
|
public NewCmShop get(@RequestParam(required = false) String id) {
|
|
public NewCmShop get(@RequestParam(required = false) String id) {
|
|
@@ -91,19 +87,90 @@ public class NewCmShopController extends BaseController {
|
|
if (null != newCmShop.getEndTime() && !"".equals(newCmShop.getEndTime()) && !newCmShop.getEndTime().endsWith("23:59:59")) {
|
|
if (null != newCmShop.getEndTime() && !"".equals(newCmShop.getEndTime()) && !newCmShop.getEndTime().endsWith("23:59:59")) {
|
|
newCmShop.setEndTime(newCmShop.getEndTime() + " 23:59:59");
|
|
newCmShop.setEndTime(newCmShop.getEndTime() + " 23:59:59");
|
|
}
|
|
}
|
|
|
|
+ //屏蔽特殊供应商
|
|
|
|
+ newCmShop.setShopType(1);
|
|
Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
|
|
Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
|
|
- newcm = newCmShop;
|
|
|
|
- logger.info("******输出page"+page.getList()+"*****"+newCmShop.getSname());
|
|
|
|
model.addAttribute("page", page);
|
|
model.addAttribute("page", page);
|
|
return "modules/user/newCmShopList";
|
|
return "modules/user/newCmShopList";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/special/new")
|
|
|
|
+ public String specialList(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ //新品供应商
|
|
|
|
+ newCmShop.setShopType(2);
|
|
|
|
+ Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
|
|
|
|
+ model.addAttribute("page", page);
|
|
|
|
+ model.addAttribute("newCmShop",newCmShop);
|
|
|
|
+ model.addAttribute("shopType",2);
|
|
|
|
+ return "modules/user/cmNewProductShopList";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/special/new/edit")
|
|
|
|
+ public String specialEdit(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ if(null!=newCmShop.getShopID()){
|
|
|
|
+ newCmShop.setSplitCodes(newCmShopDao.findSplitCode(newCmShop.getShopID()));
|
|
|
|
+ }
|
|
|
|
+ model.addAttribute("newCmShop",newCmShop);
|
|
|
|
+ return "modules/user/cmNewProductShopEdit";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/special/new/save")
|
|
|
|
+ public String specialSave(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ newCmShopService.saveSpecial(newCmShop);
|
|
|
|
+ if(2==newCmShop.getShopType()){
|
|
|
|
+ model.addAttribute("newCmShop",newCmShop);
|
|
|
|
+ model.addAttribute("shopType",2);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/new?repage";
|
|
|
|
+ }else{
|
|
|
|
+ model.addAttribute("newCmShop",newCmShop);
|
|
|
|
+ model.addAttribute("shopType",3);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/second?repage";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/special/offline")
|
|
|
|
+ public String specialOffline(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ //下线
|
|
|
|
+ newCmShopService.offline(newCmShop);
|
|
|
|
+ if(2==newCmShop.getShopType()){
|
|
|
|
+ model.addAttribute("shopType",2);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/new?repage";
|
|
|
|
+ }else{
|
|
|
|
+ model.addAttribute("shopType",3);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/second?repage";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/special/online")
|
|
|
|
+ public String specialOnline(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ //上线
|
|
|
|
+ newCmShopService.online(newCmShop);
|
|
|
|
+ if(2==newCmShop.getShopType()){
|
|
|
|
+ model.addAttribute("shopType",2);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/new?repage";
|
|
|
|
+ }else{
|
|
|
|
+ model.addAttribute("shopType",3);
|
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/user/newCmShop/special/second?repage";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/special/second")
|
|
|
|
+ public String secondList(NewCmShop newCmShop, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ //二手供应商
|
|
|
|
+ newCmShop.setShopType(3);
|
|
|
|
+ Page<NewCmShop> page = newCmShopService.findPage(new Page<NewCmShop>(request, response), newCmShop);
|
|
|
|
+ model.addAttribute("page", page);
|
|
|
|
+ model.addAttribute("shopType",3);
|
|
|
|
+ model.addAttribute("newCmShop",newCmShop);
|
|
|
|
+ return "modules/user/cmNewProductShopList";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@RequiresPermissions("user:newCmShop:view")
|
|
@RequiresPermissions("user:newCmShop:view")
|
|
@RequestMapping(value = "form")
|
|
@RequestMapping(value = "form")
|
|
public String form(NewCmShop newCmShop, Model model) {
|
|
public String form(NewCmShop newCmShop, Model model) {
|
|
//获取供应商证书信息
|
|
//获取供应商证书信息
|
|
newCmShop = newCmShopService.getShopcert(newCmShop);
|
|
newCmShop = newCmShopService.getShopcert(newCmShop);
|
|
- newcm = newCmShop;
|
|
|
|
model.addAttribute("newCmShop", newCmShop);
|
|
model.addAttribute("newCmShop", newCmShop);
|
|
return "modules/user/newCmShopForm";
|
|
return "modules/user/newCmShopForm";
|
|
}
|
|
}
|
|
@@ -118,7 +185,6 @@ public class NewCmShopController extends BaseController {
|
|
*/
|
|
*/
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequiresPermissions("user:newCmShop:view")
|
|
@RequiresPermissions("user:newCmShop:view")
|
|
- @OperationLogShop(operType = "审核")
|
|
|
|
@RequestMapping(value = "auditShopInfo")
|
|
@RequestMapping(value = "auditShopInfo")
|
|
public Map<String, Object> auditShopInfo(String auditStatus, Integer shopId, Integer userId, String auditNote, Model model) {
|
|
public Map<String, Object> auditShopInfo(String auditStatus, Integer shopId, Integer userId, String auditNote, Model model) {
|
|
Map<String, Object> map = new HashedMap();
|
|
Map<String, Object> map = new HashedMap();
|
|
@@ -129,7 +195,6 @@ public class NewCmShopController extends BaseController {
|
|
String manufacturerStatus = "";
|
|
String manufacturerStatus = "";
|
|
String smsMessage = "";
|
|
String smsMessage = "";
|
|
CmUser companyUser = cmUserService.get(userId + "");
|
|
CmUser companyUser = cmUserService.get(userId + "");
|
|
- cmus = companyUser;
|
|
|
|
String mobile = companyUser.getBindMobile();
|
|
String mobile = companyUser.getBindMobile();
|
|
if (StringUtils.equals("1", auditStatus)) {
|
|
if (StringUtils.equals("1", auditStatus)) {
|
|
manufacturerStatus = "90";
|
|
manufacturerStatus = "90";
|
|
@@ -139,7 +204,6 @@ public class NewCmShopController extends BaseController {
|
|
manufacturerStatus = "92";
|
|
manufacturerStatus = "92";
|
|
smsMessage = "很遗憾,您的资料信息有误,未通过审核,请登录采美修改资料信息。";
|
|
smsMessage = "很遗憾,您的资料信息有误,未通过审核,请登录采美修改资料信息。";
|
|
}
|
|
}
|
|
- auditNo = auditStatus;
|
|
|
|
// 更新用户信息
|
|
// 更新用户信息
|
|
newCmShopService.updateUserAudit(auditStatus, auditNote, format, manufacturerStatus, userId, "1");
|
|
newCmShopService.updateUserAudit(auditStatus, auditNote, format, manufacturerStatus, userId, "1");
|
|
// 更新供应商信息
|
|
// 更新供应商信息
|
|
@@ -304,7 +368,6 @@ public class NewCmShopController extends BaseController {
|
|
*/
|
|
*/
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- @OperationLogShop(operType = "修改密码", operModul = "修改密码")
|
|
|
|
@RequestMapping(value = "updatePwd")
|
|
@RequestMapping(value = "updatePwd")
|
|
public Map<String, Object> updatePwd(String password, String id, HttpServletRequest request, HttpServletResponse response) {
|
|
public Map<String, Object> updatePwd(String password, String id, HttpServletRequest request, HttpServletResponse response) {
|
|
Map<String, Object> map = Maps.newLinkedHashMap();
|
|
Map<String, Object> map = Maps.newLinkedHashMap();
|
|
@@ -312,7 +375,6 @@ public class NewCmShopController extends BaseController {
|
|
CmUser cmUser = cmUserService.get(id);
|
|
CmUser cmUser = cmUserService.get(id);
|
|
cmUser.setPassword(MD5Util.MD5(password));
|
|
cmUser.setPassword(MD5Util.MD5(password));
|
|
cmUserService.update(cmUser);
|
|
cmUserService.update(cmUser);
|
|
- cmus = cmUser;
|
|
|
|
map.put("success", true);
|
|
map.put("success", true);
|
|
map.put("msg", "修改成功");
|
|
map.put("msg", "修改成功");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -382,13 +444,11 @@ public class NewCmShopController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "online")
|
|
@RequestMapping(value = "online")
|
|
- @OperationLogShop(operType = "更改状态", operModul = "设置为上线")
|
|
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
public String onLine(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
public String onLine(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
Integer userID = newCmShop.getUserID();
|
|
Integer userID = newCmShop.getUserID();
|
|
cmUserService.updateUserStatus("90", userID, "1");
|
|
cmUserService.updateUserStatus("90", userID, "1");
|
|
newCmShopService.updateShopStatus("90", userID);
|
|
newCmShopService.updateShopStatus("90", userID);
|
|
- id = newCmShop.getUserID();
|
|
|
|
addMessage(redirectAttributes, "供应商上线成功");
|
|
addMessage(redirectAttributes, "供应商上线成功");
|
|
return "redirect:" + Global.getAdminPath() + "/user/newCmShop/";
|
|
return "redirect:" + Global.getAdminPath() + "/user/newCmShop/";
|
|
}
|
|
}
|
|
@@ -402,20 +462,17 @@ public class NewCmShopController extends BaseController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@RequestMapping(value = "offline")
|
|
@RequestMapping(value = "offline")
|
|
- @OperationLogShop(operType = "更改状态", operModul = "设置为下线")
|
|
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
public String offLine(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
public String offLine(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
Integer userID = newCmShop.getUserID();
|
|
Integer userID = newCmShop.getUserID();
|
|
cmUserService.updateUserStatus("91", userID, "0");
|
|
cmUserService.updateUserStatus("91", userID, "0");
|
|
newCmShopService.updateShopStatus("91", userID);
|
|
newCmShopService.updateShopStatus("91", userID);
|
|
- id = newCmShop.getUserID();
|
|
|
|
addMessage(redirectAttributes, "供应商下线成功");
|
|
addMessage(redirectAttributes, "供应商下线成功");
|
|
return "redirect:" + Global.getAdminPath() + "/user/newCmShop/";
|
|
return "redirect:" + Global.getAdminPath() + "/user/newCmShop/";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
@RequiresPermissions("user:newCmShop:edit")
|
|
- @OperationLogShop(operType = "编辑")
|
|
|
|
@RequestMapping(value = "save")
|
|
@RequestMapping(value = "save")
|
|
public String save(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
public String save(NewCmShop newCmShop, Model model, RedirectAttributes redirectAttributes) {
|
|
if (!beanValidator(model, newCmShop)) {
|
|
if (!beanValidator(model, newCmShop)) {
|