Merge remote-tracking branch 'origin/master'
| | |
| | | package com.jilongda.manage.authority.controller; |
| | | |
| | | import com.jilongda.manage.authority.dto.LoginDTO; |
| | | import com.jilongda.manage.authority.model.SecUser; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.jilongda.manage.utils.MsgUtils; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.Constant; |
| | |
| | | private final RedisAutoTemplate redisAutoTemplate; |
| | | private final MsgUtils msgUtils; |
| | | private final SecUserService secUserService; |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | |
| | | @Autowired |
| | | public LoginController(AuthenticationManager authenticationManager, SecurityUtils securityUtils, PasswordEncoder passwordEncoder, RedisAutoTemplate redisAutoTemplate, MsgUtils msgUtils, SecUserService secUserService) { |
| | |
| | | // 先检验是否登录 |
| | | String username = loginDto.getAccount(); |
| | | String password = loginDto.getPassword(); |
| | | // 超级管理员不做校验 |
| | | if (!username.equals("admin")){ |
| | | SecUser user = secUserService.lambdaQuery().eq(SecUser::getAccount, username).one(); |
| | | TStore store = storeService.getById(user.getStoreId()); |
| | | if (store==null){ |
| | | return ApiResult.failed(500, "门店不存在"); |
| | | } |
| | | if (store.getStatus() == 2){ |
| | | return ApiResult.failed(500, "门店已被禁用"); |
| | | } |
| | | } |
| | | try { |
| | | Map<String, Object> token = securityUtils.login(username, password, authenticationManager, SecurityUserDetails.class, 1); |
| | | return ApiResult.success(token); |
| | |
| | | import com.jilongda.manage.vo.TInventoryVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "镜架-根据品牌id查询对应库存") |
| | | @PostMapping(value = "/getCountByBrandId") |
| | | public ApiResult getCountByBrandId(Integer id) { |
| | | @GetMapping(value = "/getCountByBrandId") |
| | | public ApiResult getCountByBrandId(Integer id,Integer storeId) { |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getBrandId, id) |
| | | .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty())collect.add(-1); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) |
| | | .eq(TFrameGoods::getStoreId,storeId) |
| | | .list(); |
| | | if (list.isEmpty())return ApiResult.success("0"); |
| | | int i = 0; |
| | | for (TFrameGoods tFrameGoods : list) { |
| | |
| | | return ApiResult.success(i); |
| | | } |
| | | @ApiOperation(value = "镜架-根据材质id查询对应库存") |
| | | @PostMapping(value = "/getCountByMaterialId") |
| | | public ApiResult getCountByMaterialId(Integer id) { |
| | | @GetMapping(value = "/getCountByMaterialId") |
| | | public ApiResult getCountByMaterialId(Integer id,Integer storeId) { |
| | | List<Integer> collect = modelService.lambdaQuery().eq(TModel::getMaterialId, id) |
| | | .list().stream().map(TModel::getId).distinct().collect(Collectors.toList()); |
| | | if (collect.isEmpty())collect.add(-1); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect).list(); |
| | | List<TFrameGoods> list = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect). |
| | | eq(TFrameGoods::getStoreId,storeId).list(); |
| | | if (list.isEmpty())return ApiResult.success("0"); |
| | | int i = 0; |
| | | for (TFrameGoods tFrameGoods : list) { |
| | |
| | | .list().stream().map(TModel::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty())collect.add(-1); |
| | | TFrameGoods one = frameGoodsService.lambdaQuery().in(TFrameGoods::getModelId, collect) |
| | | .eq(TFrameGoods::getStoreId,getCurrentByParam.getStoreId()) |
| | | .eq(TFrameGoods::getColor, getCurrentByParam.getColor()).one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | |
| | | public ApiResult<Integer> getCurrentByParamLens(@RequestBody GetCurrentByParamLens dto) { |
| | | TLensGoods one = lensGoodsService.lambdaQuery().in(TLensGoods::getSeriesId, dto.getSeriesId()) |
| | | .eq(dto.getLensType()!=null,TLensGoods::getLensType, dto.getLensType()) |
| | | .eq(dto.getRefractiveIndex()!=null,TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) |
| | | .eq(dto.getBallMirror()!=null,TLensGoods::getBallMirror, dto.getBallMirror()) |
| | | .eq(dto.getColumnMirror()!=null,TLensGoods::getColumnMirror, dto.getColumnMirror()) |
| | | .eq(StringUtils.hasLength(dto.getRefractiveIndex()),TLensGoods::getRefractiveIndex, dto.getRefractiveIndex()) |
| | | .eq(StringUtils.hasLength(dto.getBallMirror()),TLensGoods::getBallMirror, dto.getBallMirror()) |
| | | .eq(StringUtils.hasLength(dto.getColumnMirror()),TLensGoods::getColumnMirror, dto.getColumnMirror()) |
| | | .eq(dto.getStoreId()!=null,TLensGoods::getStoreId, dto.getStoreId()) |
| | | .one(); |
| | | if (one!=null){ |
| | | return ApiResult.success(one.getTotal()); |
| | |
| | | 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.model.TOptometrist; |
| | | import com.jilongda.manage.query.TOptometristQuery; |
| | | import com.jilongda.manage.query.TicketQuery; |
| | |
| | | public class TOptometristController { |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private SecUserService secUserService; |
| | | |
| | | @ApiOperation(value = "验光师列表") |
| | | @PostMapping(value = "/pageList") |
| | |
| | | if (count>0){ |
| | | return ApiResult.failed("当前号码已存在"); |
| | | } |
| | | List<SecUser> list = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()).list(); |
| | | if (!list.isEmpty())return ApiResult.failed("当前号码在员工管理已存在"); |
| | | optometristService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | |
| | | if (count>0){ |
| | | return ApiResult.failed("当前号码已存在"); |
| | | } |
| | | List<SecUser> list = secUserService.lambdaQuery().eq(SecUser::getPhone, dto.getPhone()).list(); |
| | | if (!list.isEmpty())return ApiResult.failed("当前号码在员工管理已存在"); |
| | | optometristService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | |
| | | @ApiOperation(value = "订单售后添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TOrderAftersales dto) { |
| | | List<TOrderAftersales> list = orderAftersalesService.lambdaQuery() |
| | | .eq(TOrderAftersales::getOrderId, dto.getOrderId()).list(); |
| | | if (!list.isEmpty()){ |
| | | return ApiResult.failed("该订单已售后,不可再次操作!"); |
| | | } |
| | | dto.setCode(WarehousingConstant.ASTER_SALES+ CodeGenerateUtils.generateVolumeSn()); |
| | | orderAftersalesService.save(dto); |
| | | return ApiResult.success(); |
| | |
| | | List<Integer> collect1 = orderGoodsService.lambdaQuery() |
| | | .eq(StringUtils.hasLength(query.getBrandLens()), TOrderGoods::getBrandName, query.getBrandLens()) |
| | | .eq(StringUtils.hasLength(query.getSeries()), TOrderGoods::getSeriesName, query.getSeries()) |
| | | .eq((query.getType() != null), TOrderGoods::getType, query.getType()) |
| | | .eq(query.getType() != null, TOrderGoods::getType, query.getType()) |
| | | .eq(StringUtils.hasLength(query.getRefractiveIndex()), TOrderGoods::getRefractiveIndex, query.getRefractiveIndex()).list() |
| | | .stream().map(TOrderGoods::getOrderId).collect(Collectors.toList()); |
| | | if (StringUtils.hasLength(query.getBrandLens())||StringUtils.hasLength(query.getSeries())||query.getType() != null|| |
| | |
| | | @ApiModelProperty(value = "系列") |
| | | @TableField("series") |
| | | private String series; |
| | | @ApiModelProperty(value = "品牌") |
| | | @TableField("brand") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "1球面 2非球面 3双非") |
| | | @TableField("type") |
| | |
| | | @ApiModelProperty(value = "验光师id") |
| | | private Integer optometristId; |
| | | @ApiModelProperty(value = "用户id") |
| | | @NotNull(message = "用户id不能为空") |
| | | private Integer userId; |
| | | @ApiModelProperty(value = "开始时间 前端忽略") |
| | | private String startTime; |
| | |
| | | private List<Integer> userIds; |
| | | @ApiModelProperty(value = "订单ids 前端忽略") |
| | | private List<Integer> orderIds; |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer userId; |
| | | } |
| | |
| | | tFrameWarehousingDetailVO.setStoreName(store.getName()); |
| | | } |
| | | } |
| | | // tFrameWarehousingDetailVO.setStatus(); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | |
| | | private String store; |
| | | @ApiModelProperty(value = "镜片盘点明细") |
| | | private List<TInventoryLensDetail> lensList; |
| | | @ApiModelProperty(value = "镜片盘点明细") |
| | | @ApiModelProperty(value = "镜架盘点明细") |
| | | private List<TInventoryFrameDetail> frameList; |
| | | } |
| | |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.manage.vo.TFrameWarehousingDetailVO"> |
| | | select tfwd.id, tfwd.warehousingId, tfwd.brand, tfwd.supplier, tfwd.material, tfwd.total, tfwd.color, tfwd.model, tfwd.code, tfwd.createTime, |
| | | tfwd.updateTime, tfwd.createBy, tfwd.updateBy, tfwd.isDelete, tfwd.modelId,tw.storeId |
| | | tfwd.updateTime, tfwd.createBy, tfwd.updateBy, tfwd.isDelete, tfwd.modelId,tw.storeId,tw.status |
| | | from t_frame_warehousing_detail tfwd |
| | | left join t_warehousing tw on tfwd.warehousingId = tw.id |
| | | <where> |
| | |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and t1.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.storeId != null and query.storeId != ''"> |
| | | <if test="query.storeId != null "> |
| | | and t1.storeId = #{query.storeId} |
| | | </if> |
| | | <if test="query.optometristId != null and query.optometristId != ''"> |
| | | <if test="query.optometristId != null "> |
| | | and t1.optometristId = #{query.optometristId} |
| | | </if> |
| | | <if test="query.userId != null "> |
| | | and t1.userId = #{query.userId} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime!=''"> |
| | | and (t1.createTime between #{query.startTime} and #{query.endTime}) |
| | | </if> |
| | |
| | | and orderMoney between #{query.startMoney} and #{query.endMoney} |
| | | </if> |
| | | <if test="query.realName != null and query.realName != ''"> |
| | | and `name` like concat('%',#{query.realName},'%') |
| | | and realName like concat('%',#{query.realName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.storeId != null"> |
| | | and storeId = #{query.storeId} |
| | | </if> |
| | | <if test="query.sysId != null"> |
| | | and sysId = #{query.sysId} |
| | | </if> |
| | | <if test="query.userId != null"> |
| | | and userId = #{query.userId} |
| | | </if> |
| | | <if test="query.userIds != null and query.userIds.size()>0"> |
| | | AND userId IN |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | order by createTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.jilongda.optometrist.authority.model.SecUser; |
| | | import com.jilongda.optometrist.authority.service.SecUserService; |
| | | import com.jilongda.optometrist.model.TOptometrist; |
| | | import com.jilongda.optometrist.model.TStore; |
| | | import com.jilongda.optometrist.security.SecurityUserDetails; |
| | | import com.jilongda.optometrist.service.TOptometristService; |
| | | import com.jilongda.optometrist.service.TStoreService; |
| | | import com.jilongda.optometrist.utils.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private final SecUserService secUserService; |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | |
| | | @Autowired |
| | | public LoginController(AuthenticationManager authenticationManager, SecurityUtils securityUtils, PasswordEncoder passwordEncoder, RedisAutoTemplate redisAutoTemplate, MsgUtils msgUtils, SecUserService secUserService) { |
| | |
| | | if (two!=null){ |
| | | return ApiResult.failed(500, "账号已被禁用"); |
| | | } |
| | | TStore store = storeService.getById(one.getStoreId()); |
| | | if (store.getStatus()==2){ |
| | | return ApiResult.failed(500, "门店已被禁用"); |
| | | } |
| | | // 先检验是否登录 |
| | | String phone = dto.getPhone(); |
| | | String code = dto.getCode(); |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | tOptometristVO.setStoreName(byId1.getName()); |
| | | tOptometristVO.setName(byId.getName()); |
| | | tOptometristVO.setPhone(byId.getPhone()); |
| | | Date start = new Date(); |
| | | Date end = new Date(); |
| | | // 获取今日凌晨00:00:00和今日23:59:59 |
| | | start.setHours(0); |
| | | start.setMinutes(0); |
| | | start.setSeconds(0); |
| | | end.setHours(23); |
| | | end.setMinutes(59); |
| | | end.setSeconds(59); |
| | | int size = optometryService.lambdaQuery().eq(TOptometry::getOptometristId, userId) |
| | | .between(TOptometry::getCreateTime, start, end) |
| | | .eq(TOptometry::getStatus, 3).list().size(); |
| | | tOptometristVO.setOptometryCount(size); |
| | | // 查询今日的排号列表 |