Commit f38af83e by XiaHou

权星相关接口修复

parent d9d7cab3
...@@ -2,16 +2,16 @@ package com.macro.mall.controller; ...@@ -2,16 +2,16 @@ package com.macro.mall.controller;
import com.macro.mall.common.api.CommonPage; import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult; import com.macro.mall.common.api.CommonResult;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.model.PmsProductAttributeCategory; import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.service.PmsProductAttributeCategoryService; import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
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.*;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
...@@ -22,7 +22,7 @@ import java.util.List; ...@@ -22,7 +22,7 @@ import java.util.List;
@Api(tags = "权星后台_商品分类相关接口", description = "商品属性分类管理") @Api(tags = "权星后台_商品分类相关接口", description = "商品属性分类管理")
@RequestMapping("/productAttribute/category") @RequestMapping("/productAttribute/category")
public class PmsProductAttributeCategoryController { public class PmsProductAttributeCategoryController {
@Resource @Autowired
private PmsProductAttributeCategoryService productAttributeCategoryService; private PmsProductAttributeCategoryService productAttributeCategoryService;
@ApiOperation("添加商品属性分类") @ApiOperation("添加商品属性分类")
......
...@@ -34,7 +34,7 @@ public class PmsSupplierAuditController { ...@@ -34,7 +34,7 @@ public class PmsSupplierAuditController {
@ApiOperation("权星后台_申请供应商分页数据") @ApiOperation("权星后台_申请供应商分页数据")
@ResponseBody @ResponseBody
@RequestMapping(value = "/getPageList", method = RequestMethod.POST) @RequestMapping(value = "/getPageList", method = RequestMethod.GET)
public CommonResult getPageList(@ApiParam("页数") @RequestParam("page")Integer page, @ApiParam("每页大小")@RequestParam("size")Integer size, public CommonResult getPageList(@ApiParam("页数") @RequestParam("page")Integer page, @ApiParam("每页大小")@RequestParam("size")Integer size,
@ApiParam("供应商名称")@RequestParam("name") String name, @ApiParam("手机号")@RequestParam("phone") String phone, @ApiParam("供应商名称")@RequestParam("name") String name, @ApiParam("手机号")@RequestParam("phone") String phone,
@ApiParam("(非必传)审核状态 0待审核 1审核通过 2审核不通过")@RequestParam("status") Integer status){ @ApiParam("(非必传)审核状态 0待审核 1审核通过 2审核不通过")@RequestParam("status") Integer status){
......
package com.macro.mall.dao; package com.macro.mall.dao;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import java.util.List; import java.util.List;
/** /**
...@@ -9,5 +7,5 @@ import java.util.List; ...@@ -9,5 +7,5 @@ import java.util.List;
* Created by macro on 2018/5/24. * Created by macro on 2018/5/24.
*/ */
public interface PmsProductAttributeCategoryDao { public interface PmsProductAttributeCategoryDao {
List<PmsProductAttributeCategoryItem> getListWithAttr();
} }
...@@ -7,7 +7,6 @@ import com.macro.mall.mapper.PmsProductAttributeCategoryMapper; ...@@ -7,7 +7,6 @@ import com.macro.mall.mapper.PmsProductAttributeCategoryMapper;
import com.macro.mall.mapper.PmsProductAttributeTypeMapper; import com.macro.mall.mapper.PmsProductAttributeTypeMapper;
import com.macro.mall.model.*; import com.macro.mall.model.*;
import com.macro.mall.model.dto.quanxing.PmsProductAttributeTypeDto; import com.macro.mall.model.dto.quanxing.PmsProductAttributeTypeDto;
import com.macro.mall.service.PmsProductAttributeCategoryService;
import com.macro.mall.service.PmsProductAttributeTypeService; import com.macro.mall.service.PmsProductAttributeTypeService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -5,7 +5,6 @@ import com.macro.mall.dao.quanxing.product.PmsProductAttributeGroupDao; ...@@ -5,7 +5,6 @@ import com.macro.mall.dao.quanxing.product.PmsProductAttributeGroupDao;
import com.macro.mall.dto.PmsProductAttributeGroupParam; import com.macro.mall.dto.PmsProductAttributeGroupParam;
import com.macro.mall.mapper.*; import com.macro.mall.mapper.*;
import com.macro.mall.model.*; import com.macro.mall.model.*;
import com.macro.mall.service.PmsProductAttributeCategoryService;
import com.macro.mall.service.ProductAttributeGroupService; import com.macro.mall.service.ProductAttributeGroupService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
......
...@@ -52,6 +52,9 @@ public class PmsSupplierAudit implements Serializable { ...@@ -52,6 +52,9 @@ public class PmsSupplierAudit implements Serializable {
@ApiModelProperty(value = "删除标识0 未删除 1已删除") @ApiModelProperty(value = "删除标识0 未删除 1已删除")
private Integer deleteStatus; private Integer deleteStatus;
@ApiModelProperty(value = "审核人 默认0表示后台审核")
private Long auditBy;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime; private Date createtime;
...@@ -174,6 +177,14 @@ public class PmsSupplierAudit implements Serializable { ...@@ -174,6 +177,14 @@ public class PmsSupplierAudit implements Serializable {
this.deleteStatus = deleteStatus; this.deleteStatus = deleteStatus;
} }
public Long getAuditBy() {
return auditBy;
}
public void setAuditBy(Long auditBy) {
this.auditBy = auditBy;
}
public Date getCreatetime() { public Date getCreatetime() {
return createtime; return createtime;
} }
...@@ -210,6 +221,7 @@ public class PmsSupplierAudit implements Serializable { ...@@ -210,6 +221,7 @@ public class PmsSupplierAudit implements Serializable {
sb.append(", remarks=").append(remarks); sb.append(", remarks=").append(remarks);
sb.append(", memberId=").append(memberId); sb.append(", memberId=").append(memberId);
sb.append(", deleteStatus=").append(deleteStatus); sb.append(", deleteStatus=").append(deleteStatus);
sb.append(", auditBy=").append(auditBy);
sb.append(", createtime=").append(createtime); sb.append(", createtime=").append(createtime);
sb.append(", updatetime=").append(updatetime); sb.append(", updatetime=").append(updatetime);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
......
...@@ -1045,6 +1045,66 @@ public class PmsSupplierAuditExample { ...@@ -1045,6 +1045,66 @@ public class PmsSupplierAuditExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAuditByIsNull() {
addCriterion("audit_by is null");
return (Criteria) this;
}
public Criteria andAuditByIsNotNull() {
addCriterion("audit_by is not null");
return (Criteria) this;
}
public Criteria andAuditByEqualTo(Long value) {
addCriterion("audit_by =", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByNotEqualTo(Long value) {
addCriterion("audit_by <>", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByGreaterThan(Long value) {
addCriterion("audit_by >", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByGreaterThanOrEqualTo(Long value) {
addCriterion("audit_by >=", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByLessThan(Long value) {
addCriterion("audit_by <", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByLessThanOrEqualTo(Long value) {
addCriterion("audit_by <=", value, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByIn(List<Long> values) {
addCriterion("audit_by in", values, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByNotIn(List<Long> values) {
addCriterion("audit_by not in", values, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByBetween(Long value1, Long value2) {
addCriterion("audit_by between", value1, value2, "auditBy");
return (Criteria) this;
}
public Criteria andAuditByNotBetween(Long value1, Long value2) {
addCriterion("audit_by not between", value1, value2, "auditBy");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() { public Criteria andCreatetimeIsNull() {
addCriterion("createtime is null"); addCriterion("createtime is null");
return (Criteria) this; return (Criteria) this;
......
package com.macro.mall.dto; package com.macro.mall.model.dto;
import com.macro.mall.model.PmsProductAttribute; import com.macro.mall.model.PmsProductAttribute;
import com.macro.mall.model.PmsProductAttributeCategory; import com.macro.mall.model.PmsProductAttributeCategory;
......
...@@ -14,4 +14,6 @@ public class PmsSupplierAuditRequest implements Serializable { ...@@ -14,4 +14,6 @@ public class PmsSupplierAuditRequest implements Serializable {
private Integer status; private Integer status;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remarks; private String remarks;
@ApiModelProperty(value="审核人会员Id")
private Long memberId;
} }
package com.macro.mall.model.dto.quanxing;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class UmsMemberRequestParam implements Serializable {
@ApiModelProperty(value="会员id")
private Long id;
@ApiModelProperty(value="手机号")
private String phone;
@ApiModelProperty(value = "验证码")
private String authCode;
@ApiModelProperty(value="新密码")
private String newPassWord;
}
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<result column="remarks" jdbcType="VARCHAR" property="remarks" /> <result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="member_id" jdbcType="BIGINT" property="memberId" /> <result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="delete_status" jdbcType="INTEGER" property="deleteStatus" /> <result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
<result column="audit_by" jdbcType="BIGINT" property="auditBy" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
</resultMap> </resultMap>
...@@ -79,7 +80,8 @@ ...@@ -79,7 +80,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, brand_name, company_name, business_license, business, trademark, other_materials, id, name, brand_name, company_name, business_license, business, trademark, other_materials,
phone, password, status, remarks, member_id, delete_status, createtime, updatetime phone, password, status, remarks, member_id, delete_status, audit_by, createtime,
updatetime
</sql> </sql>
<select id="selectByExample" parameterType="com.macro.mall.model.PmsSupplierAuditExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.macro.mall.model.PmsSupplierAuditExample" resultMap="BaseResultMap">
select select
...@@ -112,25 +114,28 @@ ...@@ -112,25 +114,28 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.PmsSupplierAudit"> <insert id="insert" parameterType="com.macro.mall.model.PmsSupplierAudit">
insert into pms_supplier_audit (id, name, brand_name, <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
company_name, business_license, business, SELECT LAST_INSERT_ID()
trademark, other_materials, phone, </selectKey>
password, status, remarks, insert into pms_supplier_audit (name, brand_name, company_name,
member_id, delete_status, createtime, business_license, business, trademark,
other_materials, phone, password,
status, remarks, member_id,
delete_status, audit_by, createtime,
updatetime) updatetime)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{brandName,jdbcType=VARCHAR}, values (#{name,jdbcType=VARCHAR}, #{brandName,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
#{companyName,jdbcType=VARCHAR}, #{businessLicense,jdbcType=VARCHAR}, #{business,jdbcType=VARCHAR}, #{businessLicense,jdbcType=VARCHAR}, #{business,jdbcType=VARCHAR}, #{trademark,jdbcType=VARCHAR},
#{trademark,jdbcType=VARCHAR}, #{otherMaterials,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{otherMaterials,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, #{memberId,jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{deleteStatus,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{deleteStatus,jdbcType=INTEGER}, #{auditBy,jdbcType=BIGINT}, #{createtime,jdbcType=TIMESTAMP},
#{updatetime,jdbcType=TIMESTAMP}) #{updatetime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.PmsSupplierAudit"> <insert id="insertSelective" parameterType="com.macro.mall.model.PmsSupplierAudit">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into pms_supplier_audit insert into pms_supplier_audit
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
...@@ -170,6 +175,9 @@ ...@@ -170,6 +175,9 @@
<if test="deleteStatus != null"> <if test="deleteStatus != null">
delete_status, delete_status,
</if> </if>
<if test="auditBy != null">
audit_by,
</if>
<if test="createtime != null"> <if test="createtime != null">
createtime, createtime,
</if> </if>
...@@ -178,9 +186,6 @@ ...@@ -178,9 +186,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
...@@ -220,6 +225,9 @@ ...@@ -220,6 +225,9 @@
<if test="deleteStatus != null"> <if test="deleteStatus != null">
#{deleteStatus,jdbcType=INTEGER}, #{deleteStatus,jdbcType=INTEGER},
</if> </if>
<if test="auditBy != null">
#{auditBy,jdbcType=BIGINT},
</if>
<if test="createtime != null"> <if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP}, #{createtime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -279,6 +287,9 @@ ...@@ -279,6 +287,9 @@
<if test="record.deleteStatus != null"> <if test="record.deleteStatus != null">
delete_status = #{record.deleteStatus,jdbcType=INTEGER}, delete_status = #{record.deleteStatus,jdbcType=INTEGER},
</if> </if>
<if test="record.auditBy != null">
audit_by = #{record.auditBy,jdbcType=BIGINT},
</if>
<if test="record.createtime != null"> <if test="record.createtime != null">
createtime = #{record.createtime,jdbcType=TIMESTAMP}, createtime = #{record.createtime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -306,6 +317,7 @@ ...@@ -306,6 +317,7 @@
remarks = #{record.remarks,jdbcType=VARCHAR}, remarks = #{record.remarks,jdbcType=VARCHAR},
member_id = #{record.memberId,jdbcType=BIGINT}, member_id = #{record.memberId,jdbcType=BIGINT},
delete_status = #{record.deleteStatus,jdbcType=INTEGER}, delete_status = #{record.deleteStatus,jdbcType=INTEGER},
audit_by = #{record.auditBy,jdbcType=BIGINT},
createtime = #{record.createtime,jdbcType=TIMESTAMP}, createtime = #{record.createtime,jdbcType=TIMESTAMP},
updatetime = #{record.updatetime,jdbcType=TIMESTAMP} updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -354,6 +366,9 @@ ...@@ -354,6 +366,9 @@
<if test="deleteStatus != null"> <if test="deleteStatus != null">
delete_status = #{deleteStatus,jdbcType=INTEGER}, delete_status = #{deleteStatus,jdbcType=INTEGER},
</if> </if>
<if test="auditBy != null">
audit_by = #{auditBy,jdbcType=BIGINT},
</if>
<if test="createtime != null"> <if test="createtime != null">
createtime = #{createtime,jdbcType=TIMESTAMP}, createtime = #{createtime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -378,6 +393,7 @@ ...@@ -378,6 +393,7 @@
remarks = #{remarks,jdbcType=VARCHAR}, remarks = #{remarks,jdbcType=VARCHAR},
member_id = #{memberId,jdbcType=BIGINT}, member_id = #{memberId,jdbcType=BIGINT},
delete_status = #{deleteStatus,jdbcType=INTEGER}, delete_status = #{deleteStatus,jdbcType=INTEGER},
audit_by = #{auditBy,jdbcType=BIGINT},
createtime = #{createtime,jdbcType=TIMESTAMP}, createtime = #{createtime,jdbcType=TIMESTAMP},
updatetime = #{updatetime,jdbcType=TIMESTAMP} updatetime = #{updatetime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
......
...@@ -2,6 +2,8 @@ package com.macro.mall.portal.controller.member; ...@@ -2,6 +2,8 @@ package com.macro.mall.portal.controller.member;
import com.macro.mall.common.api.CommonResult; import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.UmsMember; import com.macro.mall.model.UmsMember;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.UmsMemberRequestParam;
import com.macro.mall.portal.domain.UmsMemberPhoneReviewAddParam; import com.macro.mall.portal.domain.UmsMemberPhoneReviewAddParam;
import com.macro.mall.domain.UmsMemberVerified; import com.macro.mall.domain.UmsMemberVerified;
import com.macro.mall.portal.service.UmsMemberPhoneReviewService; import com.macro.mall.portal.service.UmsMemberPhoneReviewService;
...@@ -24,7 +26,7 @@ import java.util.Map; ...@@ -24,7 +26,7 @@ import java.util.Map;
* Created by macro on 2018/8/3. * Created by macro on 2018/8/3.
*/ */
@Controller @Controller
@Api(tags = "会员登录注册管理", description = "会员登录注册管理") @Api(tags = "权星小程序_会员相关接口", description = "会员登录注册管理")
@RequestMapping("/sso") @RequestMapping("/sso")
public class UmsMemberController { public class UmsMemberController {
@Value("${jwt.tokenHeader}") @Value("${jwt.tokenHeader}")
...@@ -36,27 +38,8 @@ public class UmsMemberController { ...@@ -36,27 +38,8 @@ public class UmsMemberController {
@Autowired @Autowired
private UmsMemberPhoneReviewService memberPhoneReviewService; private UmsMemberPhoneReviewService memberPhoneReviewService;
@ApiOperation("会员注册")
@RequestMapping(value = "/register", method = RequestMethod.POST)
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(name = "username" ,value = "用户名" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "password" ,value = "密码" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "telephone" ,value = "手机号" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "authCode" ,value = "验证码" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "code" ,value = "邀请码" ,dataType = "String" ,required = false ,paramType = "query"),
@ApiImplicitParam(name = "unionid" ,value = "微信id" ,dataType = "String" ,required = false ,paramType = "query"),
})
public CommonResult register(@RequestParam String username,
@RequestParam String password,
@RequestParam String telephone,
@RequestParam String authCode,
@RequestParam String code,
@RequestParam String unionid) {
return memberService.register(username, password, telephone, authCode , code ,unionid);
}
@ApiOperation("会员根据手机号登录") @ApiOperation("权星小程序_会员根据手机号登录")
@RequestMapping(value = "/login", method = RequestMethod.POST) @RequestMapping(value = "/login", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public CommonResult login(@RequestParam String phone, public CommonResult login(@RequestParam String phone,
...@@ -64,20 +47,16 @@ public class UmsMemberController { ...@@ -64,20 +47,16 @@ public class UmsMemberController {
return memberService.login(phone, password); return memberService.login(phone, password);
} }
// @ApiOperation("获取验证码")
// @RequestMapping(value = "/getAuthCode", method = RequestMethod.GET)
// @ResponseBody
// public CommonResult getAuthCode(@RequestParam String telephone) {
// return memberService.generateAuthCode(telephone);
// }
@ApiOperation("修改密码") @ApiOperation("权星小程序_用户修改密码")
@RequestMapping(value = "/updatePassword", method = RequestMethod.POST) @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public CommonResult updatePassword(@RequestParam String telephone, public CommonResult updatePassword(@RequestBody UmsMemberRequestParam umsMemberRequestParam) {
@RequestParam String password, ResultMsg res = memberService.updatePassword(umsMemberRequestParam);
@RequestParam String authCode) { if(res.isFlag()){
return memberService.updatePassword(telephone,password,authCode); return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
} }
@ApiOperation(value = "刷新token") @ApiOperation(value = "刷新token")
...@@ -95,16 +74,6 @@ public class UmsMemberController { ...@@ -95,16 +74,6 @@ public class UmsMemberController {
return CommonResult.success(tokenMap); return CommonResult.success(tokenMap);
} }
@ApiOperation("找回密码")
@RequestMapping(value = "/retrieve", method = RequestMethod.POST)
@ResponseBody
public CommonResult retrieve(@RequestParam String username,
@RequestParam String password,
@RequestParam String telephone,
@RequestParam String authCode) {
return memberService.retrievePassword(username, password, telephone, authCode);
}
@ApiOperation("获取当前登录用户信息") @ApiOperation("获取当前登录用户信息")
@RequestMapping(value = "/info", method = RequestMethod.GET) @RequestMapping(value = "/info", method = RequestMethod.GET)
@ResponseBody @ResponseBody
...@@ -113,17 +82,6 @@ public class UmsMemberController { ...@@ -113,17 +82,6 @@ public class UmsMemberController {
return CommonResult.success(currentMember); return CommonResult.success(currentMember);
} }
@ApiOperation("修改指定用户信息")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public CommonResult update(@PathVariable Long id, @RequestBody UmsMember member){
int count = memberService.update(id,member);
if (count > 0) {
return CommonResult.success(count);
}
return CommonResult.failed();
}
@ApiOperation("会员手机验证码登录") @ApiOperation("会员手机验证码登录")
@RequestMapping(value = "/loginPhone", method = RequestMethod.POST) @RequestMapping(value = "/loginPhone", method = RequestMethod.POST)
@ResponseBody @ResponseBody
...@@ -132,47 +90,7 @@ public class UmsMemberController { ...@@ -132,47 +90,7 @@ public class UmsMemberController {
return memberService.loginPhone(telephone, authCode); return memberService.loginPhone(telephone, authCode);
} }
@ApiOperation("修改注册手机号码")
@RequestMapping(value = "/updatePhone", method = RequestMethod.POST)
@ResponseBody
public CommonResult updatePhone(@RequestParam String oldPhone,
@RequestParam String oldCode,
@RequestParam String newPhone,
@RequestParam String newCode){
return memberService.updatePhone(oldPhone,oldCode,newPhone,newCode);
}
@ApiOperation("会员实名认证申请")
@RequestMapping(value = "/verified", method = RequestMethod.POST)
@ResponseBody
public CommonResult verified(@RequestBody UmsMemberVerified memberVerified){
return memberService.verified(memberVerified);
}
@ApiOperation("返回当前登录用户实名审核消息")
@RequestMapping(value = "/reviewMessage", method = RequestMethod.GET)
@ResponseBody
public CommonResult reviewMessage(){
return memberService.reviewMessage();
}
@ApiOperation("变更注册手机号码")
@RequestMapping(value = "/replacePhone", method = RequestMethod.POST)
@ResponseBody
public CommonResult replacePhone(@RequestBody UmsMemberPhoneReviewAddParam memberPhoneReviewAddParam){
return memberPhoneReviewService.add(memberPhoneReviewAddParam);
}
@ApiOperation("会员注册绑定")
@RequestMapping(value = "/bind", method = RequestMethod.POST)
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(name = "username" ,value = "用户名" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "password" ,value = "密码" ,dataType = "String" ,required = true ,paramType = "query"),
@ApiImplicitParam(name = "unionid" ,value = "微信id" ,dataType = "String" ,required = true ,paramType = "query"),
})
public CommonResult bind(String username ,String password ,String unionid){
return memberService.bind(username,password,unionid);
}
} }
\ No newline at end of file
package com.macro.mall.portal.controller.quanxing;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@Api(tags = "权星小程序_商品分类相关接口", description = "商品属性分类管理")
@RequestMapping("/pmsProductAttributeCategory")
public class PmsProductAttributeCategoryController {
@Autowired
private PmsProductAttributeCategoryService productAttributeCategoryService;
@ApiOperation("权星获取所有商品分类 (默认不传分页参数则不分页查询)")
@RequestMapping(value = "/getAttributeCategoryList", method = RequestMethod.GET)
@ResponseBody
public CommonResult getAttributeCategoryList(@ApiParam("页数") @RequestParam("page")Integer page, @ApiParam("大小") @RequestParam("size")Integer size,
@ApiParam("非必传 不传父级id 则查所有分类") @RequestParam("parentId")Long parentId){
return CommonResult.success(this.productAttributeCategoryService.getAttributeCategoryList(page,size,parentId));
}
}
...@@ -12,10 +12,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,10 +12,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
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.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller @Controller
@RequestMapping("/pmsProduct") @RequestMapping("/pmsProduct")
...@@ -61,4 +58,15 @@ public class PmsProductController { ...@@ -61,4 +58,15 @@ public class PmsProductController {
ResultMsg res = this.pmsProductService.getAdminProductStatus(); ResultMsg res = this.pmsProductService.getAdminProductStatus();
return CommonResult.success(res.getContext()); return CommonResult.success(res.getContext());
} }
@ApiOperation("权星小程序_根据商品id修改一条商品数据")
@RequestMapping(value = "/updateOneById", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateOneById(@ApiParam("商品对象,传入Id,以及对应的要修改的值.例如上架状态:0->下架;1->上架' 传入0为下架操作") @RequestBody PmsProduct pmsProduct){
ResultMsg res = this.pmsProductService.updateOneById(pmsProduct);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
} }
...@@ -3,16 +3,14 @@ package com.macro.mall.portal.controller.quanxing; ...@@ -3,16 +3,14 @@ package com.macro.mall.portal.controller.quanxing;
import com.macro.mall.common.api.CommonResult; import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.common.ResultMsg; import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.PmsSupplierAuditDto; import com.macro.mall.model.dto.PmsSupplierAuditDto;
import com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest;
import com.macro.mall.service.quanxing.IPmsSupplierAuditService; import com.macro.mall.service.quanxing.IPmsSupplierAuditService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
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.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller @Controller
@RequestMapping("/pmsSupplierAudit") @RequestMapping("/pmsSupplierAudit")
...@@ -23,7 +21,7 @@ public class PmsSupplierAuditController { ...@@ -23,7 +21,7 @@ public class PmsSupplierAuditController {
private IPmsSupplierAuditService pmsSupplierAuditService; private IPmsSupplierAuditService pmsSupplierAuditService;
@ApiOperation("申请供应商") @ApiOperation("权星小程序_申请供应商")
@ResponseBody @ResponseBody
@RequestMapping(value = "/auditSupplier", method = RequestMethod.POST) @RequestMapping(value = "/auditSupplier", method = RequestMethod.POST)
public CommonResult auditSupplier(@ApiParam("申请供应商所需参数对象") @RequestBody PmsSupplierAuditDto pmsSupplierAuditDto ){ public CommonResult auditSupplier(@ApiParam("申请供应商所需参数对象") @RequestBody PmsSupplierAuditDto pmsSupplierAuditDto ){
...@@ -34,4 +32,31 @@ public class PmsSupplierAuditController { ...@@ -34,4 +32,31 @@ public class PmsSupplierAuditController {
return CommonResult.failed(res.getMsg()); return CommonResult.failed(res.getMsg());
} }
@ApiOperation("权星小程序_审核申请供应商")
@ResponseBody
@RequestMapping(value = "/auditStatus", method = RequestMethod.POST)
public CommonResult auditStatus(@RequestBody PmsSupplierAuditRequest pmsSupplierAuditRequest){
ResultMsg res = this.pmsSupplierAuditService.auditSupplier(pmsSupplierAuditRequest);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
@ApiOperation("权星后台_通过审核Id得到 相关数据")
@ResponseBody
@RequestMapping(value = "/getSupplierAuditById", method = RequestMethod.GET)
public CommonResult getSupplierAuditById(@ApiParam("审核id") @RequestParam("id") Long id){
return CommonResult.success(this.pmsSupplierAuditService.getSupplierAuditById(id));
}
@ApiOperation("权星后台_申请供应商分页数据")
@ResponseBody
@RequestMapping(value = "/getPageList", method = RequestMethod.GET)
public CommonResult getPageList(@ApiParam("页数") @RequestParam("page")Integer page, @ApiParam("每页大小")@RequestParam("size")Integer size,
@ApiParam("供应商名称")@RequestParam("name") String name, @ApiParam("手机号")@RequestParam("phone") String phone,
@ApiParam("(非必传)审核状态 0待审核 1审核通过 2审核不通过")@RequestParam("status") Integer status){
return CommonResult.success(this.pmsSupplierAuditService.getPageList(page,size,name,phone,status));
}
} }
package com.macro.mall.portal.controller.quanxing;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.domain.SmsResult;
import com.macro.mall.domain.vo.SmsVo;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.service.common.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("/sendMsg")
@Api(tags = "权星小程序_发送短信相关接口", description = "短信控制器")
public class SendMsgController {
@Autowired
private CommonService commonService;
@ApiOperation("权星小程序_通过手机号发送短信验证码")
@RequestMapping(value = "/sendMsg", method = RequestMethod.POST)
@ResponseBody
public CommonResult<SmsResult> sendMsg(SmsVo smsVo) {
return CommonResult.success(this.commonService.sendSms(smsVo));
}
}
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import java.util.List;
/**
* 自定义商品属性分类Dao
* Created by macro on 2018/5/24.
*/
public interface PmsProductAttributeCategoryDao {
List<PmsProductAttributeCategoryItem> getListWithAttr();
}
...@@ -10,6 +10,7 @@ import com.macro.mall.model.UmsAdmin; ...@@ -10,6 +10,7 @@ import com.macro.mall.model.UmsAdmin;
import com.macro.mall.model.UmsMember; import com.macro.mall.model.UmsMember;
import com.macro.mall.model.common.ResultMsg; import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.UmsMemberDto; import com.macro.mall.model.dto.quanxing.UmsMemberDto;
import com.macro.mall.model.dto.quanxing.UmsMemberRequestParam;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -57,8 +58,7 @@ public interface UmsMemberService { ...@@ -57,8 +58,7 @@ public interface UmsMemberService {
/** /**
* 修改密码 * 修改密码
*/ */
@Transactional ResultMsg updatePassword(UmsMemberRequestParam umsMemberRequestParam);
CommonResult updatePassword(String telephone, String password, String authCode);
/** /**
* 获取当前登录会员 * 获取当前登录会员
......
...@@ -20,6 +20,7 @@ import com.macro.mall.domain.UmsMemberVerified; ...@@ -20,6 +20,7 @@ import com.macro.mall.domain.UmsMemberVerified;
import com.macro.mall.model.common.ResultMsg; import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.PmsSupplierAuditDto; import com.macro.mall.model.dto.PmsSupplierAuditDto;
import com.macro.mall.model.dto.quanxing.UmsMemberDto; import com.macro.mall.model.dto.quanxing.UmsMemberDto;
import com.macro.mall.model.dto.quanxing.UmsMemberRequestParam;
import com.macro.mall.service.member.UmsMemberAccountService; import com.macro.mall.service.member.UmsMemberAccountService;
import com.macro.mall.service.member.UmsMemberService; import com.macro.mall.service.member.UmsMemberService;
import com.macro.mall.security.util.CodingUtil; import com.macro.mall.security.util.CodingUtil;
...@@ -248,26 +249,29 @@ public class UmsMemberServiceImpl implements UmsMemberService { ...@@ -248,26 +249,29 @@ public class UmsMemberServiceImpl implements UmsMemberService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public CommonResult updatePassword(String telephone, String password, String authCode) { public ResultMsg updatePassword(UmsMemberRequestParam umsMemberRequestParam) {
UmsMemberExample example = new UmsMemberExample(); if(umsMemberRequestParam.getId() == null ){
example.createCriteria().andPhoneEqualTo(telephone).andDeleteStatusEqualTo(0); return new ResultMsg(false,"传入会员id为空");
List<UmsMember> memberList = umsMemberMapper.selectByExample(example);
if (CollectionUtils.isEmpty(memberList)) {
return CommonResult.failed("该账号不存在");
} }
//验证验证码 if(umsMemberRequestParam.getPhone() == null || "".equals(umsMemberRequestParam.getPhone())){
if (!verifyAuthCode(authCode, telephone)) { return new ResultMsg(false,"传入手机号为空");
return CommonResult.failed("验证码错误");
} }
UmsMember umsMember = memberList.get(0); if(umsMemberRequestParam.getAuthCode() == null || "".equals(umsMemberRequestParam.getAuthCode())){
String encode = passwordEncoder.encode(password); return new ResultMsg(false,"传入验证码为空");
umsMember.setPassword(encode); }
umsMemberMapper.updateByPrimaryKeySelective(umsMember); if(umsMemberRequestParam.getNewPassWord() == null || "".equals(umsMemberRequestParam.getNewPassWord())){
//同步修改供应商密码 return new ResultMsg(false,"传入新密码为空");
UmsAdmin admin = adminService.getAdminById(umsMember.getId()); }
admin.setPassword(encode); //对比传入验证码
adminService.update(admin); if(this.redisService.get(umsMemberRequestParam.getPhone()).equals(umsMemberRequestParam.getAuthCode())){
return CommonResult.success(null, "密码修改成功"); //如果相等 则修改密码
UmsMember umsMember = new UmsMember();
umsMember.setId(umsMemberRequestParam.getId());
umsMember.setPassword(umsMemberRequestParam.getNewPassWord());
this.umsMemberMapper.updateByPrimaryKeySelective(umsMember);
return new ResultMsg(true,"修改成功");
}
return new ResultMsg(false,"验证码校验不成功");
} }
@Override @Override
......
...@@ -913,8 +913,6 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -913,8 +913,6 @@ public class PmsProductServiceImpl implements PmsProductService {
} }
if(publishStatus != null){ if(publishStatus != null){
criteria.andPublishStatusEqualTo(publishStatus); criteria.andPublishStatusEqualTo(publishStatus);
}else{
criteria.andPublishStatusEqualTo(1);//上架状态:0->下架;1->上架
} }
criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除(彻底删除) criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除(彻底删除)
//注意:排序使用的是列名 //注意:排序使用的是列名
......
package com.macro.mall.service; package com.macro.mall.service.quanxing;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.model.PmsProductAttributeCategory; import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.model.dto.quanxing.PmsProductAttributeTypeDto; import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import java.util.List; import java.util.List;
......
package com.macro.mall.service.impl; package com.macro.mall.service.quanxing.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.PmsProductAttributeCategoryDao; import com.macro.mall.dao.quanxing.PmsProductAttributeCategoryDao;
import com.macro.mall.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.mapper.PmsProductAttributeCategoryMapper; import com.macro.mall.mapper.PmsProductAttributeCategoryMapper;
import com.macro.mall.model.PmsProductAttributeCategory; import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.model.PmsProductAttributeCategoryExample; import com.macro.mall.model.PmsProductAttributeCategoryExample;
import com.macro.mall.model.UmsMemberExample; import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.model.dto.quanxing.PmsProductAttributeTypeDto; import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import com.macro.mall.service.PmsProductAttributeCategoryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
......
...@@ -60,6 +60,7 @@ public class PmsSupplierAuditServiceImpl implements IPmsSupplierAuditService { ...@@ -60,6 +60,7 @@ public class PmsSupplierAuditServiceImpl implements IPmsSupplierAuditService {
pmsSupplierAudit.setId(pmsSupplierAuditRequest.getId()); pmsSupplierAudit.setId(pmsSupplierAuditRequest.getId());
pmsSupplierAudit.setStatus(pmsSupplierAuditRequest.getStatus()); pmsSupplierAudit.setStatus(pmsSupplierAuditRequest.getStatus());
pmsSupplierAudit.setRemarks(pmsSupplierAuditRequest.getRemarks()); pmsSupplierAudit.setRemarks(pmsSupplierAuditRequest.getRemarks());
pmsSupplierAudit.setAuditBy(pmsSupplierAuditRequest.getMemberId());
if(pmsSupplierAuditRequest.getStatus() == 1){//审核通过还需将信息写入会员表 if(pmsSupplierAuditRequest.getStatus() == 1){//审核通过还需将信息写入会员表
//补充会员信息 //补充会员信息
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.dao.PmsProductAttributeCategoryDao"> <mapper namespace="com.macro.mall.dao.quanxing.PmsProductAttributeCategoryDao">
<resultMap id="getListWithAttrMap" type="com.macro.mall.dto.PmsProductAttributeCategoryItem" extends="com.macro.mall.mapper.PmsProductAttributeCategoryMapper.BaseResultMap"> <resultMap id="getListWithAttrMap" type="com.macro.mall.model.dto.PmsProductAttributeCategoryItem" extends="com.macro.mall.mapper.PmsProductAttributeCategoryMapper.BaseResultMap">
<collection property="productAttributeList" columnPrefix="attr_" resultMap="com.macro.mall.mapper.PmsProductAttributeMapper.BaseResultMap"> <collection property="productAttributeList" columnPrefix="attr_" resultMap="com.macro.mall.mapper.PmsProductAttributeMapper.BaseResultMap">
</collection> </collection>
</resultMap> </resultMap>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment