fix: 茅台预约,功能优化及完善。
This commit is contained in:
@@ -6,6 +6,9 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.invest.domain.dto.IShopDto;
|
||||
import com.ruoyi.invest.domain.vo.ICityVo;
|
||||
import com.ruoyi.invest.domain.vo.IDistrictVo;
|
||||
import com.ruoyi.invest.domain.vo.IProvinceVo;
|
||||
import com.ruoyi.invest.domain.vo.IShopVo;
|
||||
import com.ruoyi.invest.service.IShopService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -55,4 +58,43 @@ public class IShopController extends BaseController {
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*/
|
||||
@ApiOperation(value="查询省份列表",response = IShopVo.class)
|
||||
@RequiresPermissions("invest:ishop:list")
|
||||
@GetMapping("/provinceList")
|
||||
public TableDataInfo provinceList(IShopDto iShopDto)
|
||||
{
|
||||
startPage();
|
||||
List<IProvinceVo> list = iShopService.selectProvinceVoList(iShopDto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*/
|
||||
@ApiOperation(value="查询城市列表",response = IShopVo.class)
|
||||
@RequiresPermissions("invest:ishop:list")
|
||||
@GetMapping("/cityList")
|
||||
public TableDataInfo cityList(IShopDto iShopDto)
|
||||
{
|
||||
startPage();
|
||||
List<ICityVo> list = iShopService.selectCityVoList(iShopDto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*/
|
||||
@ApiOperation(value="查询区域列表列表",response = IShopVo.class)
|
||||
@RequiresPermissions("invest:ishop:list")
|
||||
@GetMapping("/districtList")
|
||||
public TableDataInfo districtList(IShopDto iShopDto)
|
||||
{
|
||||
startPage();
|
||||
List<IDistrictVo> list = iShopService.selectDistrictVoList(iShopDto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.invest.domain.IShop;
|
||||
import com.ruoyi.invest.domain.IUser;
|
||||
import com.ruoyi.invest.domain.dto.IUserDto;
|
||||
import com.ruoyi.invest.domain.vo.IItemVo;
|
||||
import com.ruoyi.invest.domain.vo.IUserVo;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.invest.mapper.IUserMapper;
|
||||
import com.ruoyi.invest.service.IMTService;
|
||||
import com.ruoyi.invest.service.IShopService;
|
||||
@@ -41,6 +43,8 @@ public class IUserController extends BaseController {
|
||||
@Resource
|
||||
private IUserMapper iUserMapper;
|
||||
@Resource
|
||||
private IItemMapper iItemMapper;
|
||||
@Resource
|
||||
private IMTService imtService;
|
||||
@Resource
|
||||
private IShopService iShopService;
|
||||
@@ -118,6 +122,20 @@ public class IUserController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
@ApiOperation(value="新增账号管理")
|
||||
@RequiresPermissions("invest:iuser:add")
|
||||
@Log(title = "账号管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/loginIUser", name = "登录")
|
||||
public R loginUser(@RequestBody IUser iUser) {
|
||||
imtService.login(iUser);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户管理
|
||||
*/
|
||||
@@ -158,7 +176,16 @@ public class IUserController extends BaseController {
|
||||
iUser.setLat(iShop.getLat());
|
||||
iUser.setProvinceName(iShop.getProvinceName());
|
||||
iUser.setCityName(iShop.getCityName());
|
||||
iUser.setDistrictName(iShop.getDistrictName());
|
||||
iUser.setAddress(iShop.getAddress());
|
||||
|
||||
String[] items = iUser.getItemCode().split("@");
|
||||
String itemName = "";
|
||||
for (String itemId : items) {
|
||||
IItemVo item=iItemMapper.selectIItemByItemCode(itemId);
|
||||
itemName+=item.getTitle()+"("+itemId+")、";
|
||||
}
|
||||
iUser.setItemName(itemName.substring(0,itemName.length()-1));
|
||||
return toAjax(iUserService.updateIUser(iUser));
|
||||
}
|
||||
|
||||
@@ -169,7 +196,7 @@ public class IUserController extends BaseController {
|
||||
@RequiresPermissions("invest:iuser:remove")
|
||||
@Log(title = "用户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{mobiles}")
|
||||
public AjaxResult remove(@PathVariable Long[] mobiles)
|
||||
public AjaxResult remove(@PathVariable String[] mobiles)
|
||||
{
|
||||
return toAjax(iUserService.deleteIUser(mobiles));
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ public class IItem extends BaseEntity
|
||||
@Excel(name = "图片")
|
||||
private String picture;
|
||||
|
||||
/** 图片 */
|
||||
@ApiModelProperty(value="图片")
|
||||
@Excel(name = "图片")
|
||||
private String pictureV2;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
@@ -60,6 +65,7 @@ public class IItem extends BaseEntity
|
||||
.append("title", getTitle())
|
||||
.append("content", getContent())
|
||||
.append("picture", getPicture())
|
||||
.append("pictureV2", getPictureV2())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
@@ -71,6 +77,7 @@ public class IItem extends BaseEntity
|
||||
this.title = item.getString("title");
|
||||
this.content = item.getString("content");
|
||||
this.picture = item.getString("picture");
|
||||
this.pictureV2 = item.getString("pictureV2");
|
||||
this.createTime = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,11 @@ public class ILog extends BaseEntity
|
||||
@Excel(name = "创建者id")
|
||||
private String createUser;
|
||||
|
||||
/** 日志类型 */
|
||||
@ApiModelProperty(value="日志类型")
|
||||
@Excel(name = "日志类型")
|
||||
private String type;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@@ -64,6 +69,7 @@ public class ILog extends BaseEntity
|
||||
.append("operTime", getOperTime())
|
||||
.append("createUser", getCreateUser())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("type", getType())
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,19 @@ public class IShop extends BaseEntity
|
||||
|
||||
private Double distance;
|
||||
|
||||
private String openEndTime;
|
||||
|
||||
private String openStartTime;
|
||||
|
||||
private String address;
|
||||
|
||||
private String city;
|
||||
|
||||
private String district;
|
||||
|
||||
private String province;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@@ -90,6 +103,13 @@ public class IShop extends BaseEntity
|
||||
.append("name", getName())
|
||||
.append("tenantName", getTenantName())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("openEndTime", getOpenEndTime())
|
||||
.append("openStartTime", getOpenStartTime())
|
||||
.append("address", getAddress())
|
||||
.append("city", getCity())
|
||||
.append("district", getDistrict())
|
||||
.append("province", getProvince())
|
||||
|
||||
.toString();
|
||||
}
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@@ -108,6 +128,12 @@ public class IShop extends BaseEntity
|
||||
this.lng = jsonObject.getString("lng");
|
||||
this.name = jsonObject.getString("name");
|
||||
this.tenantName = jsonObject.getString("tenantName");
|
||||
this.openEndTime = jsonObject.getString("openEndTime");
|
||||
this.openStartTime = jsonObject.getString("openStartTime");
|
||||
this.address = jsonObject.getString("address");
|
||||
this.city = jsonObject.getString("city");
|
||||
this.district = jsonObject.getString("district");
|
||||
this.province = jsonObject.getString("province");
|
||||
this.createTime = new Date();
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public class IUser extends BaseEntity
|
||||
/** 手机号 */
|
||||
private String mobile;
|
||||
|
||||
/** 手机验证码 */
|
||||
private String code;
|
||||
|
||||
/** 用户id */
|
||||
@ApiModelProperty(value="用户id")
|
||||
@Excel(name = "用户id")
|
||||
@@ -103,6 +106,17 @@ public class IUser extends BaseEntity
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 用户名 */
|
||||
private String userName;
|
||||
|
||||
/** 区域名称 */
|
||||
private String districtName;
|
||||
|
||||
/** 预约商品名称 */
|
||||
private String itemName;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* token过期时间
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.invest.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -15,7 +16,7 @@ import java.util.Date;
|
||||
*/
|
||||
@ApiModel("操作日志Dto对象")
|
||||
@Data
|
||||
public class ILogDto implements Serializable
|
||||
public class ILogDto extends BaseEntity implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -32,6 +33,10 @@ public class ILogDto implements Serializable
|
||||
@ApiModelProperty(value="操作状态")
|
||||
private String status;
|
||||
|
||||
/** 类型 */
|
||||
@ApiModelProperty(value="类型")
|
||||
private String type;
|
||||
|
||||
/** 操作时间 */
|
||||
@ApiModelProperty(value="操作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
@@ -37,4 +37,24 @@ public class IShopDto implements Serializable
|
||||
@ApiModelProperty(value="公司名称")
|
||||
private String tenantName;
|
||||
|
||||
/** 名称 */
|
||||
@ApiModelProperty(value="名称")
|
||||
private String name;
|
||||
|
||||
/** 省份 */
|
||||
@ApiModelProperty(value="省份")
|
||||
private String province;
|
||||
|
||||
/** 城市 */
|
||||
@ApiModelProperty(value="城市")
|
||||
private String city;
|
||||
|
||||
/** 地区 */
|
||||
@ApiModelProperty(value="地区")
|
||||
private String district;
|
||||
|
||||
/** 地区 */
|
||||
@ApiModelProperty(value="地址")
|
||||
private String address;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.invest.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -15,7 +16,7 @@ import java.util.Date;
|
||||
*/
|
||||
@ApiModel("用户管理Dto对象")
|
||||
@Data
|
||||
public class IUserDto implements Serializable
|
||||
public class IUserDto extends BaseEntity implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@@ -79,4 +79,12 @@ public interface IItemMapper
|
||||
public int removeIItemByItemIds(Long[] itemIds);
|
||||
|
||||
void truncateItem();
|
||||
|
||||
/**
|
||||
* 查询门店列表
|
||||
*
|
||||
* @param itemCode 门店列表主键
|
||||
* @return 门店列表
|
||||
*/
|
||||
public IItemVo selectIItemByItemCode(String itemCode);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.invest.mapper;
|
||||
|
||||
import com.ruoyi.common.datascope.annotation.DataScope;
|
||||
import com.ruoyi.invest.domain.ILog;
|
||||
import com.ruoyi.invest.domain.dto.ILogDto;
|
||||
import com.ruoyi.invest.domain.vo.ILogVo;
|
||||
@@ -28,6 +29,7 @@ public interface ILogMapper
|
||||
* @param iLogDto 操作日志
|
||||
* @return 操作日志集合
|
||||
*/
|
||||
@DataScope(businessAlias = "a")
|
||||
public List<ILogVo> selectILogList(ILogDto iLogDto);
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.ruoyi.invest.mapper;
|
||||
|
||||
import com.ruoyi.invest.domain.IShop;
|
||||
import com.ruoyi.invest.domain.dto.IShopDto;
|
||||
import com.ruoyi.invest.domain.vo.ICityVo;
|
||||
import com.ruoyi.invest.domain.vo.IDistrictVo;
|
||||
import com.ruoyi.invest.domain.vo.IProvinceVo;
|
||||
import com.ruoyi.invest.domain.vo.IShopVo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -95,4 +98,29 @@ public interface IShopMapper
|
||||
* @return 门店列表
|
||||
*/
|
||||
public IShopVo selectIShopByIShopId(String iShopId);
|
||||
|
||||
/**
|
||||
* 查询省份列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<IProvinceVo> selectProvinceVoList(IShopDto iShopDto);
|
||||
|
||||
/**
|
||||
* 查询城市列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<ICityVo> selectCityVoList(IShopDto iShopDto);
|
||||
|
||||
|
||||
/**
|
||||
* 查询地区列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<IDistrictVo> selectDistrictVoList(IShopDto iShopDto);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.invest.mapper;
|
||||
|
||||
import com.ruoyi.common.datascope.annotation.DataScope;
|
||||
import com.ruoyi.invest.domain.IUser;
|
||||
import com.ruoyi.invest.domain.dto.IUserDto;
|
||||
import com.ruoyi.invest.domain.vo.IUserVo;
|
||||
@@ -28,6 +29,7 @@ public interface IUserMapper
|
||||
* @param iUserDto 用户管理
|
||||
* @return 用户管理集合
|
||||
*/
|
||||
@DataScope(businessAlias = "a")
|
||||
public List<IUserVo> selectIUserList(IUserDto iUserDto);
|
||||
|
||||
/**
|
||||
@@ -60,7 +62,7 @@ public interface IUserMapper
|
||||
* @param mobiles 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteIUserByMobiles(Long[] mobiles);
|
||||
public int deleteIUserByMobiles(String[] mobiles);
|
||||
|
||||
/**
|
||||
* 逻辑删除用户管理
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.TimerTask;
|
||||
public class IMTLogFactory {
|
||||
|
||||
|
||||
public static void reservation(IUser iUser, String logContent) {
|
||||
public static void reservation(IUser iUser, String logContent,String type) {
|
||||
//{"code":2000,"data":{"successDesc":"申购完成,请于7月6日18:00查看预约申购结果","reservationList":[{"reservationId":17053404357,"sessionId":678,"shopId":"233331084001","reservationTime":1688608601720,"itemId":"10214","count":1}],"reservationDetail":{"desc":"申购成功后将以短信形式通知您,请您在申购成功次日18:00前确认支付方式,并在7天内完成提货。","lotteryTime":1688637600000,"cacheValidTime":1688637600000}}}
|
||||
ILog operLog = new ILog();
|
||||
|
||||
@@ -32,6 +32,8 @@ public class IMTLogFactory {
|
||||
operLog.setCreateUser(iUser.getUserId());
|
||||
operLog.setCreateBy(iUser.getCreateBy());
|
||||
operLog.setLogContent(logContent);
|
||||
operLog.setCreateTime(new Date());
|
||||
operLog.setType(type);
|
||||
|
||||
AsyncManager.me().execute(recordOper(operLog));
|
||||
//推送
|
||||
|
||||
@@ -78,5 +78,13 @@ public interface IMTService {
|
||||
*/
|
||||
void appointmentResults();
|
||||
|
||||
/**
|
||||
* 登录i茅台
|
||||
*
|
||||
* @param iUser 手机号
|
||||
* @return
|
||||
*/
|
||||
boolean login(IUser iUser);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ package com.ruoyi.invest.service;
|
||||
import com.ruoyi.invest.domain.IMTItemInfo;
|
||||
import com.ruoyi.invest.domain.IShop;
|
||||
import com.ruoyi.invest.domain.dto.IShopDto;
|
||||
import com.ruoyi.invest.domain.vo.ICityVo;
|
||||
import com.ruoyi.invest.domain.vo.IDistrictVo;
|
||||
import com.ruoyi.invest.domain.vo.IProvinceVo;
|
||||
import com.ruoyi.invest.domain.vo.IShopVo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -101,4 +104,30 @@ public interface IShopService {
|
||||
*/
|
||||
public IShopVo selectIShopByIShopId(String iShopId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<IProvinceVo> selectProvinceVoList(IShopDto iShopDto);
|
||||
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<ICityVo> selectCityVoList(IShopDto iShopDto);
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表集合
|
||||
*/
|
||||
public List<IDistrictVo> selectDistrictVoList(IShopDto iShopDto);
|
||||
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public interface IUserService {
|
||||
* @param iUserId id
|
||||
* @return
|
||||
*/
|
||||
int deleteIUser(Long[] iUserId);
|
||||
int deleteIUser(String[] iUserId);
|
||||
|
||||
/**
|
||||
* 查询用户管理列表
|
||||
@@ -71,4 +71,13 @@ public interface IUserService {
|
||||
* @return 用户管理集合
|
||||
*/
|
||||
public List<IUserVo> selectIUserList(IUserDto iUserDto);
|
||||
|
||||
/**
|
||||
* 添加i茅台用户
|
||||
*
|
||||
* @param iUser
|
||||
* @param body
|
||||
* @return
|
||||
*/
|
||||
int insertIUser(IUser iUser, JSONObject body);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package com.ruoyi.invest.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.common.core.utils.IdWorker;
|
||||
import com.ruoyi.invest.domain.IItem;
|
||||
import com.ruoyi.invest.domain.dto.IItemDto;
|
||||
import com.ruoyi.invest.domain.vo.IItemVo;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.invest.service.IIItemService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预约项目Service业务层处理
|
||||
@@ -57,6 +58,7 @@ public class IItemServiceImpl implements IIItemService
|
||||
public int insertIItem(IItem iItem)
|
||||
{
|
||||
iItem.setCreateTime(DateUtils.getNowDate());
|
||||
iItem.setItemId(IdWorker.getId());
|
||||
return iItemMapper.insertIItem(iItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ import com.ruoyi.common.core.utils.RedisCache;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.invest.domain.IMTCacheConstants;
|
||||
import com.ruoyi.invest.domain.IUser;
|
||||
import com.ruoyi.invest.domain.vo.IItemVo;
|
||||
import com.ruoyi.invest.domain.vo.IShopVo;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.invest.mapper.IShopMapper;
|
||||
import com.ruoyi.invest.mapper.IUserMapper;
|
||||
import com.ruoyi.invest.service.IMTLogFactory;
|
||||
import com.ruoyi.invest.service.IMTService;
|
||||
@@ -47,6 +51,9 @@ public class IMTServiceImpl implements IMTService {
|
||||
@Autowired
|
||||
private IUserMapper iUserMapper;
|
||||
|
||||
@Autowired
|
||||
private IShopMapper ishopMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@@ -55,6 +62,9 @@ public class IMTServiceImpl implements IMTService {
|
||||
@Autowired
|
||||
private IShopService iShopService;
|
||||
|
||||
@Autowired
|
||||
private IItemMapper iItemMapper;
|
||||
|
||||
private final static String SALT = "2af72f100c356273d46284f6fd1dfc08";
|
||||
|
||||
private final static String AES_KEY = "qbhajinldepmucsonaaaccgypwuvcjaa";
|
||||
@@ -181,33 +191,29 @@ public class IMTServiceImpl implements IMTService {
|
||||
}
|
||||
String[] items = iUser.getItemCode().split("@");
|
||||
|
||||
String logContent = "";
|
||||
|
||||
for (String itemId : items) {
|
||||
IItemVo item=iItemMapper.selectIItemByItemCode(itemId);
|
||||
String logContent = "";
|
||||
try {
|
||||
String shopId = iShopService.getShopId(iUser.getShopType(), itemId,
|
||||
iUser.getProvinceName(), iUser.getCityName(), iUser.getLat(), iUser.getLng());
|
||||
//预约
|
||||
JSONObject json = reservation(iUser, itemId, shopId);
|
||||
logContent += String.format("[预约项目]:%s\n[shopId]:%s\n[结果返回]:%s\n\n", itemId, shopId, json.toString());
|
||||
IShopVo shop=ishopMapper.selectIShopByIShopId(shopId);
|
||||
|
||||
logContent = String.format("[预约项目]:%s,[预约门店]:%s,预约成功!", item.getTitle()+"("+itemId+")", shop.getName()+",地址:"+shop.getAddress(), json.toString());
|
||||
|
||||
//随机延迟3~5秒
|
||||
Random random = new Random();
|
||||
int sleepTime = random.nextInt(3) + 3;
|
||||
Thread.sleep(sleepTime * 1000);
|
||||
} catch (Exception e) {
|
||||
logContent += String.format("执行报错--[预约项目]:%s\n[结果返回]:%s\n\n", itemId, e.getMessage());
|
||||
logContent = String.format("执行报错--[预约项目]:%s,错误原因:%s", item.getTitle()+"("+itemId+")", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// try {
|
||||
// //预约后领取耐力值
|
||||
// String energyAward = getEnergyAward(iUser);
|
||||
// logContent += "[申购耐力值]:" + energyAward;
|
||||
// } catch (Exception e) {
|
||||
// logContent += "执行报错--[申购耐力值]:" + e.getMessage();
|
||||
// }
|
||||
//日志记录
|
||||
IMTLogFactory.reservation(iUser, logContent);
|
||||
IMTLogFactory.reservation(iUser, logContent,"1");
|
||||
}
|
||||
//预约后延迟领取耐力值
|
||||
getEnergyAwardDelay(iUser);
|
||||
}
|
||||
@@ -229,10 +235,10 @@ public class IMTServiceImpl implements IMTService {
|
||||
String energyAward = getEnergyAward(iUser);
|
||||
logContent += "[申购耐力值]:" + energyAward;
|
||||
} catch (Exception e) {
|
||||
logContent += "执行报错--[申购耐力值]:" + e.getMessage();
|
||||
logContent += "执行报错--[申购耐力值],错误原因:" + e.getMessage();
|
||||
}
|
||||
//日志记录
|
||||
IMTLogFactory.reservation(iUser, logContent);
|
||||
IMTLogFactory.reservation(iUser, logContent,"2");
|
||||
}
|
||||
};
|
||||
new Thread(runnable).start();
|
||||
@@ -310,13 +316,13 @@ public class IMTServiceImpl implements IMTService {
|
||||
String logContent = "";
|
||||
try {
|
||||
String s = travelReward(iUser);
|
||||
logContent += "[获得旅行奖励]:" + s;
|
||||
logContent += "[获得旅行奖励]:成功!";
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
logContent += "执行报错--[获得旅行奖励]:" + e.getMessage();
|
||||
logContent += "执行报错--[获得旅行奖励],错误原因:" + e.getMessage();
|
||||
}
|
||||
//日志记录
|
||||
IMTLogFactory.reservation(iUser, logContent);
|
||||
IMTLogFactory.reservation(iUser, logContent,"3");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -568,7 +574,7 @@ public class IMTServiceImpl implements IMTService {
|
||||
// 预约时间在24小时内的
|
||||
if (item.getInteger("status") == 2 && DateUtil.between(item.getDate("reservationTime"), new Date(), DateUnit.HOUR) < 24) {
|
||||
String logContent = DateUtil.formatDate(item.getDate("reservationTime")) + " 申购" + item.getString("itemName") + "成功";
|
||||
IMTLogFactory.reservation(iUser, logContent);
|
||||
IMTLogFactory.reservation(iUser, logContent,"4");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -668,5 +674,46 @@ public class IMTServiceImpl implements IMTService {
|
||||
return md5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean login(IUser iUser) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
String mobile = iUser.getMobile();
|
||||
String code = iUser.getCode();
|
||||
String deviceId = iUser.getDeviceId();
|
||||
map.put("mobile", mobile);
|
||||
map.put("vCode", code);
|
||||
|
||||
final long curTime = System.currentTimeMillis();
|
||||
map.put("md5", signature(mobile + code + "" + "", curTime));
|
||||
|
||||
map.put("timestamp", String.valueOf(curTime));
|
||||
map.put("MT-APP-Version", getMTVersion());
|
||||
|
||||
HttpRequest request = HttpUtil.createRequest(Method.POST,
|
||||
"https://app.moutai519.com.cn/xhr/front/user/register/login");
|
||||
IUser user = iUserMapper.selectIUserByMobile(mobile);
|
||||
if (user != null) {
|
||||
deviceId = user.getDeviceId();
|
||||
}
|
||||
request.header("MT-Device-ID", deviceId);
|
||||
request.header("MT-APP-Version", getMTVersion());
|
||||
request.header("User-Agent", "iOS;16.3;Apple;?unrecognized?");
|
||||
request.header("Content-Type", "application/json");
|
||||
|
||||
HttpResponse execute = request.body(JSONObject.toJSONString(map)).execute();
|
||||
|
||||
JSONObject body = JSONObject.parseObject(execute.body());
|
||||
|
||||
if (body.getString("code").equals("2000")) {
|
||||
// logger.info("「登录请求-成功」" + body.toJSONString());
|
||||
iUserService.insertIUser(iUser, body);
|
||||
return true;
|
||||
} else {
|
||||
logger.error("「登录请求-失败」" + body.toJSONString());
|
||||
throw new ServiceException("登录失败,本地错误日志已记录");
|
||||
// return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import com.ruoyi.common.core.utils.RedisCache;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.invest.domain.*;
|
||||
import com.ruoyi.invest.domain.dto.IShopDto;
|
||||
import com.ruoyi.invest.domain.vo.ICityVo;
|
||||
import com.ruoyi.invest.domain.vo.IDistrictVo;
|
||||
import com.ruoyi.invest.domain.vo.IProvinceVo;
|
||||
import com.ruoyi.invest.domain.vo.IShopVo;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.invest.mapper.IShopMapper;
|
||||
@@ -174,6 +177,7 @@ public class IShopServiceImpl implements IShopService {
|
||||
for (Object obj : itemList) {
|
||||
JSONObject item = (JSONObject) obj;
|
||||
IItem iItem = new IItem(item);
|
||||
iItem.setItemId(IdWorker.getId());
|
||||
iItemMapper.insertIItem(iItem);
|
||||
}
|
||||
|
||||
@@ -359,4 +363,44 @@ public class IShopServiceImpl implements IShopService {
|
||||
{
|
||||
return iShopMapper.selectIShopByIShopId(iShopId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表
|
||||
*/
|
||||
@Override
|
||||
public List<IProvinceVo> selectProvinceVoList(IShopDto iShopDto)
|
||||
{
|
||||
return iShopMapper.selectProvinceVoList(iShopDto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表
|
||||
*/
|
||||
@Override
|
||||
public List<ICityVo> selectCityVoList(IShopDto iShopDto)
|
||||
{
|
||||
return iShopMapper.selectCityVoList(iShopDto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询门店列表列表
|
||||
*
|
||||
* @param iShopDto 门店列表
|
||||
* @return 门店列表
|
||||
*/
|
||||
@Override
|
||||
public List<IDistrictVo> selectDistrictVoList(IShopDto iShopDto)
|
||||
{
|
||||
return iShopMapper.selectDistrictVoList(iShopDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,13 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import com.ruoyi.invest.domain.IShop;
|
||||
import com.ruoyi.invest.domain.IUser;
|
||||
import com.ruoyi.invest.domain.dto.IUserDto;
|
||||
import com.ruoyi.invest.domain.vo.IItemVo;
|
||||
import com.ruoyi.invest.domain.vo.IUserVo;
|
||||
import com.ruoyi.invest.mapper.IItemMapper;
|
||||
import com.ruoyi.invest.mapper.IShopMapper;
|
||||
import com.ruoyi.invest.mapper.IUserMapper;
|
||||
import com.ruoyi.invest.service.IUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -23,6 +27,12 @@ public class IUserServiceImpl implements IUserService {
|
||||
@Autowired
|
||||
private IUserMapper iUserMapper;
|
||||
|
||||
@Autowired
|
||||
private IShopMapper iShopMapper;
|
||||
|
||||
@Autowired
|
||||
private IItemMapper iItemMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public int insertIUser(String mobile, String deviceId, JSONObject jsonObject) {
|
||||
@@ -38,7 +48,26 @@ public class IUserServiceImpl implements IUserService {
|
||||
user.setCookie(result.getString("cookie"));
|
||||
user.setDeviceId( deviceId.toLowerCase());
|
||||
user.setJsonResult(StringUtils.substring(jsonObject.toJSONString(), 0, 2000));
|
||||
user.setRemark(result.getString("userName"));
|
||||
user.setUserName(result.getString("userName"));
|
||||
|
||||
|
||||
IShop iShop = iShopMapper.selectIShopByIShopId(user.getIshopId());
|
||||
if(iShop!=null) {
|
||||
user.setLng(iShop.getLng());
|
||||
user.setLat(iShop.getLat());
|
||||
user.setProvinceName(iShop.getProvinceName());
|
||||
user.setCityName(iShop.getCityName());
|
||||
user.setDistrictName(iShop.getDistrictName());
|
||||
user.setAddress(iShop.getAddress());
|
||||
}
|
||||
String[] items = user.getItemCode().split("@");
|
||||
|
||||
String itemName = "";
|
||||
for (String itemId : items) {
|
||||
IItemVo item=iItemMapper.selectIItemByItemCode(itemId);
|
||||
itemName+=item.getTitle()+"("+itemId+")、";
|
||||
}
|
||||
user.setItemName(itemName.substring(0,itemName.length()-1));
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 30);
|
||||
@@ -62,7 +91,25 @@ public class IUserServiceImpl implements IUserService {
|
||||
iUser.setCookie(result.getString("cookie"));
|
||||
iUser.setDeviceId( deviceId.toLowerCase());
|
||||
iUser.setJsonResult(StringUtils.substring(jsonObject.toJSONString(), 0, 2000));
|
||||
iUser.setRemark(result.getString("userName"));
|
||||
iUser.setUserName(result.getString("userName"));
|
||||
|
||||
IShop iShop = iShopMapper.selectIShopByIShopId(iUser.getIshopId());
|
||||
if(iShop!=null) {
|
||||
iUser.setLng(iShop.getLng());
|
||||
iUser.setLat(iShop.getLat());
|
||||
iUser.setProvinceName(iShop.getProvinceName());
|
||||
iUser.setCityName(iShop.getCityName());
|
||||
iUser.setDistrictName(iShop.getDistrictName());
|
||||
iUser.setAddress(iShop.getAddress());
|
||||
}
|
||||
String[] items = iUser.getItemCode().split("@");
|
||||
|
||||
String itemName = "";
|
||||
for (String itemId : items) {
|
||||
IItemVo item=iItemMapper.selectIItemByItemCode(itemId);
|
||||
itemName+=item.getTitle()+"("+itemId+")、";
|
||||
}
|
||||
iUser.setItemName(itemName.substring(0,itemName.length()-1));
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 30);
|
||||
@@ -102,6 +149,7 @@ public class IUserServiceImpl implements IUserService {
|
||||
if (StringUtils.isEmpty(iUser.getDeviceId())) {
|
||||
iUser.setDeviceId(UUID.randomUUID().toString().toLowerCase());
|
||||
}
|
||||
|
||||
iUser.setCreateUser(SecurityUtils.getUserId());
|
||||
iUser.setCreateBy(SecurityUtils.getUsername());
|
||||
iUser.setCreateTime(new Date());
|
||||
@@ -128,7 +176,7 @@ public class IUserServiceImpl implements IUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteIUser(Long[] iUserId) {
|
||||
public int deleteIUser(String[] iUserId) {
|
||||
return iUserMapper.deleteIUserByMobiles(iUserId);
|
||||
}
|
||||
|
||||
@@ -143,4 +191,49 @@ public class IUserServiceImpl implements IUserService {
|
||||
{
|
||||
return iUserMapper.selectIUserList(iUserDto);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insertIUser(IUser iUser, JSONObject jsonObject) {
|
||||
String deviceId=iUser.getDeviceId();
|
||||
if (StringUtils.isEmpty(deviceId)) {
|
||||
deviceId = UUID.randomUUID().toString().toLowerCase();
|
||||
}
|
||||
JSONObject result = jsonObject.getJSONObject("data");
|
||||
iUser.setUserId(result.getString("userId"));
|
||||
iUser.setToken(result.getString("token"));
|
||||
iUser.setCookie(result.getString("cookie"));
|
||||
iUser.setDeviceId( deviceId.toLowerCase());
|
||||
iUser.setJsonResult(StringUtils.substring(jsonObject.toJSONString(), 0, 2000));
|
||||
iUser.setUserName(result.getString("userName"));
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 30);
|
||||
Date thirtyDaysLater = calendar.getTime();
|
||||
iUser.setExpireTime(thirtyDaysLater);
|
||||
|
||||
IShop iShop = iShopMapper.selectIShopByIShopId(iUser.getIshopId());
|
||||
if(iShop!=null) {
|
||||
iUser.setLng(iShop.getLng());
|
||||
iUser.setLat(iShop.getLat());
|
||||
iUser.setProvinceName(iShop.getProvinceName());
|
||||
iUser.setCityName(iShop.getCityName());
|
||||
iUser.setDistrictName(iShop.getDistrictName());
|
||||
iUser.setAddress(iShop.getAddress());
|
||||
}
|
||||
String[] items = iUser.getItemCode().split("@");
|
||||
|
||||
String itemName = "";
|
||||
for (String itemId : items) {
|
||||
IItemVo item=iItemMapper.selectIItemByItemCode(itemId);
|
||||
itemName+=item.getTitle()+"("+itemId+")、";
|
||||
}
|
||||
iUser.setItemName(itemName.substring(0,itemName.length()-1));
|
||||
iUser.setCreateUser(SecurityUtils.getUserId());
|
||||
iUser.setCreateBy(SecurityUtils.getUsername());
|
||||
iUser.setCreateTime(new Date());
|
||||
|
||||
return iUserMapper.insertIUser(iUser);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="title" column="title" />
|
||||
<result property="content" column="content" />
|
||||
<result property="picture" column="picture" />
|
||||
<result property="pictureV2" column="picture_v2" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIItemVo">
|
||||
select a.item_id, a.item_code, a.title, a.content, a.picture, a.create_time from i_item a
|
||||
select a.item_id, a.item_code, a.title, a.content, a.picture, a.picture_v2, a.create_time from i_item a
|
||||
</sql>
|
||||
|
||||
<select id="selectIItemList" parameterType="IItemDto" resultMap="IItemResult">
|
||||
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="content != null">content,</if>
|
||||
<if test="pictureV2 != null">picture_v2,</if>
|
||||
<if test="picture != null">picture,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
@@ -48,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="content != null">#{content},</if>
|
||||
<if test="pictureV2 != null">#{pictureV2},</if>
|
||||
<if test="picture != null">#{picture},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
@@ -60,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="content != null">content = #{content},</if>
|
||||
<if test="picture != null">picture = #{picture},</if>
|
||||
<if test="pictureV2 != null">picture_v2 = #{pictureV2},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where item_id = #{itemId}
|
||||
@@ -88,4 +92,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="truncateItem" >
|
||||
TRUNCATE TABLE i_item
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectIItemByItemCode" parameterType="String" resultMap="IItemResult">
|
||||
<include refid="selectIItemVo"/>
|
||||
where a.item_code = #{itemCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="createUser" column="create_user" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="type" column="type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectILogVo">
|
||||
select a.log_id, a.mobile, a.log_content, a.status, a.oper_time, a.create_user, a.create_by from i_log a
|
||||
select a.log_id, a.mobile, a.log_content, a.status, a.oper_time, a.create_user, a.create_by, a.type, a.create_time from i_log a
|
||||
</sql>
|
||||
|
||||
<select id="selectILogList" parameterType="ILogDto" resultMap="ILogResult">
|
||||
@@ -25,9 +27,12 @@
|
||||
<if test="mobile != null and mobile != ''"> and a.mobile like '%'|| #{mobile}||'%'</if>
|
||||
<if test="logContent != null and logContent != ''"> and a.log_content like '%'|| #{logContent}||'%'</if>
|
||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||
<if test="type != null and type != ''"> and a.type = #{type}</if>
|
||||
<if test="operTime != null "> and a.oper_time = #{operTime}</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.oper_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectILogByLogId" parameterType="Long" resultMap="ILogResult">
|
||||
@@ -45,6 +50,8 @@
|
||||
<if test="operTime != null">oper_time,</if>
|
||||
<if test="createUser != null">create_user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="logId != null">#{logId},</if>
|
||||
@@ -54,6 +61,8 @@
|
||||
<if test="operTime != null">#{operTime},</if>
|
||||
<if test="createUser != null">#{createUser},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -66,6 +75,8 @@
|
||||
<if test="operTime != null">oper_time = #{operTime},</if>
|
||||
<if test="createUser != null">create_user = #{createUser},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where log_id = #{logId}
|
||||
</update>
|
||||
|
||||
@@ -16,10 +16,16 @@
|
||||
<result property="name" column="name" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="openStartTime" column="open_start_time" />
|
||||
<result property="openEndTime" column="open_end_time" />
|
||||
<result property="address" column="address" />
|
||||
<result property="city" column="city" />
|
||||
<result property="district" column="district" />
|
||||
<result property="province" column="province" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIShopVo">
|
||||
select a.shop_id, a.i_shop_id, a.province_name, a.city_name, a.district_name, a.full_address, a.lat, a.lng, a.name, a.tenant_name, a.create_time from i_shop a
|
||||
select a.shop_id, a.i_shop_id, a.open_start_time, a.open_end_time, a.address, a.city, a.district, a.province, a.province_name, a.city_name, a.district_name, a.full_address, a.lat, a.lng, a.name, a.tenant_name, a.create_time from i_shop a
|
||||
</sql>
|
||||
|
||||
<select id="selectIShopList" parameterType="IShopDto" resultMap="IShopResult">
|
||||
@@ -27,10 +33,15 @@
|
||||
<where>
|
||||
a.del_flag='0'
|
||||
<if test="iShopId != null and iShopId != ''"> and a.i_shop_id = #{iShopId}</if>
|
||||
<if test="address != null and address != ''"> and a.address like '%'|| #{address}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and a.tenant_name like '%'|| #{tenantName}||'%'</if>
|
||||
<if test="name != null and name != ''"> and a.name like '%'|| #{name}||'%'</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
@@ -54,6 +65,12 @@
|
||||
<if test="name != null">name,</if>
|
||||
<if test="tenantName != null">tenant_name,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="openStartTime != null">open_start_time,</if>
|
||||
<if test="openEndTime != null">open_end_time,</if>
|
||||
<if test="address != null">address,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="district != null">district,</if>
|
||||
<if test="province != null">province,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="shopId != null">#{shopId},</if>
|
||||
@@ -67,6 +84,12 @@
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="tenantName != null">#{tenantName},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="openStartTime != null">#{openStartTime},</if>
|
||||
<if test="openEndTime != null">#{openEndTime},</if>
|
||||
<if test="address != null">#{address},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="district != null">#{district},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -83,6 +106,12 @@
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="openStartTime != null">open_start_time = #{openStartTime},</if>
|
||||
<if test="openEndTime != null">open_end_time = #{openEndTime},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="district != null">district = #{district},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
</trim>
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
@@ -113,7 +142,7 @@
|
||||
</update>
|
||||
|
||||
<insert id="batchInsertIShop">
|
||||
insert into i_shop(shop_id, i_shop_id, province_name, city_name, district_name, full_address, lat, lng, name, tenant_name, create_time) values
|
||||
insert into i_shop(shop_id, i_shop_id, province_name, city_name, district_name, full_address, lat, lng, name, tenant_name, create_time, open_end_time, open_start_time, address, city, district, province) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.shopId},
|
||||
#{item.iShopId},
|
||||
@@ -125,7 +154,13 @@
|
||||
#{item.lng},
|
||||
#{item.name},
|
||||
#{item.tenantName},
|
||||
#{item.createTime})
|
||||
#{item.createTime},
|
||||
#{item.openEndTime},
|
||||
#{item.openStartTime},
|
||||
#{item.address},
|
||||
#{item.city},
|
||||
#{item.district},
|
||||
#{item.province})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -133,4 +168,68 @@
|
||||
<include refid="selectIShopVo"/>
|
||||
where a.i_shop_id = #{iShopId}
|
||||
</select>
|
||||
|
||||
<select id="selectProvinceVoList" parameterType="IShopDto" resultType="com.ruoyi.invest.domain.vo.IProvinceVo">
|
||||
select
|
||||
distinct
|
||||
a.province_name as provinceName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.province_name desc
|
||||
</select>
|
||||
|
||||
<select id="selectCityVoList" parameterType="IShopDto" resultType="com.ruoyi.invest.domain.vo.ICityVo">
|
||||
select
|
||||
distinct
|
||||
a.city_name as cityName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
and a.city_name != ''
|
||||
and a.city_name is not null
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.city_name desc
|
||||
</select>
|
||||
|
||||
<select id="selectDistrictVoList" parameterType="IShopDto" resultType="com.ruoyi.invest.domain.vo.IDistrictVo">
|
||||
select
|
||||
distinct
|
||||
a.district_name as districtName
|
||||
from
|
||||
i_shop a
|
||||
<where>
|
||||
a.province_name != ''
|
||||
and a.province_name is not null
|
||||
and a.city_name != ''
|
||||
and a.city_name is not null
|
||||
and a.district_name != ''
|
||||
and a.district_name is not null
|
||||
<if test="province != null and province != ''"> and a.province = #{province}</if>
|
||||
<if test="provinceName != null and provinceName != ''"> and a.province_name like '%'|| #{provinceName}||'%'</if>
|
||||
<if test="city != null and city != ''"> and a.city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and a.district = #{district}</if>
|
||||
<if test="cityName != null and cityName != ''"> and a.city_name like '%'|| #{cityName}||'%'</if>
|
||||
<if test="districtName != null and districtName != ''"> and a.district_name like '%'|| #{districtName}||'%'</if>
|
||||
|
||||
</where>
|
||||
order by a.district_name desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -30,10 +30,13 @@
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateUser" column="update_user" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="districtName" column="district_name" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="itemName" column="item_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectIUserVo">
|
||||
select a.mobile, a.user_id, a.token, a.cookie, a.device_id, a.item_code, a.ishop_id, a.province_name, a.city_name, a.address, a.lat, a.lng, a.minute, a.shop_type, a.random_minute, a.push_plus_token, a.json_result, a.remark, a.expire_time, a.del_flag, a.create_time, a.create_user, a.update_time, a.update_user, a.create_by from i_user a
|
||||
select a.mobile, a.user_id,a.district_name,a.user_name,a.item_name, a.token, a.cookie, a.device_id, a.item_code, a.ishop_id, a.province_name, a.city_name, a.address, a.lat, a.lng, a.minute, a.shop_type, a.random_minute, a.push_plus_token, a.json_result, a.remark, a.expire_time, a.del_flag, a.create_time, a.create_user, a.update_time, a.update_user, a.create_by from i_user a
|
||||
</sql>
|
||||
|
||||
<select id="selectIUserList" parameterType="IUserDto" resultMap="IUserResult">
|
||||
@@ -60,6 +63,8 @@
|
||||
<if test="createUser != null and createUser != ''"> and a.create_user = #{createUser}</if>
|
||||
<if test="updateUser != null and updateUser != ''"> and a.update_user = #{updateUser}</if>
|
||||
</where>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
@@ -96,6 +101,9 @@
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateUser != null">update_user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="districtName != null">district_name,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="mobile != null">#{mobile},</if>
|
||||
@@ -123,6 +131,9 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateUser != null">#{updateUser},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="districtName != null">#{districtName},</if>
|
||||
<if test="userName != null">#{createBy},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -153,6 +164,9 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateUser != null">update_user = #{updateUser},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="districtName != null">district_name = #{districtName},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
</trim>
|
||||
where mobile = #{mobile}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user