| | |
| | | |
| | | } |
| | | |
| | | @Before("state()") |
| | | public void isfrozen(){ |
| | | |
| | | TAppUser loginUser = loginInfoUtil.getLoginUser(); |
| | | if (loginUser==null){ |
| | | throw new TokenException("当前账号已被删除"); |
| | | } |
| | | |
| | | if (loginUser.getStatus()==0){ |
| | | throw new TokenException("账号已冻结"); |
| | | } |
| | | |
| | | System.err.println("进入切面"); |
| | | |
| | | } |
| | | // @Before("state()") |
| | | // public void isfrozen(){ |
| | | // |
| | | // TAppUser loginUser = loginInfoUtil.getLoginUser(); |
| | | // if (loginUser==null){ |
| | | // throw new TokenException("当前账号已被删除"); |
| | | // } |
| | | // |
| | | // if (loginUser.getStatus()==0){ |
| | | // throw new TokenException("账号已冻结"); |
| | | // } |
| | | // |
| | | // System.err.println("进入切面"); |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | private RestTemplate wxRestTemplate; |
| | | |
| | | @ApiOperation(value = "通过code获得openid,获取用户信息",tags = {"微信小程序登录"}) |
| | | @PostMapping("/openIdByJsCode") |
| | | @PostMapping("openIdByJsCode") |
| | | public ApiResult<Map<String, Object>> openIdByJsCode(@RequestBody AppletUserEncrypteData data) { |
| | | log.info("<<<<<<<<换取openid开始<<<<<<<<:{}", data.getCode()); |
| | | WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig, redisAutoTemplate); |
| | | Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(data.getCode())); |
| | | String openid = body.getOpenid(); |
| | | String sessionKey = body.getSessionKey(); |
| | | if(!StringUtils.hasLength(data.getEncryptedData()) || !StringUtils.hasLength(data.getIv())){ |
| | | return ApiResult.failed("已拒绝授权",null); |
| | | } |
| | | AppletUserDecodeData appletUserDecodeData = WxUtils.encryptedData(data.getEncryptedData(), sessionKey, data.getIv()); |
| | | appletUserDecodeData.setOpenId(openid); |
| | | TAppUser appUser = appUserService.wxLogin(appletUserDecodeData); |
| | | Map<String, Object> tokenInfos = securityUtils.login(openid, appUser, authenticationManager, TAppUser.class, 3); |
| | | // WxAppletTools appletTools = new WxAppletTools(wxRestTemplate, wxConfig, redisAutoTemplate); |
| | | // Code2SessionRespBody body = appletTools.getOpenIdByJscode2session(new Code2SessionResqBody().build(data.getCode())); |
| | | // String openid = body.getOpenid(); |
| | | // String sessionKey = body.getSessionKey(); |
| | | // if(!StringUtils.hasLength(data.getEncryptedData()) || !StringUtils.hasLength(data.getIv())){ |
| | | // return ApiResult.failed("已拒绝授权",null); |
| | | // } |
| | | // AppletUserDecodeData appletUserDecodeData = WxUtils.encryptedData(data.getEncryptedData(), sessionKey, data.getIv()); |
| | | // appletUserDecodeData.setOpenId(openid); |
| | | // TAppUser appUser = appUserService.wxLogin(appletUserDecodeData); |
| | | TAppUser appUser = appUserService.getById(1); |
| | | Map<String, Object> tokenInfos = securityUtils.login(appUser.getOpenId(), appUser, authenticationManager, TAppUser.class, 3); |
| | | return ApiResult.success(tokenInfos); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "查询订单详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult getDetailById(@RequestParam Integer id) { |
| | | |
| | | TOrder order = tOrderService.getById(id); |
| | | TOrderVO tOrderVO = new TOrderVO(); |
| | | BeanUtils.copyProperties(order, tOrderVO); |
| | |
| | | @ApiModelProperty(value = "型号名称") |
| | | @TableField("modelName") |
| | | private String modelName; |
| | | @ApiModelProperty(value = "手动添加订单-用户姓名") |
| | | @TableField("realName") |
| | | private String realName; |
| | | @ApiModelProperty(value = "手动添加订单-用户手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | @ApiModelProperty(value = "手动添加订单-用户年龄") |
| | | @TableField("age") |
| | | private Integer age; |
| | | @ApiModelProperty(value = "手动添加订单-用户性别 1男2女") |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "地址") |
| | | @TableField("address") |
| | | private Integer address; |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | @TableField("lon") |
| | |
| | | |
| | | |
| | | public Integer getUserId(){ |
| | | String username = JwtTokenUtils.getUsername(); |
| | | TAppUser appUser = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", username).eq("isDelete",0)); |
| | | return appUser.getId(); |
| | | // String username = JwtTokenUtils.getUsername(); |
| | | // TAppUser appUser = appUserService.getOne(new QueryWrapper<TAppUser>().eq("openId", username).eq("isDelete",0)); |
| | | return 1; |
| | | } |
| | | |
| | | public TAppUser getLoginUser(){ |
| | |
| | | port: 9093 |
| | | tomcat: |
| | | max-swallow-size: 500MB |
| | | servlet: |
| | | context-path: /app |
| | | # servlet: |
| | | # context-path: /app |
| | | spring: |
| | | thymeleaf: |
| | | cache: false |
| | |
| | | </if> |
| | | from t_store |
| | | where isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | ORDER BY IFNULL(distance,0),createTime DESC |
| | | ORDER BY |
| | | <if test="query.lon != null and query.lon != '' and query.lat != null and query.lat != ''"> |
| | | IFNULL(distance,0), |
| | | </if> |
| | | createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | , "/api/v1/" |
| | | , "/druid/**" |
| | | , "/druid/**" |
| | | // , "/**" //开发时关闭身份认证 |
| | | , "/**" //开发时关闭身份认证 |
| | | , "/files/**" |
| | | , "/login" |
| | | , "/wx/wxLoginByCodeH5" //微信h5登录 |
| | |
| | | , "/code/login" |
| | | , "/sendCode" //当前H5用户端不采用security |
| | | ,"/pageResetPassword" |
| | | ,"/openIdByJsCode" |
| | | ,"/t-goods/getConfigById" |
| | | ,"/sendPassCode" |
| | | ,"/t-store/pageList" |
| | |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | | @ApiModelProperty("门店名称") |
| | | private String storeName; |
| | | |
| | | |
| | | } |
| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.authority.model.SecUser; |
| | | import com.jilongda.manage.authority.service.SecUserService; |
| | | import com.jilongda.manage.dto.TOrderDTO; |
| | | import com.jilongda.manage.model.TCoupon; |
| | | import com.jilongda.manage.model.TCouponReceive; |
| | | import com.jilongda.manage.model.TOptometryDetail; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.service.*; |
| | | import com.jilongda.manage.utils.LoginInfoUtil; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "") |
| | | @Api(tags = "销售订单") |
| | | @RestController |
| | | @RequestMapping("/t-order") |
| | | public class TOrderController { |
| | | |
| | | @Autowired |
| | | private TAppUserService tAppUserService; |
| | | @Autowired |
| | | private SecUserService secUserService; |
| | | @Autowired |
| | | private TCouponReceiveService couponReceiveService; |
| | | @Autowired |
| | | private TCouponService couponService; |
| | | |
| | | @ApiOperation(value = "查询用户信息") |
| | | @GetMapping(value = "/getUserById") |
| | | public ApiResult getUserById(@RequestParam Integer userId) { |
| | | return ApiResult.success(tAppUserService.getById(userId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询员工信息") |
| | | @GetMapping(value = "/getStaffList") |
| | | public ApiResult getStaffList() { |
| | | List<SecUser> list = secUserService.list(Wrappers.lambdaQuery(SecUser.class) |
| | | .eq(SecUser::getUserType, 3) |
| | | .eq(SecUser::getIsDelete, 0)); |
| | | return ApiResult.success(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询优惠券") |
| | | @GetMapping(value = "/getCouponListByUserId") |
| | | public ApiResult<List<TCoupon>> getCouponListByUserId(@RequestParam Integer userId, @RequestParam Integer storeId) { |
| | | List<TCouponReceive> list = couponReceiveService.list(Wrappers.lambdaQuery(TCouponReceive.class) |
| | | .eq(TCouponReceive::getUserId, userId) |
| | | .eq(TCouponReceive::getStatus, 1)); |
| | | List<TCouponReceive> tCouponReceives = new ArrayList<>(); |
| | | for (TCouponReceive tCouponReceive : list) { |
| | | if (StringUtils.hasLength(tCouponReceive.getStoreId())){ |
| | | if (Arrays.asList(tCouponReceive.getStoreId().split(",")).contains(storeId+"")){ |
| | | tCouponReceives.add(tCouponReceive); |
| | | } |
| | | }else{ |
| | | // 通用 |
| | | tCouponReceives.add(tCouponReceive); |
| | | } |
| | | } |
| | | List<Integer> collect = list.stream().map(TCouponReceive::getCouponId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | collect.add(-1); |
| | | } |
| | | List<TCoupon> list1 = couponService.lambdaQuery().in(TCoupon::getId, collect).list(); |
| | | return ApiResult.success(list1); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加订单") |
| | | @PostMapping(value = "/addOrder") |
| | | public ApiResult addOrder(@RequestBody TOrderDTO dto) { |
| | | |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.jilongda.manage.dto; |
| | | |
| | | import com.jilongda.manage.model.TOrder; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "添加订单dto") |
| | | public class TOrderDTO extends TOrder { |
| | | |
| | | // @ApiModelProperty(value = "配镜处方") |
| | | // private |
| | | |
| | | } |
| | |
| | | package com.jilongda.manage.mapper; |
| | | |
| | | import com.jilongda.manage.model.TOptometry; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.manage.model.TOptometry; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "核算时间") |
| | | @TableField("accountingTime") |
| | | private LocalDateTime accountingTime; |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | @TableField("realName") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "年龄") |
| | | @TableField("age") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty(value = "性别1男2女3保密") |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单查询参数") |
| | | public class TOptometryQuery extends BasePage { |
| | |
| | | @ApiModelProperty(value = "验光师id") |
| | | private Integer optometristId; |
| | | @ApiModelProperty(value = "用户id") |
| | | @NotNull(message = "用户id不能为空") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "开始时间 前端忽略") |
| | | private String startTime; |
| | |
| | | package com.jilongda.manage.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TOptometry; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TOptometry; |
| | | import com.jilongda.manage.mapper.TOptometryMapper; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.service.TOptometryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import com.jilongda.manage.vo.TSupplierVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 验光单 服务实现类 |
| | |
| | | su.`password`, |
| | | su.phone, |
| | | su.state, |
| | | su.roleType, |
| | | su.userType, |
| | | su.last_login_time AS lastLoginTime, su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, |
| | | su.birthday, su.gender,sr.id AS roleId,sr.rolename AS rolename,su.deptId,su.userType,su.provinceCode, su.cityCode, su.areaCode,su.pictures |
| | | su.birthday, su.gender,sr.id AS roleId,sr.rolename AS rolename,su.deptId,su.userType,su.provinceCode, su.cityCode, su.areaCode,su.pictures, |
| | | s.name AS storeName |
| | | FROM sec_user su |
| | | LEFT JOIN sec_user_role sur ON su.id = sur.user_id |
| | | LEFT JOIN sec_role sr ON sur.role_id = sr.id |
| | | LEFT JOIN t_store s ON su.storeId = s.id |
| | | <where> |
| | | <if test="dto.nickName != null and dto.nickName != ''"> |
| | | AND su.nick_name LIKE concat('%', #{dto.nickName,jdbcType=VARCHAR}, '%') |
| | |
| | | <result column="realName" property="realName" /> |
| | | <result column="age" property="age" /> |
| | | <result column="gender" property="gender" /> |
| | | <result column="registerTime" property="registerTime" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="createBy" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, phone, realName, age, gender, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | id, name, phone, realName, age, gender, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.manage.vo.TAppUserVO"> |
| | | select * from |
| | |
| | | <result column="isAccounting" property="isAccounting" /> |
| | | <result column="accountingName" property="accountingName" /> |
| | | <result column="accountingTime" property="accountingTime" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="realName" property="realName" /> |
| | | <result column="age" property="age" /> |
| | | <result column="gender" property="gender" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, userId, optometryId, storeId, modelId, color, series, rLens, lLens, type, refractiveIndex, createTime, updateTime, createBy, updateBy, isDelete, sysId, couponId, itemsId, remark, isMail, mailName, mailPhone, mailAddress, orderMoney, couponMoney, payMoney, isMachining, machiningCode, isAccounting, accountingName, accountingTime |
| | | id, code, userId, optometryId, storeId, modelId, color, series, rLens, lLens, type, refractiveIndex, createTime, updateTime, createBy, |
| | | updateBy, isDelete, sysId, couponId, itemsId, remark, isMail, mailName, mailPhone, mailAddress, orderMoney, couponMoney, payMoney, |
| | | isMachining, machiningCode, isAccounting, accountingName, accountingTime,phone, realName, age, gender |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | su.`password`, |
| | | su.phone, |
| | | su.state, |
| | | su.roleType, |
| | | su.userType, |
| | | su.last_login_time AS lastLoginTime, su.nick_name AS nickName, su.avatar_url AS avatarUrl, su.province, su.city, su.area, su.address, |
| | | su.birthday, su.gender,sr.id AS roleId,sr.rolename AS rolename,su.deptId,su.userType,su.provinceCode, su.cityCode, su.areaCode,su.pictures |
| | | FROM sec_user su |