Merge remote-tracking branch 'origin/dev'

This commit is contained in:
牛叉闪闪
2024-08-05 10:20:33 +08:00
39 changed files with 689 additions and 133 deletions

View File

@@ -19,6 +19,7 @@
</properties>
<dependencies>
<!-- 代码生成模块 -->
<dependency>
<groupId>cn.ysk.cashier</groupId>
@@ -39,6 +40,11 @@
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.1</version>
</dependency>
<!-- Spring boot websocket -->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -150,6 +150,7 @@ public class AuthorizationController {
put("user", jwtUserDto);
if (byAccount != null) {
put("shopId", byAccount.getId());
put("loginType", org.apache.commons.lang3.StringUtils.isNotBlank(authUser.getLoginType())?authUser.getLoginType():"merchant");
put("shopName", byAccount.getShopName());
put("logo", byAccount.getLogo());
}

View File

@@ -59,8 +59,7 @@ public class TbConsSuppFlow implements Serializable {
@ApiModelProperty(value = "productId")
private Integer productId;
@Column(name = "`supplier_id`",nullable = false)
@NotNull
@Column(name = "`supplier_id`")
@ApiModelProperty(value = "supplierId")
private Integer supplierId;

View File

@@ -71,7 +71,7 @@ public class TbConsInfoController {
}
@PostMapping(value = "stockInOut")
@Log("耗材出入库")
@Log("耗材::#resources.type")
@ApiOperation("耗材出入库")
public ResponseEntity<Object> stockInOut(@Validated @RequestBody SuppFlow resources) throws Exception {

View File

@@ -2,6 +2,8 @@ package cn.ysk.cashier.cons.service.impl;
import cn.ysk.cashier.cons.domain.TbConCheck;
import cn.ysk.cashier.cons.domain.TbConsInfo;
import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
import cn.ysk.cashier.utils.FileUtil;
import cn.ysk.cashier.utils.PageUtil;
@@ -39,6 +41,8 @@ public class TbConCheckServiceImpl implements TbConCheckService {
private final TbConsInfoRepository tbConsInfoRepository;
public final TbConsInfoFlowRepository tbConsInfoFlowRepository;
@Override
public Map<String,Object> queryAll(TbConCheckQueryCriteria criteria, Pageable pageable){
Page<TbConCheck> page = tbConCheckRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
@@ -65,20 +69,46 @@ public class TbConCheckServiceImpl implements TbConCheckService {
if(Objects.isNull(consInfo)){
throw new Exception("耗材信息不存在");
}
TbConsInfoFlow flow=new TbConsInfoFlow();
BigDecimal stonum=consInfo.getStockNumber().subtract(consInfo.getStockConsume());
if(consInfo.getStockNumber().compareTo(resources.getStockNumber())>=0){
flow.setBizCode("checkStockOut");
flow.setBizName("盘点出库");
flow.setBizType("-");
}else {
flow.setBizCode("checkStockIn");
flow.setBizName("盘点入库");
flow.setBizType("+");
}
consInfo.setStockConsume(consInfo.getStockConsume().add(resources.getLpNum().negate()));
consInfo.setStockConsume(BigDecimal.ZERO);
consInfo.setStockNumber(resources.getStockNumber());
consInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
tbConsInfoRepository.save(consInfo);
flow.setConsId(consInfo.getId());
flow.setShopId(consInfo.getShopId());
flow.setConName(consInfo.getConName());
flow.setAmount(consInfo.getStockNumber());
flow.setBalance(consInfo.getStockNumber());
flow.setCreateTime(new Timestamp(System.currentTimeMillis()));
tbConsInfoFlowRepository.save(flow);
TbConCheck conCheck=new TbConCheck();
conCheck.setConInfoId(consInfo.getId());
conCheck.setConName(consInfo.getConName());
conCheck.setPrice(consInfo.getPrice());
conCheck.setAcStockNumber(consInfo.getStockNumber().subtract(consInfo.getStockConsume()));
conCheck.setStockNumber(stonum);
conCheck.setAcStockNumber(resources.getStockNumber());
conCheck.setStockNumber(resources.getStockNumber());
conCheck.setLpNum(resources.getLpNum());
conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum()));
conCheck.setCreateTime(new Timestamp(System.currentTimeMillis()));

View File

@@ -184,13 +184,17 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
if (Objects.isNull(tbShopInfo)) {
throw new Exception("店铺信息不存在");
}
TbShopPurveyor purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
if (Objects.isNull(purveyor)) {
throw new Exception("不存在的供应商");
TbShopPurveyor purveyor=null;
TbProductStockOperate stockOperate = new TbProductStockOperate();
if(Objects.nonNull(resources.getSupplierId())){
purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
if (Objects.nonNull(purveyor)) {
stockOperate.setPurveyorId(resources.getSupplierId().toString());
stockOperate.setPurveyorName(purveyor.getPurveyorName());
}
}
TbProductStockOperate stockOperate = new TbProductStockOperate();
stockOperate.setShopId(tbShopInfo.getId().toString());
stockOperate.setStockSnap("");
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");
@@ -204,8 +208,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
stockOperate.setCreatedAt(System.currentTimeMillis());
stockOperate.setUpdatedAt(System.currentTimeMillis());
stockOperate.setStatus("normal");
stockOperate.setPurveyorId(resources.getSupplierId().toString());
stockOperate.setPurveyorName(purveyor.getPurveyorName());
JSONArray array=new JSONArray();
@@ -224,15 +227,15 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
TbShopPurveyorTransact purveyorTransact = new TbShopPurveyorTransact();
purveyorTransact.setShopId(tbShopInfo.getId().toString());
purveyorTransact.setPurveyorName(purveyor.getPurveyorName());
purveyorTransact.setPurveyorId(purveyor.getId().toString());
purveyorTransact.setRemark("");
purveyorTransact.setPurveyorName(Objects.isNull(purveyor)?"":purveyor.getPurveyorName());
purveyorTransact.setPurveyorId(Objects.isNull(purveyor)?"":purveyor.getId().toString());
purveyorTransact.setRemark(resources.getRemark());
purveyorTransact.setCreatedAt(System.currentTimeMillis());
purveyorTransact.setUpdatedAt(System.currentTimeMillis());
suppFlow.setConInfoId(info.getConTypeId());
suppFlow.setShopId(resources.getShopId());
suppFlow.setSupplierId(resources.getSupplierId());
suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId())?0: resources.getSupplierId());
suppFlow.setType(resources.getType());
suppFlow.setStockNumber(conInfos.getStockNumber());

View File

@@ -1,15 +1,11 @@
package cn.ysk.cashier.controller.product;
import cn.hutool.core.util.StrUtil;
import cn.ysk.cashier.annotation.AnonymousAccess;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
import cn.ysk.cashier.dto.product.StockQueryDto;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.service.product.StockService;
import cn.ysk.cashier.utils.BeanUtil;
import cn.ysk.cashier.utils.SecurityUtils;
import cn.ysk.cashier.vo.StockPageImpl;
import cn.ysk.cashier.vo.StockUpdateValueVO;
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
import cn.ysk.cashier.vo.StockV2Vo;
@@ -18,15 +14,12 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Map;

View File

@@ -39,8 +39,8 @@ public class TbProductController {
}
@GetMapping("/isHot")
public ResponseEntity<Object> updateIsHot(@RequestParam String shopId, @RequestParam Integer id){
tbProductService.updateIsHot(id,shopId);
public ResponseEntity<Object> updateIsHot(@RequestParam Integer isHot, @RequestParam Integer id){
tbProductService.updateIsHot(id,isHot);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

View File

@@ -61,7 +61,7 @@ public class TbProductStockOperateController {
@PostMapping("/outAndOn")
@ApiOperation("新增/product/StockOperate")
@Log("出入库")
@Log("商品::#outAndOnDto.type")
// @PreAuthorize("@el.check('tbProductStockOperate:add')")
public ResponseEntity<Object> createOutAndONOperate(@RequestBody OutAndOnDto outAndOnDto){
return new ResponseEntity<>(tbProductStockOperateService.createOutAndONOperate(outAndOnDto),HttpStatus.CREATED);

View File

@@ -1,25 +1,9 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.service.shop.TbPlussShopStaffService;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffQueryCriteria;
import io.swagger.models.auth.In;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@@ -91,4 +75,15 @@ public class TbPlussShopStaffController {
tbPlussShopStaffService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
// @ApiOperation("修改个人密码")
// @PostMapping(value = "/upPass")
// @AnonymousPostMapping
// public ResponseEntity<Object> upshopStaffPass(HttpServletRequest request, @RequestBody Map<String, String> map){
// tbShopInfoService.upShopPass(map.get("username"),map.get("password"));
// //根据token踢出用户
// onlineUserService.logout(tokenProvider.getToken(request));
// log.info("修改商户密码成功。");
// return new ResponseEntity<>(HttpStatus.OK);
// }
}

View File

@@ -72,7 +72,7 @@ public class TbShopInfoController {
public ResponseEntity<Object> upShopPass(HttpServletRequest request, @RequestBody Map<String, String> map) throws Exception {
tbShopInfoService.upShopPass(map.get("username"),map.get("password"));
//根据token踢出用户
// onlineUserService.logout(tokenProvider.getToken(request));
onlineUserService.logout(tokenProvider.getToken(request));
log.info("修改商户密码成功。");
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -0,0 +1,59 @@
package cn.ysk.cashier.mybatis.entity;
import java.io.Serializable;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 商家openid信息表
* @TableName tb_shop_open_id
*/
@Table(name="tb_shop_open_id")
@Data
@EqualsAndHashCode
public class TbShopOpenId implements Serializable {
/**
*
*/
@Id
private Integer id;
/**
* 店铺id
*/
private Integer shopId;
/**
* 已经订阅消息的商家微信号
*/
private String openId;
/**
*
*/
private Integer status;
/**
*
*/
private LocalDateTime createTime;
/**
*
*/
private LocalDateTime updateTime;
/**
* 类型 -1 任意消息 0库存预警
*/
private Integer type;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,18 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author Administrator
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Mapper
* @createDate 2024-08-02 10:00:27
* @Entity cn.ysk.cashier.mybatis.entity.TbShopOpenId
*/
public interface TbShopOpenIdMapper extends BaseMapper<TbShopOpenId> {
}

View File

@@ -0,0 +1,13 @@
package cn.ysk.cashier.mybatis.service;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author Administrator
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Service
* @createDate 2024-08-02 10:00:27
*/
public interface TbShopOpenIdService extends IService<TbShopOpenId> {
}

View File

@@ -0,0 +1,22 @@
package cn.ysk.cashier.mybatis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import cn.ysk.cashier.mybatis.service.TbShopOpenIdService;
import cn.ysk.cashier.mybatis.mapper.TbShopOpenIdMapper;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Service实现
* @createDate 2024-08-02 10:00:27
*/
@Service
public class TbShopOpenIdServiceImpl extends ServiceImpl<TbShopOpenIdMapper, TbShopOpenId>
implements TbShopOpenIdService{
}

View File

@@ -3,6 +3,7 @@ package cn.ysk.cashier.repository.order;
import cn.ysk.cashier.dto.product.StockCountDTO;
import cn.ysk.cashier.pojo.order.TbOrderDetail;
import cn.ysk.cashier.vo.TbOrderPayCountVo;
import cn.ysk.cashier.vo.TbOrderSaleVO;
import cn.ysk.cashier.vo.TbOrderSalesCountByDayVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Page;
@@ -14,6 +15,8 @@ import org.springframework.data.jpa.repository.Query;
import javax.persistence.Tuple;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
@@ -82,7 +85,9 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
"SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END), " +
"SUM(info.num), " +
"SUM(CASE WHEN orders.orderType!='return' THEN info.priceAmount ELSE 0 END), " +
"SUM(CASE WHEN orders.orderType='return' THEN info.priceAmount ELSE 0 END)) " +
"SUM(CASE WHEN orders.orderType='return' THEN info.priceAmount ELSE 0 END), " +
"info.productId, " +
"info.productSkuId ) " +
"FROM TbOrderInfo orders " +
"LEFT JOIN TbOrderDetail info on orders.id=info.orderId " +
"LEFT JOIN TbProduct pro ON info.productId = pro.id " +
@@ -97,6 +102,20 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
"ORDER BY salesNum DESC")
List<TbOrderSalesCountByDayVo> queryTbOrderSalesCountByDay(@Param("shopId") Integer shopId,@Param("cateId")String cateId,@Param("proName")String proName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@Query(value = "SELECT " +
"new cn.ysk.cashier.vo.TbOrderSaleVO(oi.orderNo, od.num, od.price, od.status)\n" +
"FROM\n" +
"TbOrderInfo oi\n" +
"LEFT JOIN TbOrderDetail od ON oi.id = od.orderId \n" +
"WHERE\n" +
"od.shopId = :shopId \n" +
"AND ( od.status = 'closed' OR od.status = 'refund' ) \n" +
"AND od.createTime > :startTime \n" +
"AND od.createTime < :endTime \n" +
"AND (:productId is null or od.productId = :productId)\n" +
"AND (:productId is null or od.productSkuId = :productSkuId)")
List<TbOrderSaleVO> querySaleOrderInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productId") Integer productId, @Param("productSkuId") Integer productSkuId, @Param("shopId") Integer shopId);
@Query("SELECT new cn.ysk.cashier.vo.TbOrderSalesCountByDayVo(" +
"COALESCE(CAST(SUM(CASE WHEN orders.orderType!='return' THEN info.num ELSE 0 END) as long),0), " +
"COALESCE(CAST(SUM(CASE WHEN orders.orderType='return' THEN info.num ELSE 0 END) as long),0))" +
@@ -145,4 +164,5 @@ public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, In
List<Integer> findOrderIdsByProductNameLike(@Param("productName") String productName, @Param("shop_id") String shopId,
@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}

View File

@@ -25,9 +25,9 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
@Query(value = "update tb_product set status = -1 where id in :productIds",nativeQuery = true)
@Modifying
void updateByStatus(List<Integer> productIds);
@Query(value = "update tb_product set is_hot=1 where id = :id",nativeQuery = true)
@Query(value = "update tb_product set is_hot=:isHot where id = :id",nativeQuery = true)
@Modifying
void updateIsHot(@Param("id") Integer id);
void updateIsHot(@Param("id") Integer id,@Param("isHot")Integer isHot);
@Query(value = "update tb_product set is_stock=:isStock where id = :proId and shop_id=:shopId",nativeQuery = true)
@Modifying
@@ -62,4 +62,6 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
@Query("select product from TbProduct product where product.shopId=:shopId")
List<TbProduct> selectByShopId(String shopId);
@Query(value = "select b.* from tb_product_sku as a left join tb_product as b on a.product_id=b.id where a.id=:skuId", nativeQuery = true)
TbProduct selectBySkuId(@Param("skuId") Integer skuId);
}

View File

@@ -63,7 +63,7 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
@Query("SELECT new cn.ysk.cashier.vo.StockV2Vo(" +
"sku.id,pro.id,pro.coverImg,pro.name,unit.name,pro.typeEnum,sku.specSnap,pro.isStock, " +
"CASE WHEN pro.isDistribute = 1 THEN IFNULL(pro.stockNumber, 0) ELSE SUM(sku.stockNumber) END as number" +
", pro.isDistribute, pro.isPauseSale, true, sku.warnLine, pro.lowPrice, CASE WHEN sku.isGrounding=1 THEN true ELSE false END as isGrounding) " +
", pro.isDistribute, pro.isPauseSale, true, sku.warnLine, pro.lowPrice, CASE WHEN sum(sku.isGrounding) > 0 THEN true ELSE false END as isGrounding) " +
"from " +
"TbProduct pro " +
"LEFT JOIN TbProductSku sku on pro.id = sku.productId " +

View File

@@ -1,18 +1,3 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.repository.shop;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
@@ -21,8 +6,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* @website https://eladmin.vip
* @author lyf
@@ -42,6 +25,10 @@ public interface TbPlussShopStaffRepository extends JpaRepository<TbPlussShopSta
@Query("update TbPlussShopStaff set password = :password , updatedAt = :lastPasswordResetTime where account = :account")
void updatePass(String account, String password, Long lastPasswordResetTime);
@Modifying
@Query("update TbPlussShopStaff set password = :password , updatedAt = :lastPasswordResetTime where account = :account and shopId=:shopId")
void updatePassAndShopId(String account, String shopId, String password, Long lastPasswordResetTime);
@Query("select staff from TbPlussShopStaff as staff where staff.account = :account")
TbPlussShopStaff queryByAccount(String account);

View File

@@ -33,10 +33,12 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;
@Service
@RequiredArgsConstructor
@@ -404,9 +406,12 @@ public class SummaryServiceImpl implements SummaryService {
@Override
public void download(ShopSummaryDto summaryDto, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
// ConcurrentLinkedQueue<Map<String, Object>> list = new ConcurrentLinkedQueue();
if(StringUtils.isBlank(summaryDto.getCateId())){
summaryDto.setCateId(null);
}
ArrayList<Integer> mergeRowIndex = new ArrayList<>();
if (summaryDto.getType() != null && summaryDto.getType() == 1) {//金额
Long start = 1704038400000L;
Long end = Instant.now().toEpochMilli();
@@ -430,23 +435,39 @@ public class SummaryServiceImpl implements SummaryService {
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
summaryDto.setEndTime(new Date());
}
List<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()),summaryDto.getCateId(),summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
for (TbOrderSalesCountByDayVo all : tbOrderSalesCountByDayVos) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("商品分类", all.getCateName());
map.put("商品名称", all.getProductName());
map.put("单 位", all.getUnitName());
map.put("商品规格", StringUtils.isBlank(all.getProductSkuName()) ? "" : all.getProductSkuName());
map.put("销 售 额", all.getSalesAmount());
map.put("销 量", all.getSalesNum());
map.put("", all.getPrice());
map.put("退 单 量", all.getRefNum());
map.put("退 单", all.getRefAmount().compareTo(BigDecimal.ZERO)==0?all.getRefAmount():"-"+all.getRefAmount());
map.put("", all.getNum()-all.getRefNum());
list.add(map);
}
List<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository
.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()),summaryDto.getCateId(),summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
tbOrderSalesCountByDayVos.forEach(all -> {
List<TbOrderSaleVO> tbOrderSaleVOS = detailRepository.querySaleOrderInfo(new Timestamp(summaryDto.getStartTime().getTime()),
new Timestamp(summaryDto.getEndTime().getTime()), all.getProductId(), all.getProductSkuId(), Integer.valueOf(summaryDto.getShopId()));
for (TbOrderSaleVO tbOrderSaleVO : tbOrderSaleVOS) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("商品分类", all.getCateName());
map.put("商品名称", all.getProductName());
map.put("", all.getUnitName());
map.put("商品规格", StringUtils.isBlank(all.getProductSkuName()) ? "" : all.getProductSkuName());
map.put("销 售", all.getSalesAmount());
map.put("", all.getSalesNum());
map.put("单 价", all.getPrice());
map.put("退 单 量", all.getRefNum());
map.put("退 单 额", all.getRefAmount().compareTo(BigDecimal.ZERO)==0?all.getRefAmount():"-"+all.getRefAmount());
map.put("总 量", all.getNum()-all.getRefNum());
map.put("订单编号", tbOrderSaleVO.getOrderNo());
map.put("售出数量", tbOrderSaleVO.getNum());
list.add(map);
}
if (!tbOrderSaleVOS.isEmpty()) {
if (mergeRowIndex.isEmpty()) {
mergeRowIndex.add(tbOrderSaleVOS.size());
}else {
mergeRowIndex.add(mergeRowIndex.get(mergeRowIndex.size() - 1) + tbOrderSaleVOS.size());
}
}
});
}
FileUtil.downloadExcel(list, response);
FileUtil.downloadExcelAndMerge(list, 10, response, mergeRowIndex);
}
@Override

View File

@@ -17,10 +17,7 @@ import cn.ysk.cashier.repository.shop.TbShopUnitRepository;
import cn.ysk.cashier.service.TbProductStockOperateService;
import cn.ysk.cashier.service.product.StockService;
import cn.ysk.cashier.service.product.TbProductService;
import cn.ysk.cashier.utils.CacheKey;
import cn.ysk.cashier.utils.FileUtil;
import cn.ysk.cashier.utils.RedisUtils;
import cn.ysk.cashier.utils.StringUtils;
import cn.ysk.cashier.utils.*;
import cn.ysk.cashier.vo.StockUpdateValueVO;
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
import cn.ysk.cashier.vo.StockV2Vo;
@@ -62,6 +59,7 @@ public class StockServiceImpl implements StockService {
private final TbShopUnitRepository shopUnitRepository;
private final TbProductStockDetailRepository tbProductStockDetailRepository;
private final TbProductRepository tbProductRepository;
private final WxMsgUtils wxMsgUtils;
@PersistenceContext
private EntityManager em;
@@ -349,6 +347,15 @@ public class StockServiceImpl implements StockService {
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
nativeQuery.executeUpdate();
TbProduct product = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getTargetId()));
TbProductSku tbProductSku = tbProductSkuRepository.findById(Integer.valueOf(updateValueVO.getTargetId())).orElse(null);
// 推送微信操作消息
if (product != null && tbProductSku != null) {
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭sku售罄: " : "开启sku售罄: ") + product.getName() + "/"+ tbProductSku.getSpecSnap());
}else {
log.warn("推送微信操作消息失败未查询到商品信息skuId: {}", updateValueVO.getTargetId());
}
return;
case "stock":
sqlQuery.append(" set is_stock = ").append(updateValueVO.getUpdateValue());
@@ -358,6 +365,13 @@ public class StockServiceImpl implements StockService {
break;
case "pauseSale":
sqlQuery.append(" set is_pause_sale = ").append(updateValueVO.getUpdateValue());
TbProduct product1 = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getTargetId()));
// 推送微信操作消息
if (product1 != null) {
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭售罄: " : "开启售罄: ") + product1.getName());
}else {
log.warn("推送微信操作消息失败未查询到商品信息skuId: {}", updateValueVO.getTargetId());
}
break;
default:
throw new BadRequestException("无效更新类型");
@@ -393,7 +407,10 @@ public class StockServiceImpl implements StockService {
if (tbProductSku == null) {
throw new BadRequestException("商品不存在skuId: " + skuId);
}
TbProduct product = tbProductRepository.selectByShopIdAndId(Integer.parseInt(tbProductSku.getProductId()), String.valueOf(shopId));
// 推送微信操作消息
wxMsgUtils.aboardOperationMsg((isGrounding ? "上架商品: " : "下架商品: ") + product.getName());
// 共享库存下架所有sku
if (product.getIsDistribute().equals(1)) {
tbProductSkuRepository.updateGroundingByProId(product.getId().toString(), isGrounding ? 1 : 0);

View File

@@ -46,6 +46,7 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
private final TbProductGroupRepository tbProductGroupRepository;
private final TbProductGroupMapper tbProductGroupMapper;
private final TbProductRepository tbProductRepository;
private final WxMsgUtils wxMsgUtils;
@Resource
private OnlineUserService onlineUserService;
@@ -104,6 +105,9 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
ValidationUtil.isNull( tbProductGroup.getId(),"TbProductGroup","id",resources.getId());
tbProductGroup.copy(resources);
tbProductGroupRepository.save(tbProductGroup);
// 推送微信操作消息
wxMsgUtils.aboardOperationMsg((resources.getIsShow() == 0 ? "关闭分组: " : "开启分组: ") + tbProductGroup.getName());
}
@Transactional(rollbackFor = Exception.class)
@@ -224,4 +228,4 @@ public class TbProductGroupServiceImpl implements TbProductGroupService {
}
}

View File

@@ -521,9 +521,8 @@ public class TbProductServiceImpl implements TbProductService {
@Transactional(rollbackFor = Exception.class)
@Override
public void updateIsHot(Integer id, String shopId) {
tbProductRepository.updateNullHot(shopId);
tbProductRepository.updateIsHot(id);
public void updateIsHot(Integer id,Integer isHot) {
tbProductRepository.updateIsHot(id,isHot);
}
@Transactional(rollbackFor = Exception.class)

View File

@@ -160,6 +160,7 @@ public class TbProductStocktakinServiceImpl implements TbProductStocktakinServic
round = (int) Math.floor( productSku.getStockNumber());
productStockDetail.setSpecSnap(productSku.getSpecSnap());
productStockDetail.setSubType(productStocktakinDTO.getStocktakinNum() > productSku.getStockNumber() ? 1 : -1);
stockOperate.setType(productStocktakinDTO.getStocktakinNum() > productSku.getStockNumber() ? "盘点入库" : "盘点出库");

View File

@@ -203,7 +203,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
Set<Long> sysUserIds=new HashSet<>();
for (Integer id : ids) {
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).get();
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount());
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getShopId()+"@"+tbPlussShopStaff.getAccount());
tbPlussShopStaffRepository.deleteById(id);
sysUserIds.add(sysUser.getId());
}

View File

@@ -85,7 +85,7 @@ public interface TbProductService {
*/
void download(List<TbProductDto> all, HttpServletResponse response) throws IOException;
void updateIsHot(Integer id, String shopId);
void updateIsHot(Integer id,Integer isStock);
void updateIsStock(Integer proId, String shopId, Integer isStock);

View File

@@ -1,18 +1,3 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.system.domain.vo;
import lombok.Data;
@@ -25,6 +10,9 @@ import lombok.Data;
@Data
public class UserPassVo {
//staff
private String loginType;
private String oldPass;
private String newPass;

View File

@@ -1,26 +1,15 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.system.rest;
import cn.hutool.core.collection.CollectionUtil;
import cn.ysk.cashier.config.security.security.TokenProvider;
import cn.ysk.cashier.config.security.service.OnlineUserService;
import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository;
import cn.ysk.cashier.system.domain.Dept;
import cn.ysk.cashier.system.domain.User;
import cn.ysk.cashier.system.domain.vo.UserPassVo;
import cn.ysk.cashier.system.service.dto.UserDto;
import cn.ysk.cashier.system.service.dto.UserQueryCriteria;
import cn.ysk.cashier.utils.MD5Utils;
import cn.ysk.cashier.utils.PageUtil;
import cn.ysk.cashier.utils.RsaUtils;
import cn.ysk.cashier.utils.SecurityUtils;
@@ -37,16 +26,20 @@ import cn.ysk.cashier.system.service.dto.RoleSmallDto;
import cn.ysk.cashier.system.service.VerifyService;
import cn.ysk.cashier.system.service.UserService;
import cn.ysk.cashier.utils.enums.CodeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
@@ -68,6 +61,9 @@ public class UserController {
private final DeptService deptService;
private final RoleService roleService;
private final VerifyService verificationCodeService;
private final OnlineUserService onlineUserService;
private final TbPlussShopStaffRepository shopStaffRepository;
private final TokenProvider tokenProvider;
@ApiOperation("导出用户数据")
@GetMapping(value = "/download")
@@ -155,17 +151,27 @@ public class UserController {
@ApiOperation("修改密码")
@PostMapping(value = "/updatePass")
public ResponseEntity<Object> updateUserPass(@RequestBody UserPassVo passVo) throws Exception {
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getOldPass());
String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getNewPass());
UserDto user = userService.findByName(SecurityUtils.getCurrentUsername());
if(!passwordEncoder.matches(oldPass, user.getPassword())){
@Transactional
public ResponseEntity<Object> updateUserPass(HttpServletRequest request, @RequestBody UserPassVo passVo) throws Exception {
String currentUsername = SecurityUtils.getCurrentUsername();
UserDto user = userService.findByName(currentUsername);
String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
if (!passwordEncoder.matches(oldPass, user.getPassword())) {
throw new BadRequestException("修改失败,旧密码错误");
}
if(passwordEncoder.matches(newPass, user.getPassword())){
System.out.println(oldPass);
if (passwordEncoder.matches(passVo.getNewPass(), user.getPassword())) {
throw new BadRequestException("新密码不能与旧密码相同");
}
userService.updatePass(user.getUsername(),passwordEncoder.encode(newPass));
String encPass = MD5Utils.encrypt( passVo.getNewPass());
if (StringUtils.isNotBlank(passVo.getLoginType()) && passVo.getLoginType().equals("staff")) {
String[] split = currentUsername.split("@");
shopStaffRepository.updatePassAndShopId(split[1],split[0],encPass,System.currentTimeMillis());
}else {
shopStaffRepository.updatePass(currentUsername,encPass,System.currentTimeMillis());
}
userService.updatePass(user.getUsername(),passwordEncoder.encode(passVo.getNewPass()));
onlineUserService.logout(tokenProvider.getToken(request));
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -0,0 +1,126 @@
package cn.ysk.cashier.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Data
@Slf4j
@Component
public class WxAccountUtil {
@Value("${wx.ysk.appId}")
private String appId = "wx212769170d2c6b2a";
@Value("${wx.ysk.secrete}")
private String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0";
@Value("${wx.ysk.operationMsgTmpId}")
private String operationMsgTmpId ;
static LinkedHashMap<String,String> linkedHashMap=new LinkedHashMap<>();
static {
linkedHashMap.put("40001","获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的公众号调用接口");
linkedHashMap.put("40003","不合法的 OpenID ,请开发者确认 OpenID (该用户)是否已关注公众号,或是否是其他公众号的 OpenID");
linkedHashMap.put("40014","不合法的 access_token ,请开发者认真比对 access_token 的有效性(如是否过期),或查看是否正在为恰当的公众号调用接口");
linkedHashMap.put("40037","不合法的 template_id");
linkedHashMap.put("43101","用户未订阅消息");
linkedHashMap.put("43107","订阅消息能力封禁");
linkedHashMap.put("43108","并发下发消息给同一个粉丝");
linkedHashMap.put("45168","命中敏感词");
linkedHashMap.put("47003","参数错误");
}
public static void main(String[] args) {
// sendStockWarnMsg("13213", "31123", "234", "ojC-S6n2DDlpj52iVMoiLL0Ry4HI");
}
public String getRadarQrCode(Integer shopId) {
HashMap<String, Object> req = new HashMap<>();
req.put("expire_seconds", 300);
req.put("action_name", "QR_STR_SCENE");
HashMap<Object, Object> actionInfo = new HashMap<>();
HashMap<String, Object> scene = new HashMap<>();
scene.put("scene_str", "msg" + shopId);
actionInfo.put("scene", scene);
req.put("action_info", actionInfo);
log.info("开始获取公众号二维码, 请求数据: {}", req);
String resp = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + getAccessToken(), JSONObject.toJSONString(req));
JSONObject respInfo = JSONObject.parseObject(resp);
log.warn("获取微信公众号二维码结束,响应: {}", resp);
if (!respInfo.containsKey("url")) {
log.warn("获取微信公众号二维码失败,响应: {}", resp);
throw new RuntimeException(resp);
}
return respInfo.getString("url");
}
public String getAccessToken() {
String resp = HttpUtil.get(StrUtil.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={}&secret={}", appId, secrete));
JSONObject respInfo = JSONObject.parseObject(resp);
if (!respInfo.containsKey("access_token")) {
log.warn("公众号获取token失败, 响应内容: {}", resp);
throw new RuntimeException(resp);
}
return respInfo.getString("access_token");
}
public JSONObject sendTemplateMsg(String templateId, String toUserOpenId, Map<String, Object> data) {
log.info("开始发送微信模板消息, 接收用户openId: {}, 消息数据: {}", toUserOpenId, data);
String accessToken = getAccessToken();
JSONObject object1=new JSONObject();
object1.put("template_id", templateId);
object1.put("touser", toUserOpenId);
object1.put("data",data);
String response= HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=".concat(accessToken)).body(object1.toString()).execute().body();
log.info("微信模板消息发送成功,响应内容:{}",response);
JSONObject resObj=JSONObject.parseObject(response);
if(ObjectUtil.isNotEmpty(resObj)&&ObjectUtil.isNotNull(resObj)&&"0".equals(resObj.get("errcode")+"")){
return resObj;
}
throw new RuntimeException(linkedHashMap.getOrDefault(resObj.get("errcode") + "", "未知错误"));
}
@Async
public void sendOperationMsg(List<TbShopOpenId> openIds, String userName, String operationDesc) {
openIds.forEach(item -> {
Map<String, Object> data = new HashMap<String, Object>() {{
put("thing19", new HashMap<String, Object>(){{
put("value", userName);
}});
put("thing8", new HashMap<String, Object>(){{
put("value", operationDesc);
}});
put("time21", new HashMap<String, Object>(){{
put("value", DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
}});
}};
log.info("开始发送敏感操作消息, 接收用户openId: {}, 操作用户: {}, 操作描述: {}", item.getOpenId(), userName, operationDesc);
try {
sendTemplateMsg(operationMsgTmpId, item.getOpenId(), data);
}catch (Exception e) {
log.error("发送失败, openId: {}, 响应: {}", item.getOpenId(), e.getMessage());
}
});
}
}

View File

@@ -0,0 +1,58 @@
package cn.ysk.cashier.utils;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import cn.ysk.cashier.mybatis.service.TbShopOpenIdService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Component
@Slf4j
public class WxMsgUtils {
private final TbShopOpenIdService tbShopOpenIdService;
private final RedisUtils redisUtils;
private final WxAccountUtil wxAccountUtil;
public WxMsgUtils(TbShopOpenIdService tbShopOpenIdService, RedisUtils redisUtils, WxAccountUtil wxAccountUtil) {
this.tbShopOpenIdService = tbShopOpenIdService;
this.redisUtils = redisUtils;
this.wxAccountUtil = wxAccountUtil;
}
public void aboardOperationMsg(String operationDesc) {
HttpServletRequest request = RequestHolder.getHttpServletRequest();
Object o = redisUtils.get("online-token-"+getToken(request));
JSONObject jsonObject;
Integer shopId;
String nickName;
if (o != null) {
String jsonString = JSON.toJSONString(o);
jsonObject = JSONObject.parseObject(jsonString);
shopId = (Integer) jsonObject.get("shopId");
nickName = jsonObject.get("nickName") == null ? "" : jsonObject.get("nickName").toString();
List<TbShopOpenId> openIds = tbShopOpenIdService.lambdaQuery().eq(TbShopOpenId::getShopId, shopId).list();
log.info("即将开始推送敏感操作消息, 接收推送openId列表: {}", openIds);
String finalNickName = nickName;
wxAccountUtil.sendOperationMsg(openIds, finalNickName, operationDesc);
}else {
log.warn("发送敏感操作预警失败,未获取到登录信息");
}
}
public String getToken(HttpServletRequest request) {
final String requestHeader = request.getHeader("Authorization");
if (requestHeader != null && requestHeader.startsWith("Bearer")) {
return requestHeader.substring(7);
}
return null;
}
}

View File

@@ -0,0 +1,17 @@
package cn.ysk.cashier.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TbOrderSaleVO {
private String orderNo;
private Integer num;
private BigDecimal price;
private String status;
}

View File

@@ -14,6 +14,24 @@ public class TbOrderSalesCountByDayVo {
private BigDecimal salesAmount;
private BigDecimal refAmount;
private Long num;
private Integer productId;
private Integer productSkuId;
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getProductSkuId() {
return productSkuId;
}
public void setProductSkuId(Integer productSkuId) {
this.productSkuId = productSkuId;
}
public String getProductName() {
return productName;
@@ -116,6 +134,25 @@ public class TbOrderSalesCountByDayVo {
count();
}
public TbOrderSalesCountByDayVo(String productName, String productSkuName, String cateName,String unitName,BigDecimal price,
Long salesNum, Long refNum, Long num, BigDecimal salesAmount, BigDecimal refAmount, Integer productId, Integer productSkuId) {
this.productName = productName;
this.productSkuName = productSkuName;
this.cateName = cateName;
this.unitName = unitName;
this.price = price;
this.salesNum = salesNum;
this.refNum = refNum;
this.salesAmount = salesAmount;
this.refAmount = refAmount;
this.num = num;
this.productId = productId;
this.productSkuId = productSkuId;
count();
}
public void count(){
salesNum=salesNum-refNum;
salesAmount=salesAmount.subtract(refAmount);

View File

@@ -78,3 +78,9 @@ aliyun:
oss:
bucketname: cashier-oss
endpoint: oss-cn-beijing.aliyuncs.com
wx:
ysk:
appId: wx212769170d2c6b2a
secrete: 8492a7e8d55bbb1b57f5c8276ea1add0
operationMsgTmpId: wFdoUG-dUT7bDRHq8bMJD9CF5TjyH9x_uJQgQByZqHg

View File

@@ -0,0 +1,22 @@
<?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="cn.ysk.cashier.mybatis.mapper.TbShopOpenIdMapper">
<resultMap id="BaseResultMap" type="cn.ysk.cashier.mybatis.entity.TbShopOpenId">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="shop_id" column="shop_id" jdbcType="INTEGER"/>
<result property="open_id" column="open_id" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
<result property="update_time" column="update_time" jdbcType="TIMESTAMP"/>
<result property="type" column="type" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,shop_id,open_id,
status,create_time,update_time,
type
</sql>
</mapper>