Commit 1cad1abd by XiaHou

first

parent fa69d450
...@@ -3,6 +3,7 @@ package com.macro.mall.controller; ...@@ -3,6 +3,7 @@ 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.core.annotion.BussinessLog; import com.macro.mall.core.annotion.BussinessLog;
import com.macro.mall.domain.MemberDetails;
import com.macro.mall.dto.AdminUpdateParam; import com.macro.mall.dto.AdminUpdateParam;
import com.macro.mall.dto.UmsAdminLoginParam; import com.macro.mall.dto.UmsAdminLoginParam;
import com.macro.mall.domain.dto.UmsAdminParam; import com.macro.mall.domain.dto.UmsAdminParam;
...@@ -13,8 +14,12 @@ import com.macro.mall.service.UmsRoleService; ...@@ -13,8 +14,12 @@ import com.macro.mall.service.UmsRoleService;
import com.macro.mall.service.system.UmsAdminService; import com.macro.mall.service.system.UmsAdminService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -210,4 +215,5 @@ public class UmsAdminController { ...@@ -210,4 +215,5 @@ public class UmsAdminController {
List<UmsPermission> permissionList = adminService.getPermissionList(adminId); List<UmsPermission> permissionList = adminService.getPermissionList(adminId);
return CommonResult.success(permissionList); return CommonResult.success(permissionList);
} }
} }
package com.macro.mall.controller.vanke;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.UmsAdmin;
import com.macro.mall.model.VankeDepartment;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.service.vanke.IVankeDepartmentSerive;
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;
import java.util.List;
@Controller
@Api(tags = "万科后台_部门相关接口", description = "部门控制器")
@RequestMapping("/admin")
public class VankeDepartmentController {
@Autowired
private IVankeDepartmentSerive vankeDepartmentSerive;
@ApiOperation("万科后台_部门分页操作")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<VankeDepartment>> list(@ApiParam(value="分页页数") @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
@ApiParam(value="分页大小") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
return CommonResult.success(CommonPage.restPage(this.vankeDepartmentSerive.getPageList(pageNum, pageSize)));
}
@ApiOperation("万科后台_部门插入操作")
@RequestMapping(value = "/insertDepartment", method = RequestMethod.POST)
@ResponseBody
public CommonResult insertDepartment(VankeDepartment vankeDepartment){
ResultMsg res = this.vankeDepartmentSerive.insertDepartment(vankeDepartment);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
@ApiOperation("万科后台_根据部门id修改一条数据")
@RequestMapping(value = "/insertDepartment", method = RequestMethod.POST)
@ResponseBody
public CommonResult updateDepartment(VankeDepartment vankeDepartment){
ResultMsg res = this.vankeDepartmentSerive.updateDepartment(vankeDepartment);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
}
...@@ -9,18 +9,10 @@ import java.util.List; ...@@ -9,18 +9,10 @@ import java.util.List;
public interface PmsProductAttributeTypeService { public interface PmsProductAttributeTypeService {
int create(String name, Long attributeCategoryId); int create(String name, Long attributeCategoryId);
List<PmsAttributeTypeReulst> getList(Integer pageSize, Integer pageNum, Long attributeCategoryId);
int delete(List<Long> ids); int delete(List<Long> ids);
int update(PmsProductAttributeType pmsProductAttributeType); int update(PmsProductAttributeType pmsProductAttributeType);
PmsProductAttributeType getUpdateInfo(Long id); PmsProductAttributeType getUpdateInfo(Long id);
/**
* 根据分类Id查询
* @param AttributeCategoryId
* @return
*/
List<PmsProductAttributeTypeDto> getAttributeType(Long AttributeCategoryId);
} }
...@@ -10,15 +10,11 @@ import java.util.List; ...@@ -10,15 +10,11 @@ import java.util.List;
public interface ProductAttributeGroupService { public interface ProductAttributeGroupService {
int create(PmsProductAttributeGroupParam pmsProductAttributeGroupParam); int create(PmsProductAttributeGroupParam pmsProductAttributeGroupParam);
List<PmsAttributeGroupResult> getList(Long cid, Integer pageSize, Integer pageNum, Long attributeCategoryId);
int update(Long id, PmsProductAttributeGroupParam productAttributeParam); int update(Long id, PmsProductAttributeGroupParam productAttributeParam);
PmsProductAttributeGroup getParamGroup(Long id); PmsProductAttributeGroup getParamGroup(Long id);
int delete(List<Long> ids); int delete(List<Long> ids);
List<AttributeGroupVo> paramsList(Long cid, Integer type, Long mchtId);
int updateMoveGroup(Long id, Long tagAttributeCategoryId, Long tagAttributeTypeId); int updateMoveGroup(Long id, Long tagAttributeCategoryId, Long tagAttributeTypeId);
} }
package com.macro.mall.service.impl; package com.macro.mall.service.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.quanxing.product.PmsProductAttributeGroupDao;
import com.macro.mall.dao.quanxing.product.PmsProductAttributeTypeDao;
import com.macro.mall.mapper.PmsProductAttributeCategoryMapper; 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.PmsProductAttributeTypeService; import com.macro.mall.service.PmsProductAttributeTypeService;
import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -23,12 +20,6 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy ...@@ -23,12 +20,6 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy
private PmsProductAttributeCategoryMapper pmsProductAttributeCategoryMapper; private PmsProductAttributeCategoryMapper pmsProductAttributeCategoryMapper;
@Resource @Resource
private PmsProductAttributeTypeMapper pmsProductAttributeTypeMapper; private PmsProductAttributeTypeMapper pmsProductAttributeTypeMapper;
@Resource
private PmsProductAttributeTypeDao pmsProductAttributeTypeDao;
@Resource
private PmsProductAttributeCategoryService pmsProductAttributeCategoryService;
@Resource
private PmsProductAttributeGroupDao pmsProductAttributeGroupDao;
@Override @Override
...@@ -53,17 +44,6 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy ...@@ -53,17 +44,6 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy
} }
@Override @Override
public List<PmsAttributeTypeReulst> getList(Integer pageSize, Integer pageNum, Long attributeCategoryId) {
PageHelper.startPage(pageNum, pageSize);
Map<String,Object> map = new HashMap<>();
if(attributeCategoryId != null){
List<Long> attributeCategoryIdList = pmsProductAttributeCategoryService.getAtributeCategoryIdList(attributeCategoryId);
map.put("attributeCategoryIdList",attributeCategoryIdList);
}
return pmsProductAttributeTypeDao.getList(map);
}
@Override
public int delete(List<Long> ids) { public int delete(List<Long> ids) {
PmsProductAttributeTypeExample example = new PmsProductAttributeTypeExample(); PmsProductAttributeTypeExample example = new PmsProductAttributeTypeExample();
example.createCriteria().andIdIn(ids).andDeleteStatusEqualTo(0); example.createCriteria().andIdIn(ids).andDeleteStatusEqualTo(0);
...@@ -91,18 +71,4 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy ...@@ -91,18 +71,4 @@ public class PmsProductAttributeTypeServiceImpl implements PmsProductAttributeTy
public PmsProductAttributeType getUpdateInfo(Long id) { public PmsProductAttributeType getUpdateInfo(Long id) {
return pmsProductAttributeTypeMapper.selectByPrimaryKey(id); return pmsProductAttributeTypeMapper.selectByPrimaryKey(id);
} }
/**
* 根据分类Id查询
* @param AttributeCategoryId
* @return
*/
public List<PmsProductAttributeTypeDto> getAttributeType(Long AttributeCategoryId){
List<PmsProductAttributeTypeDto> pmsProductAttributeTypeDtoList = this.pmsProductAttributeTypeDao.selectByAttributeCategoryId(AttributeCategoryId);
pmsProductAttributeTypeDtoList.forEach(pmsProductAttributeTypeDto ->{
pmsProductAttributeTypeDto.setPmsProductAttributeGroupList(this.pmsProductAttributeGroupDao.selectByProductAttributeTypeId(pmsProductAttributeTypeDto.getId()));
});
return pmsProductAttributeTypeDtoList;
}
} }
package com.macro.mall.service.impl; package com.macro.mall.service.impl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
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.ProductAttributeGroupService; import com.macro.mall.service.ProductAttributeGroupService;
import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -20,22 +18,10 @@ public class ProductAttributeGroupServiceImpl implements ProductAttributeGroupSe ...@@ -20,22 +18,10 @@ public class ProductAttributeGroupServiceImpl implements ProductAttributeGroupSe
@Resource @Resource
private PmsProductAttributeGroupMapper pmsProductAttributeGroupMapper; private PmsProductAttributeGroupMapper pmsProductAttributeGroupMapper;
@Resource @Resource
private PmsProductAttributeGroupDao pmsProductAttributeGroupDao;
@Resource
private PmsProductAttributeTypeMapper pmsProductAttributeTypeMapper; private PmsProductAttributeTypeMapper pmsProductAttributeTypeMapper;
@Resource @Resource
private PmsProductAttributeMapper pmsProductAttributeMapper; private PmsProductAttributeMapper pmsProductAttributeMapper;
@Resource
private PmsProductAttributeCategoryService pmsProductAttributeCategoryService;
@Override
public List<PmsAttributeGroupResult> getList(Long cid, Integer pageSize, Integer pageNum, Long attributeCategoryId) {
PageHelper.startPage(pageNum, pageSize);
Map<String,Object> map = new HashMap<>();
map.put("cid",cid);
map.put("attributeCategoryId",pmsProductAttributeCategoryService.getAtributeCategoryIdList(attributeCategoryId));
return pmsProductAttributeGroupDao.getList(map);
}
@Override @Override
public int create(PmsProductAttributeGroupParam pmsProductAttributeGroupParam) { public int create(PmsProductAttributeGroupParam pmsProductAttributeGroupParam) {
...@@ -88,51 +74,6 @@ public class ProductAttributeGroupServiceImpl implements ProductAttributeGroupSe ...@@ -88,51 +74,6 @@ public class ProductAttributeGroupServiceImpl implements ProductAttributeGroupSe
} }
@Override @Override
public List<AttributeGroupVo> paramsList(Long cid, Integer type, Long mchtId) {
List<AttributeGroupVo> list = new ArrayList<>();
List<PmsProductAttributeGroup> groups = pmsProductAttributeGroupDao.getGroupList(cid);
if(!groups.isEmpty()){
for (PmsProductAttributeGroup group : groups) {
AttributeGroupVo attributeGroupVo = new AttributeGroupVo();
Long groupId = group.getId();
attributeGroupVo.setAttributeGroupId(groupId);
attributeGroupVo.setAttributeGroupName(group.getName());
PmsProductAttributeExample example = new PmsProductAttributeExample();
PmsProductAttributeExample.Criteria criteria = example.createCriteria();
criteria.andDeleteStatusEqualTo(0).andTypeEqualTo(type).andProductAttributeGroupIdEqualTo(groupId);
if(type == 0 && groupId == 0){//手动添加的规格需要加上商家id(商家自己创建的)
if(mchtId == null){
continue;
}
criteria.andMchtIdEqualTo(mchtId);
}
List<PmsProductAttribute> attributelist = pmsProductAttributeMapper.selectByExample(example);
if(attributelist.size() <= 0){
continue;
}
attributeGroupVo.setAttributes(attributelist);
list.add(attributeGroupVo);
}
//规格
if (type == 0 && list.size() > 0){
List<PmsProductAttribute> allAttribute = new ArrayList<>();
for (int i = list.size()-1;i >= 0;i--){
AttributeGroupVo groupVo = list.get(i);
allAttribute.addAll(groupVo.getAttributes());
if (i != 0) {
list.remove(i);
}
}
//按正序排序
allAttribute = allAttribute.stream().sorted(Comparator.comparing(PmsProductAttribute::getSort)).collect(Collectors.toList());
list.get(0).setAttributes(allAttribute);
}
}
return list;
}
@Override
public int updateMoveGroup(Long id, Long tagAttributeCategoryId, Long tagAttributeTypeId) { public int updateMoveGroup(Long id, Long tagAttributeCategoryId, Long tagAttributeTypeId) {
//更新属性(类型) //更新属性(类型)
PmsProductAttributeGroup group = pmsProductAttributeGroupMapper.selectByPrimaryKey(id); PmsProductAttributeGroup group = pmsProductAttributeGroupMapper.selectByPrimaryKey(id);
......
package com.macro.mall.mapper;
import com.macro.mall.model.VankeBackLog;
import com.macro.mall.model.VankeBackLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface VankeBackLogMapper {
long countByExample(VankeBackLogExample example);
int deleteByExample(VankeBackLogExample example);
int deleteByPrimaryKey(Long id);
int insert(VankeBackLog record);
int insertSelective(VankeBackLog record);
List<VankeBackLog> selectByExample(VankeBackLogExample example);
VankeBackLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") VankeBackLog record, @Param("example") VankeBackLogExample example);
int updateByExample(@Param("record") VankeBackLog record, @Param("example") VankeBackLogExample example);
int updateByPrimaryKeySelective(VankeBackLog record);
int updateByPrimaryKey(VankeBackLog record);
}
\ No newline at end of file
package com.macro.mall.mapper;
import com.macro.mall.model.VankeDepartment;
import com.macro.mall.model.VankeDepartmentExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface VankeDepartmentMapper {
long countByExample(VankeDepartmentExample example);
int deleteByExample(VankeDepartmentExample example);
int deleteByPrimaryKey(Long id);
int insert(VankeDepartment record);
int insertSelective(VankeDepartment record);
List<VankeDepartment> selectByExample(VankeDepartmentExample example);
VankeDepartment selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") VankeDepartment record, @Param("example") VankeDepartmentExample example);
int updateByExample(@Param("record") VankeDepartment record, @Param("example") VankeDepartmentExample example);
int updateByPrimaryKeySelective(VankeDepartment record);
int updateByPrimaryKey(VankeDepartment record);
}
\ No newline at end of file
package com.macro.mall.model;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
public class VankeBackLog implements Serializable {
@ApiModelProperty(value = "id")
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@ApiModelProperty(value = "操作信息")
private String msg;
@ApiModelProperty(value = "操作人")
private Long createBy;
@ApiModelProperty(value = "1未删除 0已删除")
private Integer deleteStatus;
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Long getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Integer getDeleteStatus() {
return deleteStatus;
}
public void setDeleteStatus(Integer deleteStatus) {
this.deleteStatus = deleteStatus;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", msg=").append(msg);
sb.append(", createBy=").append(createBy);
sb.append(", deleteStatus=").append(deleteStatus);
sb.append(", createtime=").append(createtime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.macro.mall.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class VankeBackLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public VankeBackLogExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andMsgIsNull() {
addCriterion("msg is null");
return (Criteria) this;
}
public Criteria andMsgIsNotNull() {
addCriterion("msg is not null");
return (Criteria) this;
}
public Criteria andMsgEqualTo(String value) {
addCriterion("msg =", value, "msg");
return (Criteria) this;
}
public Criteria andMsgNotEqualTo(String value) {
addCriterion("msg <>", value, "msg");
return (Criteria) this;
}
public Criteria andMsgGreaterThan(String value) {
addCriterion("msg >", value, "msg");
return (Criteria) this;
}
public Criteria andMsgGreaterThanOrEqualTo(String value) {
addCriterion("msg >=", value, "msg");
return (Criteria) this;
}
public Criteria andMsgLessThan(String value) {
addCriterion("msg <", value, "msg");
return (Criteria) this;
}
public Criteria andMsgLessThanOrEqualTo(String value) {
addCriterion("msg <=", value, "msg");
return (Criteria) this;
}
public Criteria andMsgLike(String value) {
addCriterion("msg like", value, "msg");
return (Criteria) this;
}
public Criteria andMsgNotLike(String value) {
addCriterion("msg not like", value, "msg");
return (Criteria) this;
}
public Criteria andMsgIn(List<String> values) {
addCriterion("msg in", values, "msg");
return (Criteria) this;
}
public Criteria andMsgNotIn(List<String> values) {
addCriterion("msg not in", values, "msg");
return (Criteria) this;
}
public Criteria andMsgBetween(String value1, String value2) {
addCriterion("msg between", value1, value2, "msg");
return (Criteria) this;
}
public Criteria andMsgNotBetween(String value1, String value2) {
addCriterion("msg not between", value1, value2, "msg");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(Long value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(Long value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(Long value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(Long value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(Long value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(Long value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<Long> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<Long> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(Long value1, Long value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(Long value1, Long value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andDeleteStatusIsNull() {
addCriterion("delete_status is null");
return (Criteria) this;
}
public Criteria andDeleteStatusIsNotNull() {
addCriterion("delete_status is not null");
return (Criteria) this;
}
public Criteria andDeleteStatusEqualTo(Integer value) {
addCriterion("delete_status =", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotEqualTo(Integer value) {
addCriterion("delete_status <>", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusGreaterThan(Integer value) {
addCriterion("delete_status >", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("delete_status >=", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusLessThan(Integer value) {
addCriterion("delete_status <", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusLessThanOrEqualTo(Integer value) {
addCriterion("delete_status <=", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusIn(List<Integer> values) {
addCriterion("delete_status in", values, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotIn(List<Integer> values) {
addCriterion("delete_status not in", values, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusBetween(Integer value1, Integer value2) {
addCriterion("delete_status between", value1, value2, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotBetween(Integer value1, Integer value2) {
addCriterion("delete_status not between", value1, value2, "deleteStatus");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createtime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createtime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createtime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createtime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createtime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createtime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createtime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createtime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createtime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createtime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createtime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createtime not between", value1, value2, "createtime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
package com.macro.mall.model;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
public class VankeDepartment implements Serializable {
@ApiModelProperty(value = "id")
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
@ApiModelProperty(value = "部门名称")
private String name;
@ApiModelProperty(value = "1未删除 0已删除")
private Integer deleteStatus;
@ApiModelProperty(value = "1启用 0禁用")
private Integer status;
@ApiModelProperty(value = "创建人")
private Long createBy;
@ApiModelProperty(value = "修改人")
private Long updateBy;
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createtime;
@ApiModelProperty(value = "更新时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updatetime;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDeleteStatus() {
return deleteStatus;
}
public void setDeleteStatus(Integer deleteStatus) {
this.deleteStatus = deleteStatus;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
public Long getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Long updateBy) {
this.updateBy = updateBy;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", deleteStatus=").append(deleteStatus);
sb.append(", status=").append(status);
sb.append(", createBy=").append(createBy);
sb.append(", updateBy=").append(updateBy);
sb.append(", createtime=").append(createtime);
sb.append(", updatetime=").append(updatetime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.macro.mall.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class VankeDepartmentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public VankeDepartmentExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andDeleteStatusIsNull() {
addCriterion("delete_status is null");
return (Criteria) this;
}
public Criteria andDeleteStatusIsNotNull() {
addCriterion("delete_status is not null");
return (Criteria) this;
}
public Criteria andDeleteStatusEqualTo(Integer value) {
addCriterion("delete_status =", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotEqualTo(Integer value) {
addCriterion("delete_status <>", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusGreaterThan(Integer value) {
addCriterion("delete_status >", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("delete_status >=", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusLessThan(Integer value) {
addCriterion("delete_status <", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusLessThanOrEqualTo(Integer value) {
addCriterion("delete_status <=", value, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusIn(List<Integer> values) {
addCriterion("delete_status in", values, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotIn(List<Integer> values) {
addCriterion("delete_status not in", values, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusBetween(Integer value1, Integer value2) {
addCriterion("delete_status between", value1, value2, "deleteStatus");
return (Criteria) this;
}
public Criteria andDeleteStatusNotBetween(Integer value1, Integer value2) {
addCriterion("delete_status not between", value1, value2, "deleteStatus");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(Long value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(Long value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(Long value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(Long value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(Long value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(Long value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<Long> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<Long> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(Long value1, Long value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(Long value1, Long value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andUpdateByIsNull() {
addCriterion("update_by is null");
return (Criteria) this;
}
public Criteria andUpdateByIsNotNull() {
addCriterion("update_by is not null");
return (Criteria) this;
}
public Criteria andUpdateByEqualTo(Long value) {
addCriterion("update_by =", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotEqualTo(Long value) {
addCriterion("update_by <>", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByGreaterThan(Long value) {
addCriterion("update_by >", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByGreaterThanOrEqualTo(Long value) {
addCriterion("update_by >=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByLessThan(Long value) {
addCriterion("update_by <", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByLessThanOrEqualTo(Long value) {
addCriterion("update_by <=", value, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByIn(List<Long> values) {
addCriterion("update_by in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotIn(List<Long> values) {
addCriterion("update_by not in", values, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByBetween(Long value1, Long value2) {
addCriterion("update_by between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andUpdateByNotBetween(Long value1, Long value2) {
addCriterion("update_by not between", value1, value2, "updateBy");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createtime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createtime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createtime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createtime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createtime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createtime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createtime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createtime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createtime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createtime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createtime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createtime not between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andUpdatetimeIsNull() {
addCriterion("updatetime is null");
return (Criteria) this;
}
public Criteria andUpdatetimeIsNotNull() {
addCriterion("updatetime is not null");
return (Criteria) this;
}
public Criteria andUpdatetimeEqualTo(Date value) {
addCriterion("updatetime =", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeNotEqualTo(Date value) {
addCriterion("updatetime <>", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeGreaterThan(Date value) {
addCriterion("updatetime >", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("updatetime >=", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeLessThan(Date value) {
addCriterion("updatetime <", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeLessThanOrEqualTo(Date value) {
addCriterion("updatetime <=", value, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeIn(List<Date> values) {
addCriterion("updatetime in", values, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeNotIn(List<Date> values) {
addCriterion("updatetime not in", values, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeBetween(Date value1, Date value2) {
addCriterion("updatetime between", value1, value2, "updatetime");
return (Criteria) this;
}
public Criteria andUpdatetimeNotBetween(Date value1, Date value2) {
addCriterion("updatetime not between", value1, value2, "updatetime");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}
\ No newline at end of file
<?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">
<mapper namespace="com.macro.mall.mapper.VankeBackLogMapper">
<resultMap id="BaseResultMap" type="com.macro.mall.model.VankeBackLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="msg" jdbcType="VARCHAR" property="msg" />
<result column="create_by" jdbcType="BIGINT" property="createBy" />
<result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, msg, create_by, delete_status, createtime
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.VankeBackLogExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from vanke_back_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from vanke_back_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from vanke_back_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.VankeBackLogExample">
delete from vanke_back_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.VankeBackLog">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into vanke_back_log (msg, create_by, delete_status,
createtime)
values (#{msg,jdbcType=VARCHAR}, #{createBy,jdbcType=BIGINT}, #{deleteStatus,jdbcType=INTEGER},
#{createtime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.VankeBackLog">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into vanke_back_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="msg != null">
msg,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="deleteStatus != null">
delete_status,
</if>
<if test="createtime != null">
createtime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="msg != null">
#{msg,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=BIGINT},
</if>
<if test="deleteStatus != null">
#{deleteStatus,jdbcType=INTEGER},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.VankeBackLogExample" resultType="java.lang.Long">
select count(*) from vanke_back_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update vanke_back_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.msg != null">
msg = #{record.msg,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=BIGINT},
</if>
<if test="record.deleteStatus != null">
delete_status = #{record.deleteStatus,jdbcType=INTEGER},
</if>
<if test="record.createtime != null">
createtime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update vanke_back_log
set id = #{record.id,jdbcType=BIGINT},
msg = #{record.msg,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=BIGINT},
delete_status = #{record.deleteStatus,jdbcType=INTEGER},
createtime = #{record.createtime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.VankeBackLog">
update vanke_back_log
<set>
<if test="msg != null">
msg = #{msg,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=BIGINT},
</if>
<if test="deleteStatus != null">
delete_status = #{deleteStatus,jdbcType=INTEGER},
</if>
<if test="createtime != null">
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.VankeBackLog">
update vanke_back_log
set msg = #{msg,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=BIGINT},
delete_status = #{deleteStatus,jdbcType=INTEGER},
createtime = #{createtime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
<?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">
<mapper namespace="com.macro.mall.mapper.VankeDepartmentMapper">
<resultMap id="BaseResultMap" type="com.macro.mall.model.VankeDepartment">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_by" jdbcType="BIGINT" property="createBy" />
<result column="update_by" jdbcType="BIGINT" property="updateBy" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, delete_status, status, create_by, update_by, createtime, updatetime
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.VankeDepartmentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from vanke_department
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from vanke_department
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from vanke_department
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.VankeDepartmentExample">
delete from vanke_department
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.VankeDepartment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into vanke_department (name, delete_status, status,
create_by, update_by, createtime,
updatetime)
values (#{name,jdbcType=VARCHAR}, #{deleteStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createBy,jdbcType=BIGINT}, #{updateBy,jdbcType=BIGINT}, #{createtime,jdbcType=TIMESTAMP},
#{updatetime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.VankeDepartment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into vanke_department
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="deleteStatus != null">
delete_status,
</if>
<if test="status != null">
status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createtime != null">
createtime,
</if>
<if test="updatetime != null">
updatetime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="deleteStatus != null">
#{deleteStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createBy != null">
#{createBy,jdbcType=BIGINT},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=BIGINT},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
#{updatetime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.VankeDepartmentExample" resultType="java.lang.Long">
select count(*) from vanke_department
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update vanke_department
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.deleteStatus != null">
delete_status = #{record.deleteStatus,jdbcType=INTEGER},
</if>
<if test="record.status != null">
status = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=BIGINT},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=BIGINT},
</if>
<if test="record.createtime != null">
createtime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
<if test="record.updatetime != null">
updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update vanke_department
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
delete_status = #{record.deleteStatus,jdbcType=INTEGER},
status = #{record.status,jdbcType=INTEGER},
create_by = #{record.createBy,jdbcType=BIGINT},
update_by = #{record.updateBy,jdbcType=BIGINT},
createtime = #{record.createtime,jdbcType=TIMESTAMP},
updatetime = #{record.updatetime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.VankeDepartment">
update vanke_department
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="deleteStatus != null">
delete_status = #{deleteStatus,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=BIGINT},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=BIGINT},
</if>
<if test="createtime != null">
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.VankeDepartment">
update vanke_department
set name = #{name,jdbcType=VARCHAR},
delete_status = #{deleteStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=BIGINT},
update_by = #{updateBy,jdbcType=BIGINT},
createtime = #{createtime,jdbcType=TIMESTAMP},
updatetime = #{updatetime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import java.util.List;
public interface OmsChoseProductDao {
List<OmsChoseProductDto> selectListByMemberId(Long memberId);
}
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();
}
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.PmsProductSkuValue;
import com.macro.mall.model.dto.quanxing.PmsProductSkuValueDto;
import org.apache.ibatis.annotations.Param;
import javax.transaction.Transactional;
import java.util.List;
/**
* 商品参数,商品自定义规格属性Dao
* Created by macro on 2018/4/26.
*/
public interface PmsProductSkuValueDao {
@Transactional
int insertList(@Param("list") List<PmsProductSkuValue> productSkuValueList);
/**
* 根据商品id 返回商品规格值List
* @param productId
* @return
*/
List<PmsProductSkuValueDto> selectListByProductId(Long productId);
/**
* 根据商品id 修改删除状态
* @param pmsProductSkuValue
* @return
*/
int updateDeleteStatusByProductId(PmsProductSkuValue pmsProductSkuValue);
}
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.PmsSupplierAudit;
import java.util.List;
public interface PmsSupplierAuditDao {
PmsSupplierAudit selectOneByMemberId(Long memberId);
/**
* 返回数量
* @param pmsSupplierAudit
* @return
*/
Integer selectCount(PmsSupplierAudit pmsSupplierAudit);
}
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.PmsSupplierAuditProduct;
import java.util.List;
public interface PmsSupplierAuditProductDao {
List<PmsSupplierAuditProduct> selectListByAuditId(Long auditId);
}
package com.macro.mall.dao.quanxing.product;
import com.macro.mall.model.AttributeGroupVo;
import com.macro.mall.model.PmsAttributeGroupResult;
import com.macro.mall.model.PmsProductAttributeGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
public interface PmsProductAttributeGroupDao {
@Select("SELECT " +
"a.id AS attributeGroupId, " +
"a.`name` AS attributeGroupName, " +
"b.id AS attributeId, " +
"b.`name` AS attributeName " +
"FROM " +
"pms_product_attribute_category pac " +
"join pms_product_attribute_type pat on pac.id = pat.attribute_category_id " +
"join pms_product_attribute_group a on a.product_attribute_type_id = pat.id " +
"JOIN pms_product_attribute b ON a.id = b.product_attribute_category_id " +
"AND b.type = 1 " +
"WHERE " +
"a.delete_status = 0 " +
"AND a.`status` = 0 " +
"and pac.delete_status = 0 " +
"and pat.delete_status = 0 " +
"AND b.delete_status = 0 " +
"AND pac.id = #{cid} " +
"ORDER BY b.sort")
List<AttributeGroupVo> getParamsList(@Param("cid") Long cid);
List<PmsAttributeGroupResult> getList(Map<String, Object> map);
@Select("SELECT " +
"a.* " +
"FROM " +
"pms_product_category c " +
"join pms_product_attribute_category pac on pac.id = c.attribute_category_id " +
"join pms_product_attribute_type pat on pac.id = pat.attribute_category_id " +
"join pms_product_attribute_group a on a.product_attribute_type_id = pat.id " +
"WHERE " +
"a.delete_status = 0 " +
"AND a.`status` = 0 " +
"and pac.delete_status = 0 " +
"and pat.delete_status = 0 " +
"and c.delete_status = 0 " +
"AND (c.id = #{cid} or c.id = 9999) ")
List<PmsProductAttributeGroup> getGroupList(@Param("cid") Long cid);
/**
* 根据属性分类id查询 规格
* @param productAttributeTypeId
* @return
*/
List<PmsProductAttributeGroup> selectByProductAttributeTypeId(Long productAttributeTypeId);
}
package com.macro.mall.dao.quanxing.product;
import com.macro.mall.model.PmsAttributeTypeReulst;
import com.macro.mall.model.dto.quanxing.PmsProductAttributeTypeDto;
import java.util.List;
import java.util.Map;
public interface PmsProductAttributeTypeDao {
List<PmsProductAttributeTypeDto> selectByAttributeCategoryId(Long attributeCategoryId);
List<PmsAttributeTypeReulst> getList(Map<String, Object> map);
}
...@@ -171,12 +171,6 @@ public interface UmsMemberService { ...@@ -171,12 +171,6 @@ public interface UmsMemberService {
Integer setAccount(Long memberId,Integer flag); Integer setAccount(Long memberId,Integer flag);
/** /**
* 后台新增一个会员
* @return
*/
ResultMsg insertMember(UmsMember umsMember);
/**
* 根据账户类型 查找多个会员信息 * 根据账户类型 查找多个会员信息
* @param accouuntType * @param accouuntType
* @return * @return
...@@ -184,15 +178,6 @@ public interface UmsMemberService { ...@@ -184,15 +178,6 @@ public interface UmsMemberService {
List<UmsMember> getMemberListByAccountType(Integer accouuntType); List<UmsMember> getMemberListByAccountType(Integer accouuntType);
/** /**
* 分页查询会员信息
* @param pageNum
* @param pageSize
* @param accouuntType
* @return
*/
CommonPage<UmsMemberDto> getPageList(Integer pageNum, Integer pageSize, Integer accouuntType,String name,String phone,Integer status);
/**
* 根据id查询一条会员信息 * 根据id查询一条会员信息
* @return * @return
*/ */
......
...@@ -6,7 +6,6 @@ import com.macro.mall.common.api.CommonPage; ...@@ -6,7 +6,6 @@ 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.common.api.DateUtils; import com.macro.mall.common.api.DateUtils;
import com.macro.mall.dao.UmsMemberDao; import com.macro.mall.dao.UmsMemberDao;
import com.macro.mall.dao.quanxing.PmsSupplierAuditDao;
import com.macro.mall.domain.MemberDetails; import com.macro.mall.domain.MemberDetails;
import com.macro.mall.domain.dto.UmsMemberParam; import com.macro.mall.domain.dto.UmsMemberParam;
import com.macro.mall.domain.dto.UmsMemberReview; import com.macro.mall.domain.dto.UmsMemberReview;
...@@ -18,14 +17,12 @@ import com.macro.mall.mapper.UmsMemberMapper; ...@@ -18,14 +17,12 @@ import com.macro.mall.mapper.UmsMemberMapper;
import com.macro.mall.model.*; import com.macro.mall.model.*;
import com.macro.mall.domain.UmsMemberVerified; 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.quanxing.UmsMemberDto; import com.macro.mall.model.dto.quanxing.UmsMemberDto;
import com.macro.mall.model.dto.quanxing.UmsMemberRequestParam; 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;
import com.macro.mall.security.util.JwtTokenUtil; import com.macro.mall.security.util.JwtTokenUtil;
import com.macro.mall.service.quanxing.IPmsSupplierAuditService;
import com.macro.mall.service.system.RedisService; import com.macro.mall.service.system.RedisService;
import com.macro.mall.service.system.UmsAdminService; import com.macro.mall.service.system.UmsAdminService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -79,10 +76,6 @@ public class UmsMemberServiceImpl implements UmsMemberService { ...@@ -79,10 +76,6 @@ public class UmsMemberServiceImpl implements UmsMemberService {
private UmsMemberMapper umsMemberMapper; private UmsMemberMapper umsMemberMapper;
@Resource @Resource
private OmsOrderSonMapper orderSonMapper; private OmsOrderSonMapper orderSonMapper;
@Autowired
private IPmsSupplierAuditService pmsSupplierAuditService;
@Resource
private PmsSupplierAuditDao pmsSupplierAuditDao;
@Value("${redis.key.prefix.authCode}") @Value("${redis.key.prefix.authCode}")
private String REDIS_KEY_PREFIX_AUTH_CODE; private String REDIS_KEY_PREFIX_AUTH_CODE;
...@@ -710,70 +703,6 @@ public class UmsMemberServiceImpl implements UmsMemberService { ...@@ -710,70 +703,6 @@ public class UmsMemberServiceImpl implements UmsMemberService {
} }
/** /**
* 插入会员
* @param umsMember
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg insertMember(UmsMember umsMember){
ResultMsg res = this.checkInsertMember(umsMember);
if(!res.isFlag()){
return new ResultMsg(false,res.getMsg());
}
//加密密码
umsMember.setPassword( passwordEncoder.encode(umsMember.getPassword()));
//插入到会员表
this.umsMemberMapper.insertSelective(umsMember);
return new ResultMsg(true,"操作成功");
}
/**
* 校验插入会员
* @return
*/
private ResultMsg checkInsertMember(UmsMember umsMember){
if(umsMember == null){
return new ResultMsg(false,"传入会员为空");
}
if(umsMember.getUsername() == null || "".equals(umsMember.getUsername())){
//如果没传入会员账号 默认设置
umsMember.setUsername(this.pmsSupplierAuditService.getUsername());
}
if(umsMember.getPhone() == null || "".equals(umsMember.getPhone())){
return new ResultMsg(false,"手机号为空");
}else{
//手机号不为空 校验是否已存在此号码
UmsMember um =this.getByPhone(umsMember.getPhone());
if(um != null){
return new ResultMsg(false,"已存在此手机号!");
}
}
if(umsMember.getPassword() == null || "".equals(umsMember.getPassword())){
return new ResultMsg(false,"密码为空");
}
if(umsMember.getDeleteStatus() == null){
umsMember.setDeleteStatus(0);//默认未删除
}
if(umsMember.getBirthday() == null ){
umsMember.setBirthday(new Date());
}
if(umsMember.getCreateDate() == null){
umsMember.setCreateDate(new Date());
}
if(umsMember.getUpdateDate() == null){
umsMember.setUpdateDate(new Date());
}
if(umsMember.getCreateTime() == null){
umsMember.setCreateTime(new Date());
}
if(umsMember.getStatus() == null){
umsMember.setStatus(1);//帐号启用状态:0->禁用;1->启用
}
return new ResultMsg(true,"校验通过");
}
/**
* 根据账户类型 查找多个会员信息 * 根据账户类型 查找多个会员信息
* @param accouuntType * @param accouuntType
* @return * @return
...@@ -793,54 +722,6 @@ public class UmsMemberServiceImpl implements UmsMemberService { ...@@ -793,54 +722,6 @@ public class UmsMemberServiceImpl implements UmsMemberService {
/** /**
* 分页查询会员信息
* @param pageNum
* @param pageSize
* @param accouuntType
* @return
*/
@Override
public CommonPage<UmsMemberDto> getPageList(Integer pageNum, Integer pageSize, Integer accouuntType,String name,String phone,Integer status){
PageHelper.startPage(pageNum, pageSize);
UmsMemberExample example = new UmsMemberExample();
UmsMemberExample.Criteria criteria = example.createCriteria();
if(accouuntType != null){//如果账号类型不为空
criteria.andAccouuntTypeEqualTo(accouuntType);
}
if(name != null && !"".equals(name)){
criteria.andNameLike("name"+"%");
}
if(phone != null && !"".equals(phone)){
criteria.andPhoneLike("phone"+"%");
}
if(status != null){//如果账号类型不为空
criteria.andStatusEqualTo(status);
}
//过滤已删除的数据
criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除
List<UmsMember> dataList = this.umsMemberMapper.selectByExample(example);
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo<UmsMember> pageInfo = new PageInfo<>(dataList);
//创建List对象
List<UmsMemberDto> umdList = new ArrayList<>();
dataList.forEach(umsMember -> {
UmsMemberDto umsMemberDto = new UmsMemberDto();
//将属性赋值到另一个对象中去
BeanUtils.copyProperties(umsMember,umsMemberDto);
umsMemberDto.setPmsSupplierAudit(this.pmsSupplierAuditDao.selectOneByMemberId(umsMember.getId()));
umdList.add(umsMemberDto);
});
//因为进行了第二次查询 所以pageHelp得分页总数得到了变化 导致不准确 因此我们需要手动校准一下
CommonPage<UmsMemberDto> result = new CommonPage<UmsMemberDto>();
result.setTotalPage(pageInfo.getPages());
result.setPageNum(pageInfo.getPageNum());
result.setPageSize(pageInfo.getPageSize());
result.setTotal(pageInfo.getTotal());
result.setList(umdList);
return result;
}
/**
* 根据id查询一条会员信息 * 根据id查询一条会员信息
* @return * @return
*/ */
......
...@@ -84,16 +84,6 @@ public interface PmsProductService { ...@@ -84,16 +84,6 @@ public interface PmsProductService {
List<Long> getLikeId(String url); List<Long> getLikeId(String url);
/** /**
* 根据商品编号获取商品相关信息
*/
PmsProductRequestParam getProductById(Long id);
/**
* 更新商品
*/
ResultMsg updateProduct(PmsProductRequestParam pmsProductRequestParam);
/**
* 分页查询商品 * 分页查询商品
*/ */
List<PmsProductListResult> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum); List<PmsProductListResult> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum);
...@@ -204,15 +194,4 @@ public interface PmsProductService { ...@@ -204,15 +194,4 @@ public interface PmsProductService {
List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,Integer verifyStatus,Integer publishStatus, List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,Integer verifyStatus,Integer publishStatus,
Long productCategoryIdI,Long productCategoryId,Long productCategoryIdIII,String orderBy); Long productCategoryIdI,Long productCategoryId,Long productCategoryIdIII,String orderBy);
/**
* 获取供应商个人中心商品状态
* @return
*/
ResultMsg getSupplierProductStatus();
/**
* 获取管理员个人中心商品状态
* @return
*/
ResultMsg getAdminProductStatus();
} }
...@@ -5,8 +5,6 @@ import com.macro.mall.common.api.CommonResult; ...@@ -5,8 +5,6 @@ import com.macro.mall.common.api.CommonResult;
import com.macro.mall.common.api.StringUtils; import com.macro.mall.common.api.StringUtils;
import com.macro.mall.dao.platform.PmsSearchWordDao; import com.macro.mall.dao.platform.PmsSearchWordDao;
import com.macro.mall.dao.product.*; import com.macro.mall.dao.product.*;
import com.macro.mall.dao.quanxing.PmsProductSkuValueDao;
import com.macro.mall.dao.quanxing.PmsSupplierAuditDao;
import com.macro.mall.domain.dto.MchtProductQueryParam; import com.macro.mall.domain.dto.MchtProductQueryParam;
import com.macro.mall.domain.dto.PmsProductPicSearchParam; import com.macro.mall.domain.dto.PmsProductPicSearchParam;
import com.macro.mall.domain.dto.PmsProductRequestParam; import com.macro.mall.domain.dto.PmsProductRequestParam;
...@@ -100,15 +98,11 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -100,15 +98,11 @@ public class PmsProductServiceImpl implements PmsProductService {
private PmsCommentMapper pmsCommentMapper; private PmsCommentMapper pmsCommentMapper;
@Resource @Resource
private PmsSkuStockDao pmsSkuStockDao; private PmsSkuStockDao pmsSkuStockDao;
@Resource
private PmsProductSkuValueDao pmsProductSkuValueDao;
@Autowired @Autowired
private UmsMemberService umsMemberService; private UmsMemberService umsMemberService;
@Resource @Resource
private PmsSearchWordMapper pmsSearchWordMapper; private PmsSearchWordMapper pmsSearchWordMapper;
@Resource @Resource
private PmsSupplierAuditDao pmsSupplierAuditDao;
@Resource
private UmsMemberMapper umsMemberMapper; private UmsMemberMapper umsMemberMapper;
@Resource @Resource
private PmsSearchWordDao pmsSearchWordDao; private PmsSearchWordDao pmsSearchWordDao;
...@@ -172,55 +166,6 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -172,55 +166,6 @@ public class PmsProductServiceImpl implements PmsProductService {
return new ResultMsg(true,"校验通过"); return new ResultMsg(true,"校验通过");
} }
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg updateProduct(PmsProductRequestParam pmsProductRequestParam) {
if(pmsProductRequestParam.getPmsProduct().getId() == null){
return new ResultMsg(false,"请传入商品id");
}
//更新商品
this.pmsProductMapper.updateByPrimaryKeySelective(pmsProductRequestParam.getPmsProduct());
//商品规格值不为空 则执行插入操作
if(pmsProductRequestParam.getPmsProductSkuValueList() != null && pmsProductRequestParam.getPmsProductSkuValueList().size() > 0){
//将之前的sku_value value改为删除状态
PmsProductSkuValue ppsv = new PmsProductSkuValue();
ppsv.setProductId(pmsProductRequestParam.getPmsProduct().getId());
ppsv.setDeleteStatus(1);//删除标识0 未删除 1已删除
this.pmsProductSkuValueDao.updateDeleteStatusByProductId(ppsv);
pmsProductRequestParam.getPmsProductSkuValueList().forEach(pmsProductSkuValue->{
pmsProductSkuValue.setId(null);//防止前端 传入之前id 插入主键重复数据
pmsProductSkuValue.setProductId(pmsProductRequestParam.getPmsProduct().getId());
pmsProductSkuValue.setCreateDate(new Date());
pmsProductSkuValue.setUpdateDate(new Date());
this.pmsProductSkuValueMapper.insertSelective(pmsProductSkuValue);
});
}
//sku值不为空 则执行插入
if(pmsProductRequestParam.getPmsSkuStockList() != null && pmsProductRequestParam.getPmsSkuStockList().size() > 0){
//将之前sku 改为删除状态
PmsSkuStock pss = new PmsSkuStock();
pss.setProductId(pmsProductRequestParam.getPmsProduct().getId());
pss.setDeleteStatus(1);//删除标识0 未删除 1已删除
this.pmsSkuStockDao.updateDeleteStatusByProductId(pss);
pmsProductRequestParam.getPmsSkuStockList().forEach(pmsSkuStock ->{
//skuCode 生成规格 productId + 规格值id
String skuCode = pmsProductRequestParam.getPmsProduct().getId() + "";
String[] categoryIds=pmsSkuStock.getItemIds().split(",");
for (int i = 0; i < categoryIds.length; i++) {
skuCode = skuCode+"_"+ categoryIds[i];
}
pmsSkuStock.setId(null);//防止前端传入之前id 插入报主键重复
pmsSkuStock.setSkuCode(skuCode);
pmsSkuStock.setProductId(pmsProductRequestParam.getPmsProduct().getId());
pmsSkuStock.setCreateDate(new Date());
pmsSkuStock.setUpdateDate(new Date());
this.pmsSkuStockMapper.insertSelective(pmsSkuStock);
});
}
return new ResultMsg(true,"操作成功");
}
/** /**
* 商家商品列表 * 商家商品列表
* *
...@@ -473,25 +418,6 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -473,25 +418,6 @@ public class PmsProductServiceImpl implements PmsProductService {
} }
@Override @Override
public PmsProductRequestParam getProductById(Long id) {
//创建返回参数对象
PmsProductRequestParam pmsProductRequestParam = new PmsProductRequestParam();
//根据商品id 首先查询商品表相关数据
pmsProductRequestParam.setPmsProduct(this.pmsProductMapper.selectByPrimaryKey(id));
//根据商品id查询相关规格值
pmsProductRequestParam.setPmsProductSkuValueList(this.pmsProductSkuValueDao.selectListByProductId(id));
//根据商品id查询相关sku
pmsProductRequestParam.setPmsSkuStockList(this.pmsSkuStockDao.selectListByProductId(id));
//查询商品相关商家
if(pmsProductRequestParam.getPmsProduct() != null && pmsProductRequestParam.getPmsProduct().getMchtId() != null){
pmsProductRequestParam.setMember(this.umsMemberMapper.selectByPrimaryKey(pmsProductRequestParam.getPmsProduct().getMchtId()));
}
return pmsProductRequestParam;
}
@Override
public List<PmsProductListResult> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) { public List<PmsProductListResult> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
if(productQueryParam.getDeleteStatus() == null){ if(productQueryParam.getDeleteStatus() == null){
...@@ -911,76 +837,4 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -911,76 +837,4 @@ public class PmsProductServiceImpl implements PmsProductService {
return this.pmsProductMapper.selectByExample(example); return this.pmsProductMapper.selectByExample(example);
} }
/**
* 获取供应商个人中心商品状态
* @return
*/
@Override
public ResultMsg getSupplierProductStatus(){
//获取当前操作会员的id
Long memberId = umsMemberService.getCurrentMemberId();
//数据Map
Map<String,Object> dataMap =new HashMap<>();
//获取待审核
PmsProduct pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(0);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
pmsProduct.setMchtId(memberId);
dataMap.put("待审核",this.productDao.getProductCount(pmsProduct));
//获取已审核的
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setPublishStatus(1);//上架状态:0->下架;1->上架
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("已审核",this.productDao.getProductCount(pmsProduct));
//获取未通过
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setVerifyStatus(2);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("未通过",this.productDao.getProductCount(pmsProduct));
//获取已下架
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
pmsProduct.setPublishStatus(0);//上架状态:0->下架;1->上架
dataMap.put("已下架",this.productDao.getProductCount(pmsProduct));
return new ResultMsg(true,"获取数据成功",dataMap);
}
/**
* 获取管理员个人中心商品状态
* @return
*/
@Override
public ResultMsg getAdminProductStatus(){
//数据Map
Map<String,Object> dataMap =new HashMap<>();
//获取待审核
PmsProduct pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(0);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("待审核商品",this.productDao.getProductCount(pmsProduct));
//获取已审核的
pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("已审核商品",this.productDao.getProductCount(pmsProduct));
//获取未通过
pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(2);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("未通过商品",this.productDao.getProductCount(pmsProduct));
//获取待审核供应商
PmsSupplierAudit pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(0);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("待审核供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
//获取待审核供应商
pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(1);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("已审核供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
//获取待审核供应商
pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(2);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("未通过供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
return new ResultMsg(true,"查询成功",dataMap);
}
} }
package com.macro.mall.service.quanxing;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import java.util.List;
public interface IOmsChoseProductService {
/**
* 获取选择商品分页数据
* @param pageNum
* @param pageSize
* @param memberId
* @return
*/
List<OmsChoseProductDto> getListPage(Integer pageNum,Integer pageSize,Long memberId);
/**
* 插入一条选择商品
* @param omsChoseProduct
* @return
*/
ResultMsg insertChoseProduct(OmsChoseProduct omsChoseProduct);
/**
* 删除选择商品
* @param omsChoseProductDto
* @return
*/
ResultMsg deleteChoseProduct(OmsChoseProductDto omsChoseProductDto);
}
package com.macro.mall.service.quanxing;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.PmsSupplierAuditDto;
import com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest;
import java.util.List;
public interface IPmsSupplierAuditService {
/**
* 插入一条供应商审核
* @param pmsSupplierAuditDto
* @return
*/
ResultMsg insertSupplierAudit(PmsSupplierAuditDto pmsSupplierAuditDto);
/**
* 审核供应商
* @return
*/
ResultMsg auditSupplier(PmsSupplierAuditRequest pmsSupplierAuditRequest);
/**
* 得到UUID 随机八位数
* @return
*/
String getUsername();
/**
* 分页查询
* @param page
* @param size
* @param name
* @param phone
* @return
*/
CommonPage<PmsSupplierAuditDto> getPageList(Integer page, Integer size, String name, String phone, Integer status);
/**
* 根据id获取一条审核记录
* @param id
* @return
*/
PmsSupplierAuditDto getSupplierAuditById(Long id);
}
package com.macro.mall.service.quanxing;
import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import java.util.List;
/**
* 商品属性分类Service
* Created by macro on 2018/4/26.
*/
public interface PmsProductAttributeCategoryService {
int create(String name, Long id, Integer soft);
int update(Long id, PmsProductAttributeCategory name);
int delete(Long id);
PmsProductAttributeCategory getItem(Long id);
List<PmsProductAttributeCategory> getList(Integer pageSize, Integer pageNum, Long parentId);
List<PmsProductAttributeCategoryItem> getListWithAttr();
/**
* 获取所有子集类目id
* @param attributeCategoryId
* @return
*/
List<Long> getAtributeCategoryIdList(Long attributeCategoryId);
/**
* 查询所有分类 如果传入参数则根据对应参数查询
* @return
*/
List<PmsProductAttributeCategory> getAttributeCategoryList(Integer pageSize, Integer pageNum, Long parentId);
}
package com.macro.mall.service.quanxing.impl;
import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.quanxing.OmsChoseProductDao;
import com.macro.mall.mapper.OmsChoseProductMapper;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import com.macro.mall.service.member.UmsMemberService;
import com.macro.mall.service.quanxing.IOmsChoseProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
@Service
public class OmsChoseProductServiceImpl implements IOmsChoseProductService {
@Resource
private OmsChoseProductMapper omsChoseProductMapper;
@Resource
private OmsChoseProductDao omsChoseProductDao;
@Autowired
private UmsMemberService umsMemberService;
/**
* 获取选择商品分页数据
* @param pageNum
* @param pageSize
* @param memberId
* @return
*/
@Override
public List<OmsChoseProductDto> getListPage(Integer pageNum, Integer pageSize, Long memberId){
PageHelper.startPage(pageNum, pageSize);
OmsChoseProductDto omsChoseProductDto = new OmsChoseProductDto();
omsChoseProductDto.setMemberId(memberId);
return this.omsChoseProductDao.selectListByMemberId(memberId);
}
/**
* 插入一条选择商品
* @param omsChoseProduct
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg insertChoseProduct(OmsChoseProduct omsChoseProduct){
if(omsChoseProduct.getProductId() == null){
return new ResultMsg(false,"传入商品为空");
}
omsChoseProduct.setMemberId(this.umsMemberService.getCurrentMemberId());
this.omsChoseProductMapper.insertSelective(omsChoseProduct);
return new ResultMsg(true,"操作成功");
}
/**
* 删除选择商品
* @param omsChoseProductDto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg deleteChoseProduct(OmsChoseProductDto omsChoseProductDto){
if(omsChoseProductDto.getIds() == null || "".equals(omsChoseProductDto.getIds())){
return new ResultMsg(false,"传入id为空");
}
List idList = Arrays.asList(omsChoseProductDto.getIds().split(","));//根据逗号分隔转化为list
idList.forEach(id ->{
this.omsChoseProductMapper.deleteByPrimaryKey(Long.valueOf((String)id));
});
return new ResultMsg(true,"操作成功");
}
}
package com.macro.mall.service.quanxing.impl;
import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.quanxing.PmsProductAttributeCategoryDao;
import com.macro.mall.mapper.PmsProductAttributeCategoryMapper;
import com.macro.mall.model.PmsProductAttributeCategory;
import com.macro.mall.model.PmsProductAttributeCategoryExample;
import com.macro.mall.model.dto.PmsProductAttributeCategoryItem;
import com.macro.mall.service.quanxing.PmsProductAttributeCategoryService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* PmsProductAttributeCategoryService实现类
* Created by macro on 2018/4/26.
*/
@Service
public class PmsProductAttributeCategoryServiceImpl implements PmsProductAttributeCategoryService {
@Resource
private PmsProductAttributeCategoryMapper productAttributeCategoryMapper;
@Resource
private PmsProductAttributeCategoryDao productAttributeCategoryDao;
@Override
public int create(String name, Long parentId, Integer soft) {
PmsProductAttributeCategory productAttributeCategory = new PmsProductAttributeCategory();
productAttributeCategory.setName(name);
productAttributeCategory.setCreateDate(new Date());
productAttributeCategory.setSort(soft);
if(parentId == null || parentId == 0){
productAttributeCategory.setParentId(0L);
productAttributeCategory.setLevel(1);
}else{
PmsProductAttributeCategory model = productAttributeCategoryMapper.selectByPrimaryKey(parentId);
productAttributeCategory.setLevel(model.getLevel()+1);
productAttributeCategory.setParentId(parentId);
}
return productAttributeCategoryMapper.insertSelective(productAttributeCategory);
}
@Override
public int update(Long id, PmsProductAttributeCategory model) {
model.setId(id);
model.setUpdateDate(new Date());
return productAttributeCategoryMapper.updateByPrimaryKeySelective(model);
}
@Override
public int delete(Long id) {
PmsProductAttributeCategoryExample example = new PmsProductAttributeCategoryExample();
example.createCriteria().andIdEqualTo(id);
PmsProductAttributeCategory productAttributeCategory = new PmsProductAttributeCategory();
productAttributeCategory.setDeleteStatus(1);
return productAttributeCategoryMapper.updateByExampleSelective(productAttributeCategory,example);
}
@Override
public PmsProductAttributeCategory getItem(Long id) {
return productAttributeCategoryMapper.selectByPrimaryKey(id);
}
@Override
public List<PmsProductAttributeCategory> getList(Integer pageSize, Integer pageNum, Long parentId) {
PageHelper.startPage(pageNum,pageSize);
PmsProductAttributeCategoryExample example = new PmsProductAttributeCategoryExample();
example.createCriteria().andParentIdEqualTo(parentId).andDeleteStatusEqualTo(0);
example.setOrderByClause("sort");
return productAttributeCategoryMapper.selectByExample(example);
}
/**
* 查询所有分类 如果传入参数则根据对应参数查询
* @return
*/
public List<PmsProductAttributeCategory> getAttributeCategoryList(Integer page, Integer size, Long parentId){
PmsProductAttributeCategoryExample example = new PmsProductAttributeCategoryExample();
PmsProductAttributeCategoryExample.Criteria criteria = example.createCriteria();
if( page !=null && size!=null ){//如果传入分页参数 则调用pageHelper
PageHelper.startPage(page,size);
}
if(parentId != null){
criteria.andParentIdEqualTo(parentId);
}
criteria.andDeleteStatusEqualTo(0);//查询未删除的
//根据sort asc升序
example.setOrderByClause("sort asc");
return productAttributeCategoryMapper.selectByExample(example);
}
@Override
public List<PmsProductAttributeCategoryItem> getListWithAttr() {
return productAttributeCategoryDao.getListWithAttr();
}
/**
* 获取所有子集类目id
*
* @param attributeCategoryId
* @return
*/
@Override
public List<Long> getAtributeCategoryIdList(Long attributeCategoryId) {
if(attributeCategoryId == null || attributeCategoryId == 0){
return null;
}
List<PmsProductAttributeCategory> categories = this.getAtributeCategoryList(attributeCategoryId,null, null);
if(categories.isEmpty()){
return null;
}
List<Long> idList = new ArrayList<>();
idList.add(attributeCategoryId);
PmsProductAttributeCategory category = categories.get(0);
if(category.getLevel() == 3){
return idList;
}
if(category.getLevel() == 2){
categories = this.getAtributeCategoryList(null,category.getId(), null);//找出子集属性类目
if(!categories.isEmpty()){
List<Long> ids = categories.stream().map(PmsProductAttributeCategory::getId).collect(Collectors.toList());
idList.addAll(ids);
}
return idList;
}
if(category.getLevel() == 1){
categories = this.getAtributeCategoryList(null,category.getId(), null);//找出子集属性类目(2极)
if(!categories.isEmpty()){
List<Long> ids = categories.stream().map(PmsProductAttributeCategory::getId).collect(Collectors.toList());
idList.addAll(ids);
categories = this.getAtributeCategoryList(null,null,ids);//找出子集属性类目(3极)
if(!categories.isEmpty()){
ids = categories.stream().map(PmsProductAttributeCategory::getId).collect(Collectors.toList());
idList.addAll(ids);
}
return idList;
}
}
return idList;
}
private List<PmsProductAttributeCategory> getAtributeCategoryList(Long id, Long parentId, List<Long> parentIds) {
PmsProductAttributeCategoryExample pmsProductAttributeCategoryExample = new PmsProductAttributeCategoryExample();
PmsProductAttributeCategoryExample.Criteria criteria = pmsProductAttributeCategoryExample.createCriteria();
criteria.andDeleteStatusEqualTo(0);
if(id != null){
criteria.andIdEqualTo(id);
}
if(parentId != null){
criteria.andParentIdEqualTo(parentId);
}
if(parentIds != null && parentIds.size() > 0){
criteria.andParentIdIn(parentIds);
}
return productAttributeCategoryMapper.selectByExample(pmsProductAttributeCategoryExample);
}
}
package com.macro.mall.service.quanxing.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.dao.quanxing.PmsSupplierAuditProductDao;
import com.macro.mall.mapper.PmsSupplierAuditMapper;
import com.macro.mall.mapper.PmsSupplierAuditProductMapper;
import com.macro.mall.mapper.UmsMemberMapper;
import com.macro.mall.model.PmsSupplierAudit;
import com.macro.mall.model.PmsSupplierAuditExample;
import com.macro.mall.model.UmsMember;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.PmsSupplierAuditDto;
import com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest;
import com.macro.mall.service.member.UmsMemberService;
import com.macro.mall.service.quanxing.IPmsSupplierAuditService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class PmsSupplierAuditServiceImpl implements IPmsSupplierAuditService {
@Resource
private PmsSupplierAuditMapper pmsSupplierAuditMapper;//供应商审核表 代码生成器mapper
@Resource
private PmsSupplierAuditProductMapper pmsSupplierAuditProductMapper;//供应商审核商品表 代码生成器mapper
@Resource
private UmsMemberMapper umsMemberMapper;//会员表 代码生成器mapper
@Autowired
private PasswordEncoder passwordEncoder;//密码相关处理
@Autowired
private UmsMemberService umsMemberService;//会员表业务层
@Resource
private PmsSupplierAuditProductDao pmsSupplierAuditProductDao;
/**
* 审核供应商
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg auditSupplier(PmsSupplierAuditRequest pmsSupplierAuditRequest){
PmsSupplierAudit psa = this.pmsSupplierAuditMapper.selectByPrimaryKey(pmsSupplierAuditRequest.getId());
if(psa == null ){
return new ResultMsg(false,"传入id 不存在对应的审核记录");
}
if(pmsSupplierAuditRequest.getStatus() == null ){
return new ResultMsg(false,"请传入对应的审核状态");
}
PmsSupplierAudit pmsSupplierAudit = new PmsSupplierAuditDto();
pmsSupplierAudit.setId(pmsSupplierAuditRequest.getId());
pmsSupplierAudit.setStatus(pmsSupplierAuditRequest.getStatus());
pmsSupplierAudit.setRemarks(pmsSupplierAuditRequest.getRemarks());
pmsSupplierAudit.setAuditBy(pmsSupplierAuditRequest.getMemberId());
if(pmsSupplierAuditRequest.getStatus() == 1){//审核通过还需将信息写入会员表
//补充会员信息
UmsMember umsMember = new UmsMember();
umsMember.setUsername(this.getUsername());//系统根据时间生成账号
String uuid = UUID.randomUUID().toString().replace("-", ""); //随机生成昵称 转化为String对象 因为UUID本身为32位只是生成时多了“-”,所以将它们去除
if(psa.getName() ==null || "".equals(psa.getName())){
umsMember.setName(uuid.substring(4, 12));
}else{
umsMember.setName(psa.getName());
}
umsMember.setPhone(psa.getPhone());
umsMember.setPassword(psa.getPassword());
umsMember.setStatus(1);//帐号启用状态:0->禁用;1->启用
umsMember.setAccouuntType(1);//账户类型(0管理员1供应商2分销商)
umsMember.setDeleteStatus(0);
umsMember.setBirthday(new Date());
umsMember.setCreateDate(new Date());
umsMember.setUpdateDate(new Date());
umsMember.setCreateTime(new Date());
//插入操作
this.umsMemberMapper.insert(umsMember);
//插入会员id
pmsSupplierAudit.setMemberId(umsMember.getId());
}
//更新审核状态
this.pmsSupplierAuditMapper.updateByPrimaryKeySelective(pmsSupplierAudit);
return new ResultMsg(true,"操作成功");
}
/**
* 生成账号
* @return
*/
@Override
public String getUsername(){
//截取当前系统时间
Date currentTime = new Date();
//改变输出格式(自己想要的格式)
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
System.out.println(formatter.format(currentTime));
return formatter.format(currentTime);
}
/**
* 插入一条供应商审核
* @param pmsSupplierAuditDto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg insertSupplierAudit(PmsSupplierAuditDto pmsSupplierAuditDto){
ResultMsg res = this.checkSupplierAudit(pmsSupplierAuditDto);
if(!res.isFlag()){//如果校验不同过 返回false
return new ResultMsg(false,res.getMsg());
}
//插入供应商审核表
this.pmsSupplierAuditMapper.insertSelective(pmsSupplierAuditDto);
//如果供应商审核商品不为空的话 还继续插入
if(pmsSupplierAuditDto.getPmsSupplierAuditProductList() != null && pmsSupplierAuditDto.getPmsSupplierAuditProductList().size() > 0){
//插入供应商审核商品表
pmsSupplierAuditDto.getPmsSupplierAuditProductList().forEach(pmsSupplierAuditProduct ->{
pmsSupplierAuditProduct.setAuditId(pmsSupplierAuditDto.getId());
this.pmsSupplierAuditProductMapper.insertSelective(pmsSupplierAuditProduct);
});
}
return new ResultMsg(true,"插入成功");
}
/**
* 校验传入数据
* @return
*/
private ResultMsg checkSupplierAudit(PmsSupplierAuditDto pmsSupplierAuditDto){
if(pmsSupplierAuditDto == null ){
return new ResultMsg(false,"传入数据为空");
}
if(pmsSupplierAuditDto.getPhone() == null || "".equals(pmsSupplierAuditDto.getPhone())){
return new ResultMsg(false,"手机号为空");
}else{//查询手机号是否已经存在
UmsMember umsMember = this.umsMemberService.getByPhone(pmsSupplierAuditDto.getPhone());
if(umsMember != null){
return new ResultMsg(false,"输入手机号已存在");
}
}
if(pmsSupplierAuditDto.getPassword() == null || "".equals(pmsSupplierAuditDto.getPassword())){
return new ResultMsg(false,"密码传入为空");
}else{
//加密密码
pmsSupplierAuditDto.setPassword(passwordEncoder.encode(pmsSupplierAuditDto.getPassword()));
}
if(pmsSupplierAuditDto.getBrandName() == null || "".equals(pmsSupplierAuditDto.getBrandName())){
return new ResultMsg(false,"品牌名称为空");
}
if(pmsSupplierAuditDto.getCompanyName() == null || "".equals(pmsSupplierAuditDto.getCompanyName())){
return new ResultMsg(false,"公司名称为空");
}
if(pmsSupplierAuditDto.getBusinessLicense() == null || "".equals(pmsSupplierAuditDto.getBusinessLicense())){
return new ResultMsg(false,"经营许可证为空");
}
if(pmsSupplierAuditDto.getBusiness() == null || "".equals(pmsSupplierAuditDto.getBusiness())){
return new ResultMsg(false,"营业执照为空");
}
return new ResultMsg(true,"校验通过");
}
@Override
public CommonPage<PmsSupplierAuditDto> getPageList(Integer pageNum, Integer pageSize, String name, String phone, Integer status){
PageHelper.startPage(pageNum, pageSize);
PmsSupplierAuditExample example = new PmsSupplierAuditExample();
PmsSupplierAuditExample.Criteria criteria = example.createCriteria();
if(name != null && !"".equals(name)){
criteria.andNameLike("name"+"%");
}
if(phone != null && !"".equals(phone)){
criteria.andPhoneEqualTo(phone);
}
if(status != null){
criteria.andStatusEqualTo(status);
}
//过滤已删除的数据
criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除
List<PmsSupplierAudit> dataList = this.pmsSupplierAuditMapper.selectByExample(example);
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo<PmsSupplierAudit> pageInfo = new PageInfo<>(dataList);
List<PmsSupplierAuditDto> psadList = new ArrayList<>();
dataList.forEach(pmsSupplierAudit->{
PmsSupplierAuditDto dto = new PmsSupplierAuditDto();
//讲属性赋值到另一个对象中去
BeanUtils.copyProperties(pmsSupplierAudit,dto);
//查询供应商的审核时候商品
dto.setPmsSupplierAuditProductList(this.pmsSupplierAuditProductDao.selectListByAuditId(pmsSupplierAudit.getId()));
psadList.add(dto);
});
//因为进行了第二次查询 所以pageHelp得分页总数得到了变化 导致不准确 因此我们需要手动校准一下
CommonPage<PmsSupplierAuditDto> result = new CommonPage<PmsSupplierAuditDto>();
result.setTotalPage(pageInfo.getPages());
result.setPageNum(pageInfo.getPageNum());
result.setPageSize(pageInfo.getPageSize());
result.setTotal(pageInfo.getTotal());
result.setList(psadList);
return result;
}
/**
* 根据id获取一条审核记录
* @param id
* @return
*/
@Override
public PmsSupplierAuditDto getSupplierAuditById(Long id){
PmsSupplierAuditDto pmsSupplierAuditDto = new PmsSupplierAuditDto();
PmsSupplierAudit psa = this.pmsSupplierAuditMapper.selectByPrimaryKey(id);
BeanUtils.copyProperties(psa,pmsSupplierAuditDto);
pmsSupplierAuditDto.setPmsSupplierAuditProductList(this.pmsSupplierAuditProductDao.selectListByAuditId(id));
return pmsSupplierAuditDto;
}
}
...@@ -176,4 +176,6 @@ public interface UmsAdminService { ...@@ -176,4 +176,6 @@ public interface UmsAdminService {
* @return * @return
*/ */
int updateAdmin(Long id, AdminUpdateParam admin); int updateAdmin(Long id, AdminUpdateParam admin);
UmsAdmin getCurrentUmsAdmin();
} }
...@@ -6,6 +6,7 @@ import com.macro.mall.dao.UmsAdminDao; ...@@ -6,6 +6,7 @@ import com.macro.mall.dao.UmsAdminDao;
import com.macro.mall.dao.UmsAdminPermissionRelationDao; import com.macro.mall.dao.UmsAdminPermissionRelationDao;
import com.macro.mall.dao.UmsAdminRoleRelationDao; import com.macro.mall.dao.UmsAdminRoleRelationDao;
import com.macro.mall.domain.AdminUpdateParam; import com.macro.mall.domain.AdminUpdateParam;
import com.macro.mall.domain.MemberDetails;
import com.macro.mall.domain.dto.AdminManageParam; import com.macro.mall.domain.dto.AdminManageParam;
import com.macro.mall.domain.dto.UmsAdminParam; import com.macro.mall.domain.dto.UmsAdminParam;
import com.macro.mall.domain.dto.UmsAdminQueryParam; import com.macro.mall.domain.dto.UmsAdminQueryParam;
...@@ -21,7 +22,9 @@ import lombok.extern.slf4j.Slf4j; ...@@ -21,7 +22,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
...@@ -638,6 +641,17 @@ public class UmsAdminServiceImpl implements UmsAdminService { ...@@ -638,6 +641,17 @@ public class UmsAdminServiceImpl implements UmsAdminService {
return adminMapper.updateByPrimaryKeySelective(umsAdmin); return adminMapper.updateByPrimaryKeySelective(umsAdmin);
} }
@Override
public UmsAdmin getCurrentUmsAdmin() {
SecurityContext ctx = SecurityContextHolder.getContext();
Authentication auth = ctx.getAuthentication();
if (auth != null && auth.getPrincipal() instanceof MemberDetails) {
AdminUserDetails adminUserDetails = (AdminUserDetails)auth.getPrincipal();
return adminUserDetails.getUmsAdmin();
}
return null;
}
public Long getAdminRoleId(Long id){ public Long getAdminRoleId(Long id){
UmsAdminRoleRelationExample example=new UmsAdminRoleRelationExample(); UmsAdminRoleRelationExample example=new UmsAdminRoleRelationExample();
//查询用户角色id //查询用户角色id
...@@ -645,4 +659,6 @@ public class UmsAdminServiceImpl implements UmsAdminService { ...@@ -645,4 +659,6 @@ public class UmsAdminServiceImpl implements UmsAdminService {
List<UmsAdminRoleRelation> umsAdminRoleRelations = adminRoleRelationMapper.selectByExample(example); List<UmsAdminRoleRelation> umsAdminRoleRelations = adminRoleRelationMapper.selectByExample(example);
return umsAdminRoleRelations.get(0).getRoleId(); return umsAdminRoleRelations.get(0).getRoleId();
} }
} }
package com.macro.mall.service.vanke;
import com.macro.mall.model.VankeBackLog;
import java.util.List;
public interface IVankeBackLogService {
/**
* 分页查询日志
* @param pageNum
* @param pageSize
* @return
*/
List<VankeBackLog> getPageList(Integer pageNum, Integer pageSize);
}
package com.macro.mall.service.vanke;
import com.macro.mall.model.VankeDepartment;
import com.macro.mall.model.common.ResultMsg;
import java.util.List;
public interface IVankeDepartmentSerive {
/**.
* 分页查询
* @param pageNum
* @param pageSize
* @return
*/
List<VankeDepartment> getPageList(Integer pageNum, Integer pageSize);
/**
* 插入部门
* @param vankeDepartment
* @return
*/
ResultMsg insertDepartment(VankeDepartment vankeDepartment);
/**
* 根据id 修改对应的参数
* @param vankeDepartment
* @return
*/
ResultMsg updateDepartment(VankeDepartment vankeDepartment);
}
package com.macro.mall.service.vanke.impl;
import com.macro.mall.mapper.VankeDepartmentMapper;
import com.macro.mall.model.VankeBackLog;
import com.macro.mall.service.vanke.IVankeBackLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 后台日志表
*/
@Service
public class VankeBackLogServiceImpl implements IVankeBackLogService {
@Resource
private VankeDepartmentMapper vankeDepartmentMapper;
@Override
public List<VankeBackLog> getPageList(Integer pageNum, Integer pageSize) {
return null;
}
}
package com.macro.mall.service.vanke.impl;
import com.github.pagehelper.PageHelper;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.mapper.VankeDepartmentMapper;
import com.macro.mall.model.UmsAdmin;
import com.macro.mall.model.VankeDepartment;
import com.macro.mall.model.VankeDepartmentExample;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.service.system.UmsAdminService;
import com.macro.mall.service.vanke.IVankeDepartmentSerive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* vanke 部门表业务层
*/
@Service
public class VankeDepartmentSeriveImpl implements IVankeDepartmentSerive {
@Resource
private VankeDepartmentMapper vankeDepartmentMapper;
@Autowired
private UmsAdminService umsAdminService;
@Override
public List<VankeDepartment> getPageList(Integer pageNum, Integer pageSize){
PageHelper.startPage(pageNum, pageSize);
VankeDepartmentExample example = new VankeDepartmentExample();
VankeDepartmentExample.Criteria criteria = example.createCriteria();
criteria.andDeleteStatusEqualTo(1);//'1未删除 0已删除'
return this.vankeDepartmentMapper.selectByExample(example);
}
@Override
public ResultMsg insertDepartment(VankeDepartment vankeDepartment) {
VankeDepartment vd = new VankeDepartment();
//插入部门
if(vankeDepartment.getName() == null && "".equals(vankeDepartment.getName())){
return new ResultMsg(false,"请输入部门名称");
}
UmsAdmin admin = umsAdminService.getCurrentUmsAdmin();
vd.setName(vankeDepartment.getName());
vd.setStatus(vankeDepartment.getStatus());
vd.setCreateBy(admin.getId());
vd.setUpdateBy(admin.getId());
this.vankeDepartmentMapper.insertSelective(vd);
return new ResultMsg(true,"操作成功");
}
/**
* 根据id 修改对应的参数
* @param vankeDepartment
* @return
*/
@Override
public ResultMsg updateDepartment(VankeDepartment vankeDepartment){
if(vankeDepartment.getId() == null){
return new ResultMsg(false,"传入id为空");
}
this.vankeDepartmentMapper.updateByPrimaryKeySelective(vankeDepartment);
return new ResultMsg(true,"操作成功");
}
}
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