Commit 6910b82f authored by machengbo's avatar machengbo

Merge branch 'dm_dev' of http://gitlab.ioubuy.cn/yaobenzhang/dm_project into dm_dev

parents b618ecd7 8e1c12c5
...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.controller.customer; ...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.controller.customer;
import com.baomidou.mybatisplus.extension.api.R; import com.baomidou.mybatisplus.extension.api.R;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.base.CurrentUser;
import com.jz.common.constant.RedisMessageConstant; import com.jz.common.constant.RedisMessageConstant;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.constant.ResultMsg; import com.jz.common.constant.ResultMsg;
import com.jz.common.utils.SessionUtils;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode; import com.jz.common.utils.StatusCode;
...@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map; import java.util.Map;
/** /**
...@@ -72,14 +75,38 @@ public class MallCustomerController extends BaseController { ...@@ -72,14 +75,38 @@ public class MallCustomerController extends BaseController {
return new Result(false, "注册失败!", StatusCode.ERROR); return new Result(false, "注册失败!", StatusCode.ERROR);
} }
/**
* 获取用户信息
* @return
*/
@GetMapping("/getLoginUserName")
@ApiOperation(value = "注册用户", notes = "添加用户")
public Result getLoginUserName (HttpServletRequest request) {
// 从session中获取id
try {
MallCustomer mallCustomer = (MallCustomer) SessionUtils.getUserCurrent(request,"mallCustomer");
Long customerId = 1L;
// Long customerId = mallCustomer.getCustomerId();
MallCustomer user = mallCustomerService.selectByUser(customerId);
return new Result(true, "获取用户信息成功!", StatusCode.OK, user);
}catch (Exception e) {
e.printStackTrace();
return new Result(false, "获取用户信息失败");
}
}
@PostMapping(value = "/updatePassword") @PostMapping(value = "/updatePassword")
public Result updatePassword(String username, String password) throws Exception { public Result updatePassword(String oldPassword, String newPassword,HttpServletRequest request) throws Exception {
if (username != null && password != null) { // 获取用户信息
mallCustomerService.updatePassword(username, password); MallCustomer mallCustomer = (MallCustomer) getLoginUserName(request).getData();
return new Result(true, "密码修改成功!"); // 如果密码一致
if (mallCustomer.getPassword().equals(oldPassword)) {
// 修改密码
Long customerId = mallCustomer.getCustomerId();
mallCustomerService.updatePassword(customerId, newPassword);
return new Result(true, "密码修改成功");
} }
return new Result(false, "密码修改失败!"); return new Result(false, "密码修改失败");
} }
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* api商品(TDataGoodsApi)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@RestController
@RequestMapping("dataGoodsApi")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsApiService tDataGoodsApiService;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods;
import com.jz.common.base.BaseController;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
import com.jz.dm.mall.moduls.service.DataGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* 数据商品(dataGoods)表控制层
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@RestController
@RequestMapping("dataGoods")
public class DataGoodsController extends BaseController {
/**
* 服务对象
*/
@Autowired
private DataGoodsService dataGoodsService;
/**列表查询数据商品
* @param DataGoodsRequest
* @return
*/
@PostMapping(value = "/findList")
public PageInfoResponse<DataGoodsDto> findList(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
PageInfoResponse<DataGoodsDto> pageInfo = new PageInfoResponse<DataGoodsDto>();
try {
pageInfo = dataGoodsService.findList(DataGoodsRequest, httpRequest);
} catch (Exception e) {
pageInfo.setMessage("查询失败");
pageInfo.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return pageInfo;
}
/**主键查询数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/view")
public BaseBeanResponse<DataGoodsDto> view(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<DataGoodsDto>();
try {
baseBeanResponse = dataGoodsService.findById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("请求失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**删除数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/delete")
public BaseResponse delete(@RequestBody DataGoodsRequest DataGoodsRequest, HttpServletRequest httpRequest){
BaseResponse baseResponse = new BaseResponse();
try {
baseResponse = dataGoodsService.deleteById(DataGoodsRequest, httpRequest);
} catch (Exception e) {
baseResponse.setMessage("删除失败");
baseResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseResponse;
}
/**新增数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/add")
public BaseBeanResponse<DataGoods> add(@RequestBody DataGoods dataGoods, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<DataGoods>();
try {
baseBeanResponse = dataGoodsService.add(dataGoods, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("新增失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
/**修改数据商品
* @param DataGoodsRequest
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/edit")
public BaseBeanResponse<DataGoods> edit(@RequestBody DataGoods dataGoods, HttpServletRequest httpRequest){
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<DataGoods>();
try {
baseBeanResponse = dataGoodsService.edit(dataGoods, httpRequest);
} catch (Exception e) {
baseBeanResponse.setMessage("修改失败");
baseBeanResponse.setCode(Constants.FAILURE_CODE);
e.printStackTrace();
}
return baseBeanResponse;
}
// @PostMapping(value = "/search")
// @ApiOperation(value = "条件查询商品列表")
// public Result<List<DataGoodsRequest>> findList(@RequestBody(required = false) DataGoodsRequest dataGoodsRequest, HttpServletRequest request) {
// dataGoodsService.findList(dataGoodsRequest, request);
// }
}
\ No newline at end of file
package com.jz.dm.mall.moduls.controller.goods.bean.dto;
import com.jz.common.entity.DataGoods;
public class DataGoodsDto extends DataGoods {
}
package com.jz.dm.mall.moduls.controller.goods.bean.request;
import com.jz.common.bean.BasePageBean;
import java.math.BigDecimal;
import java.util.Date;
/**数据商品参数请求封装
* @author ybz
*
*/
public class DataGoodsRequest extends BasePageBean {
/**
* 数据商品id
*/
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
private Long categoryId;
/**
* 数据商户id
*/
private Long userId;
/**
* 数据商品名称
*/
private String dataName;
/**
* 数据类型:01api,02数据包
*/
private String dataType;
/**
* 数据商品标签
*/
private String dataLabel;
/**
* 数据商品图片
*/
private String dataPicture;
/**
* 数据商品价格
*/
private BigDecimal dataPrice;
/**
* 优惠价格
*/
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
private String priceType;
/**
* 商品规格
*/
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
private String cleanRule;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 审核人
*/
private String auditPerson;
/**
* 审核时间起
*/
private Date auditTimeStart;
/**
* 审核时间止
*/
private Date auditTimeEnd;
/**
* 创建时间起
*/
private Date creTimeStart;
/**
* 创建时间止
*/
private Date creTimeEnd;
/**
* 创建人
*/
private String crePerson;
/**
* 更新时间起
*/
private Date uptTimeStart;
/**
* 更新时间止
*/
private Date uptTimeEnd;
/**
* 更新人
*/
private String uptPerson;
/**
* 删除标识
*/
private String delFlag;
/**
* 年(元)
*/
private BigDecimal yearType;
/**
* 季(元)
*/
private BigDecimal seasonType;
/**
* 月(元)
*/
private BigDecimal monthType;
/**
* 次(元)
*/
private BigDecimal secondType;
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public BigDecimal getDataPrice() {
return dataPrice;
}
public void setDataPrice(BigDecimal dataPrice) {
this.dataPrice = dataPrice;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getGoodsStandards() {
return goodsStandards;
}
public void setGoodsStandards(String goodsStandards) {
this.goodsStandards = goodsStandards;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCleanRule() {
return cleanRule;
}
public void setCleanRule(String cleanRule) {
this.cleanRule = cleanRule;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTimeStart() {
return auditTimeStart;
}
public void setAuditTimeStart(Date auditTimeStart) {
this.auditTimeStart = auditTimeStart;
}
public Date getAuditTimeEnd() {
return auditTimeEnd;
}
public void setAuditTimeEnd(Date auditTimeEnd) {
this.auditTimeEnd = auditTimeEnd;
}
public Date getCreTimeStart() {
return creTimeStart;
}
public void setCreTimeStart(Date creTimeStart) {
this.creTimeStart = creTimeStart;
}
public Date getCreTimeEnd() {
return creTimeEnd;
}
public void setCreTimeEnd(Date creTimeEnd) {
this.creTimeEnd = creTimeEnd;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTimeStart() {
return uptTimeStart;
}
public void setUptTimeStart(Date uptTimeStart) {
this.uptTimeStart = uptTimeStart;
}
public Date getUptTimeEnd() {
return uptTimeEnd;
}
public void setUptTimeEnd(Date uptTimeEnd) {
this.uptTimeEnd = uptTimeEnd;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public BigDecimal getYearType() {
return yearType;
}
public void setYearType(BigDecimal yearType) {
this.yearType = yearType;
}
public BigDecimal getSeasonType() {
return seasonType;
}
public void setSeasonType(BigDecimal seasonType) {
this.seasonType = seasonType;
}
public BigDecimal getMonthType() {
return monthType;
}
public void setMonthType(BigDecimal monthType) {
this.monthType = monthType;
}
public BigDecimal getSecondType() {
return secondType;
}
public void setSecondType(BigDecimal secondType) {
this.secondType = secondType;
}
}
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 数据商品(TDataGoods)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@TableName("t_data_goods")
@ApiModel
public class DataGoods implements Serializable {
private static final long serialVersionUID = 938517475031285541L;
/**
* 数据商品id
*/
private Long dataGoodsId;
/**
* 商品分类id(行业)
*/
private Long categoryId;
/**
* 数据商户id
*/
private Long userId;
/**
* 数据商品名称
*/
private String dataName;
/**
* 数据类型:01api,02数据包
*/
private String dataType;
/**
* 数据商品标签
*/
private String dataLabel;
/**
* 数据商品图片
*/
private String dataPicture;
/**
* 数据商品价格
*/
private BigDecimal dataPrice;
/**
* 优惠价格
*/
private BigDecimal discountPrice;
/**
* 价格类型:01免费,02收费
*/
private String priceType;
/**
* 商品规格
*/
private String goodsStandards;
/**
* 数据状态:01预售,02在售中,03下架,04上架
*/
private String dataStatus;
/**
* 审核状态:01待审核,02已审核,03未通过
*/
private String auditStatus;
/**
* 清洗规则(脱敏校验)
*/
private String cleanRule;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 审核人
*/
private String auditPerson;
/**
* 审核时间
*/
private Date auditTime;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 更新时间
*/
private Date uptTime;
/**
* 更新人
*/
private String uptPerson;
/**
* 删除标识
*/
private String delFlag;
/**
* 年(元)
*/
private BigDecimal yearType;
/**
* 季(元)
*/
private BigDecimal seasonType;
/**
* 月(元)
*/
private BigDecimal monthType;
/**
* 次(元)
*/
private BigDecimal secondType;
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public Long getCategoryId() {
return categoryId;
}
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public String getDataLabel() {
return dataLabel;
}
public void setDataLabel(String dataLabel) {
this.dataLabel = dataLabel;
}
public String getDataPicture() {
return dataPicture;
}
public void setDataPicture(String dataPicture) {
this.dataPicture = dataPicture;
}
public BigDecimal getDataPrice() {
return dataPrice;
}
public void setDataPrice(BigDecimal dataPrice) {
this.dataPrice = dataPrice;
}
public BigDecimal getDiscountPrice() {
return discountPrice;
}
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public String getPriceType() {
return priceType;
}
public void setPriceType(String priceType) {
this.priceType = priceType;
}
public String getGoodsStandards() {
return goodsStandards;
}
public void setGoodsStandards(String goodsStandards) {
this.goodsStandards = goodsStandards;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getCleanRule() {
return cleanRule;
}
public void setCleanRule(String cleanRule) {
this.cleanRule = cleanRule;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
public String getAuditPerson() {
return auditPerson;
}
public void setAuditPerson(String auditPerson) {
this.auditPerson = auditPerson;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public BigDecimal getYearType() {
return yearType;
}
public void setYearType(BigDecimal yearType) {
this.yearType = yearType;
}
public BigDecimal getSeasonType() {
return seasonType;
}
public void setSeasonType(BigDecimal seasonType) {
this.seasonType = seasonType;
}
public BigDecimal getMonthType() {
return monthType;
}
public void setMonthType(BigDecimal monthType) {
this.monthType = monthType;
}
public BigDecimal getSecondType() {
return secondType;
}
public void setSecondType(BigDecimal secondType) {
this.secondType = secondType;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
import java.util.Date;
/**
* api商品(DataGoodsApi)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@TableName("t_data_goods_api")
@ApiModel
public class DataGoodsApi implements Serializable {
private static final long serialVersionUID = -14346819849726413L;
/**
* api商品id
*/
private Long goodsApi;
/**
* 数据id
*/
private Long dataGoodsId;
/**
* api服务名称
*/
private String apiName;
/**
* 请求类型(方式)
*/
private String requestType;
/**
* api接口地址
*/
private String apiUrl;
/**
* api接口方法
*/
private String apiMethod;
/**
* api请求协议:http,https
*/
private String apiProtocl;
/**
* api返回数据样例
*/
private String returnDataExample;
/**
* api请求样例
*/
private String requestExample;
/**
* 返回类型
*/
private String returnType;
/**
* apikey
*/
private String apiKey;
/**
* 创建时间
*/
private Date creTime;
/**
* 创建人
*/
private String crePerson;
/**
* 更新人
*/
private String uptPerson;
/**
* 更新时间
*/
private Date uptTime;
/**
* 删除标识
*/
private String delFlag;
public Long getGoodsApi() {
return goodsApi;
}
public void setGoodsApi(Long goodsApi) {
this.goodsApi = goodsApi;
}
public Long getDataGoodsId() {
return dataGoodsId;
}
public void setDataGoodsId(Long dataGoodsId) {
this.dataGoodsId = dataGoodsId;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
public String getRequestType() {
return requestType;
}
public void setRequestType(String requestType) {
this.requestType = requestType;
}
public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
public String getApiMethod() {
return apiMethod;
}
public void setApiMethod(String apiMethod) {
this.apiMethod = apiMethod;
}
public String getApiProtocl() {
return apiProtocl;
}
public void setApiProtocl(String apiProtocl) {
this.apiProtocl = apiProtocl;
}
public String getReturnDataExample() {
return returnDataExample;
}
public void setReturnDataExample(String returnDataExample) {
this.returnDataExample = returnDataExample;
}
public String getRequestExample() {
return requestExample;
}
public void setRequestExample(String requestExample) {
this.requestExample = requestExample;
}
public String getReturnType() {
return returnType;
}
public void setReturnType(String returnType) {
this.returnType = returnType;
}
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public Date getCreTime() {
return creTime;
}
public void setCreTime(Date creTime) {
this.creTime = creTime;
}
public String getCrePerson() {
return crePerson;
}
public void setCrePerson(String crePerson) {
this.crePerson = crePerson;
}
public String getUptPerson() {
return uptPerson;
}
public void setUptPerson(String uptPerson) {
this.uptPerson = uptPerson;
}
public Date getUptTime() {
return uptTime;
}
public void setUptTime(Date uptTime) {
this.uptTime = uptTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper;
import com.jz.common.entity.DataGoodsApi;
/**
* api商品(TDataGoodsApi)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper;
import java.util.List;
import java.util.Map;
import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.entity.DataGoods;
/**
* 数据商品(DataGoods)表数据库访问层
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
public interface DataGoodsDao extends BaseMapper<DataGoods> {
/**选择性增加数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int insertSelective(DataGoods dataGoods)throws Exception;
/**主键修改数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int updateByPrimaryKey(DataGoods dataGoods)throws Exception;
/**选择性修改数据商品
* @param dataGoods
* @return
* @throws Exception
*/
public int updateByPrimaryKeySelective(DataGoods dataGoods)throws Exception;
/**主键查询数据商品
* @param dataGoodsId
* @return
* @throws Exception
*/
public DataGoods selectByPrimaryKey(Long dataGoodsId)throws Exception;
/**主键删除数据商品
* @param dataGoodsId
* @return
* @throws Exception
*/
public int deleteByPrimaryKey(Long dataGoodsId)throws Exception;
/**条件查询数据商品
* @param param
* @return
* @throws Exception
*/
public List<DataGoodsDto> findList(Map<String, Object> param)throws Exception;
/**主键查询数据商品
* @param DataGoodsId
* @return
* @throws Exception
*/
public DataGoodsDto findById(Long dataGoodsId)throws Exception;
/**批量新增数据商品
* @param DataGoodses
* @throws Exception
*/
public void insertBatch(List<DataGoods> dataGoodses)throws Exception;
}
\ No newline at end of file
...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.mapper; ...@@ -2,9 +2,11 @@ package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.entity.MallCustomer; import com.jz.dm.mall.moduls.entity.MallCustomer;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.Map;
/** /**
* 商城用户(TMallCustomer)表数据库访问层 * 商城用户(TMallCustomer)表数据库访问层
...@@ -52,6 +54,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> { ...@@ -52,6 +54,7 @@ public interface MallCustomerDao extends BaseMapper<MallCustomer> {
MallCustomer findById(@Param("customerId") Long customerId); MallCustomer findById(@Param("customerId") Long customerId);
@Update(" update t_mall_customer set password = #{password} where customer_account = #{customer_account}") void updatePassword(Map map);
void updatePassword(@Param("customer_account") String username, @Param("password") String password);
MallCustomer selectByCustomerId(Long customerId);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
/**
* api商品(TDataGoodsApi)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
public interface DataGoodsApiService {
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
import javax.servlet.http.HttpServletRequest;
/**
* 数据商品(DataGoods)表服务接口
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
public interface DataGoodsService {
/**条件查询所有数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
/**新增数据商品
* @param DataGoods
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoods> add(DataGoods dataGoods, HttpServletRequest httpRequest)throws Exception;
/**主键查询数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoodsDto> findById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
/**修改数据商品
* @param DataGoods
* @param httpRequest
* @return
* @throws Exception
*/
public BaseBeanResponse<DataGoods> edit(DataGoods dataGoods, HttpServletRequest httpRequest)throws Exception;
/**主键删除数据商品
* @param DataGoodsRequest
* @param httpRequest
* @return
* @throws Exception
*/
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)throws Exception;
}
\ No newline at end of file
...@@ -43,8 +43,15 @@ public interface MallCustomerService { ...@@ -43,8 +43,15 @@ public interface MallCustomerService {
/** /**
* 修改密码 * 修改密码
* @param username * @param customerId
* @param password * @param password
*/ */
void updatePassword(@Param("customer_account") String username, @Param("password") String password); void updatePassword(Long customerId, String password);
/**
* 通过id查找用户信息
* @param customerId
* @return
*/
MallCustomer selectByUser(Long customerId);
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.mapper.DataGoodsApiDao;
import com.jz.dm.mall.moduls.service.DataGoodsApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* api商品(TDataGoodsApi)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:31
*/
@Service("dataGoodsApiService")
public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
private DataGoodsApiDao tDataGoodsApiDao;
}
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jz.common.bean.BaseBeanResponse;
import com.jz.common.bean.BaseResponse;
import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants;
import com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsDto;
import com.jz.dm.mall.moduls.controller.goods.bean.request.DataGoodsRequest;
import com.jz.dm.mall.moduls.entity.DataGoods;
import com.jz.dm.mall.moduls.mapper.DataGoodsDao;
import com.jz.dm.mall.moduls.service.DataGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 数据商品(DataGoods)表服务实现类
*
* @author Bellamy
* @since 2020-12-01 10:41:30
*/
@Service("dataGoodsService")
public class DataGoodsServiceImpl implements DataGoodsService {
@Autowired
private DataGoodsDao dataGoodsDao;
@Override
public PageInfoResponse<DataGoodsDto> findList(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
PageInfoResponse<DataGoodsDto> pageInfoResponse = new PageInfoResponse<>();
Map<String, Object> param = new HashMap<>();
//数据商品id
if (dataGoodsRequest.getDataGoodsId() != null) {
param.put("dataGoodsId", dataGoodsRequest.getDataGoodsId());
}
//商品分类id(行业)
if (dataGoodsRequest.getCategoryId() != null) {
param.put("categoryId", dataGoodsRequest.getCategoryId());
}
//数据商户id
if (dataGoodsRequest.getUserId() != null) {
param.put("userId", dataGoodsRequest.getUserId());
}
//数据商品名称
if (!StringUtils.isEmpty(dataGoodsRequest.getDataName())) {
param.put("dataName", dataGoodsRequest.getDataName());
}
//数据类型:01api,02数据包
if (!StringUtils.isEmpty(dataGoodsRequest.getDataType())) {
param.put("dataType", dataGoodsRequest.getDataType());
}
//数据商品标签
if (!StringUtils.isEmpty(dataGoodsRequest.getDataLabel())) {
param.put("dataLabel", dataGoodsRequest.getDataLabel());
}
//数据商品图片
if (!StringUtils.isEmpty(dataGoodsRequest.getDataPicture())) {
param.put("dataPicture", dataGoodsRequest.getDataPicture());
}
//数据商品价格
if (dataGoodsRequest.getDataPrice() != null) {
param.put("dataPrice", dataGoodsRequest.getDataPrice());
}
//优惠价格
if (dataGoodsRequest.getDiscountPrice() != null) {
param.put("discountPrice", dataGoodsRequest.getDiscountPrice());
}
//价格类型:01免费,02收费
if (!StringUtils.isEmpty(dataGoodsRequest.getPriceType())) {
param.put("priceType", dataGoodsRequest.getPriceType());
}
//商品规格
if (!StringUtils.isEmpty(dataGoodsRequest.getGoodsStandards())) {
param.put("goodsStandards", dataGoodsRequest.getGoodsStandards());
}
//数据状态:01预售,02在售中,03下架,04上架
if (!StringUtils.isEmpty(dataGoodsRequest.getDataStatus())) {
param.put("dataStatus", dataGoodsRequest.getDataStatus());
}
//审核状态:01待审核,02已审核,03未通过
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditStatus())) {
param.put("auditStatus", dataGoodsRequest.getAuditStatus());
}
//清洗规则(脱敏校验)
if (!StringUtils.isEmpty(dataGoodsRequest.getCleanRule())) {
param.put("cleanRule", dataGoodsRequest.getCleanRule());
}
//驳回原因
if (!StringUtils.isEmpty(dataGoodsRequest.getRejectReason())) {
param.put("rejectReason", dataGoodsRequest.getRejectReason());
}
//审核人
if (!StringUtils.isEmpty(dataGoodsRequest.getAuditPerson())) {
param.put("auditPerson", dataGoodsRequest.getAuditPerson());
}
//审核时间起
if (dataGoodsRequest.getAuditTimeStart() != null) {
param.put("auditTimeStart", dataGoodsRequest.getAuditTimeStart());
}
//审核时间止
if (dataGoodsRequest.getAuditTimeEnd() != null) {
param.put("auditTimeEnd", dataGoodsRequest.getAuditTimeEnd());
}
//创建时间起
if (dataGoodsRequest.getCreTimeStart() != null) {
param.put("creTimeStart", dataGoodsRequest.getCreTimeStart());
}
//创建时间止
if (dataGoodsRequest.getCreTimeEnd() != null) {
param.put("creTimeEnd", dataGoodsRequest.getCreTimeEnd());
}
//创建人
if (!StringUtils.isEmpty(dataGoodsRequest.getCrePerson())) {
param.put("crePerson", dataGoodsRequest.getCrePerson());
}
//更新时间起
if (dataGoodsRequest.getUptTimeStart() != null) {
param.put("uptTimeStart", dataGoodsRequest.getUptTimeStart());
}
//更新时间止
if (dataGoodsRequest.getUptTimeEnd() != null) {
param.put("uptTimeEnd", dataGoodsRequest.getUptTimeEnd());
}
//更新人
if (!StringUtils.isEmpty(dataGoodsRequest.getUptPerson())) {
param.put("uptPerson", dataGoodsRequest.getUptPerson());
}
//删除标识
if (!StringUtils.isEmpty(dataGoodsRequest.getDelFlag())) {
param.put("delFlag", dataGoodsRequest.getDelFlag());
}
//年(元)
if (dataGoodsRequest.getYearType() != null) {
param.put("yearType", dataGoodsRequest.getYearType());
}
//季(元)
if (dataGoodsRequest.getSeasonType() != null) {
param.put("seasonType", dataGoodsRequest.getSeasonType());
}
//月(元)
if (dataGoodsRequest.getMonthType() != null) {
param.put("monthType", dataGoodsRequest.getMonthType());
}
//次(元)
if (dataGoodsRequest.getSecondType() != null) {
param.put("secondType", dataGoodsRequest.getSecondType());
}
PageHelper.startPage(dataGoodsRequest.getPageNum(), dataGoodsRequest.getPageSize());
List<DataGoodsDto> list = dataGoodsDao.findList(param);
PageInfo<DataGoodsDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(Constants.SUCCESS_CODE);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#add(com.ycxc.vmts.entity.DataGoods, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseBeanResponse<DataGoods> add(DataGoods dataGoods, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<>();
/*$*seDataGoodsIdCodeReplace*$*/
//创建人
//dataGoods.setCreateUser(getHttpRequestUserId(httpRequest));
//创建时间
dataGoods.setCreTime(new Date());
dataGoodsDao.insertSelective(dataGoods);
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("新增成功");
baseBeanResponse.setData(dataGoods);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#edit(com.ycxc.vmts.entity.DataGoods, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseBeanResponse<DataGoods> edit(DataGoods dataGoods, HttpServletRequest httpRequest) throws Exception {
BaseBeanResponse<DataGoods> baseBeanResponse = new BaseBeanResponse<>();
//修改人
//dataGoods.setUpdateUser(getHttpRequestUserId(httpRequest));
//修改时间
dataGoods.setUptTime(new Date());
dataGoodsDao.updateByPrimaryKeySelective(dataGoods);
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("修改成功");
baseBeanResponse.setData(dataGoods);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#findById(com.ycxc.vmts.controller.bean.DataGoodsRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
public BaseBeanResponse<DataGoodsDto> findById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
BaseBeanResponse<DataGoodsDto> baseBeanResponse = new BaseBeanResponse<>();
DataGoodsDto DataGoodsDto = dataGoodsDao.findById(dataGoodsRequest.getDataGoodsId());
baseBeanResponse.setCode(Constants.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功");
baseBeanResponse.setData(DataGoodsDto);
return baseBeanResponse;
}
/* (non-Javadoc)
* @see com.ycxc.vmts.service.DataGoodsService#deleteById(com.ycxc.vmts.controller.bean.DataGoodsRequest, javax.servlet.http.HttpServletRequest)
*/
@Override
@Transactional(rollbackFor=Exception.class)
public BaseResponse deleteById(DataGoodsRequest dataGoodsRequest, HttpServletRequest httpRequest)
throws Exception {
BaseResponse baseResponse = new BaseResponse();
dataGoodsDao.deleteByPrimaryKey(dataGoodsRequest.getDataGoodsId());
baseResponse.setCode(Constants.SUCCESS_CODE);
baseResponse.setMessage("删除成功");
return baseResponse;
}
}
\ No newline at end of file
...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service; ...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -133,16 +134,31 @@ public class MallCustomerServiceImpl implements MallCustomerService { ...@@ -133,16 +134,31 @@ public class MallCustomerServiceImpl implements MallCustomerService {
/** /**
* 修改密码 * 修改密码
* *
* @param username * @param customerId
* @param password * @param password
*/ */
@Override @Override
public void updatePassword(String username, String password) { public void updatePassword(Long customerId, String password) {
MallCustomer mallCustomer = tMallCustomerDao.selectByPhone(username); MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
if (mallCustomer != null) { if (mallCustomer != null) {
tMallCustomerDao.updatePassword(username, password); Map map = new HashMap();
map.put("password", password);
map.put("customerId", customerId);
tMallCustomerDao.updatePassword(map);
} }
} }
/**
* 通过id查找用户信息
*
* @param customerId
* @return
*/
@Override
public MallCustomer selectByUser(Long customerId) {
MallCustomer mallCustomer = tMallCustomerDao.selectByCustomerId(customerId);
return mallCustomer;
}
} }
\ 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.jz.dm.mall.moduls.mapper.DataGoodsApiDao">
<resultMap type="com.jz.dm.mall.moduls.entity.DataGoodsApi" id="TDataGoodsApiMap">
<result property="goodsApi" column="goods_api" jdbcType="INTEGER"/>
<result property="dataGoodsId" column="data_goods_id" jdbcType="INTEGER"/>
<result property="apiName" column="api_name" jdbcType="VARCHAR"/>
<result property="requestType" column="request_type" jdbcType="VARCHAR"/>
<result property="apiUrl" column="api_url" jdbcType="VARCHAR"/>
<result property="apiMethod" column="api_method" jdbcType="VARCHAR"/>
<result property="apiProtocl" column="api_protocl" jdbcType="VARCHAR"/>
<result property="returnDataExample" column="return_data_example" jdbcType="VARCHAR"/>
<result property="requestExample" column="request_example" jdbcType="VARCHAR"/>
<result property="returnType" column="return_type" jdbcType="VARCHAR"/>
<result property="apiKey" column="api_key" jdbcType="VARCHAR"/>
<result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
</resultMap>
</mapper>
\ No newline at end of file
This diff is collapsed.
...@@ -194,4 +194,15 @@ ...@@ -194,4 +194,15 @@
WHERE customer_id =#{customerId} WHERE customer_id =#{customerId}
AND del_flag ='N'" AND del_flag ='N'"
</select> </select>
<select id="selectByCustomerId" resultMap="TMallCustomerMap">
select
customer_id, department_id, password, customer_account, customer_name, customer_phone, customer_email, customer_address, customer_point, register_time, customer_level, identity_card, cre_time, upt_time, del_flag
from t_mall_customer
where customer_id = #{customerId};
</select>
<update id="updatePassword" parameterType="map">
update t_mall_customer set password =#{password} where customer_id = #{customerId};
</update>
</mapper> </mapper>
\ No newline at end of file
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