Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes
| | |
| | | package com.jilongda.applet.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.jilongda.applet.model.TCoupon; |
| | | import com.jilongda.applet.model.TCouponReceive; |
| | | import com.jilongda.applet.query.TCouponQuery; |
| | | import com.jilongda.applet.service.TCouponReceiveService; |
| | | import com.jilongda.applet.service.TCouponService; |
| | | import com.jilongda.applet.service.TStoreService; |
| | | import com.jilongda.applet.utils.LoginInfoUtil; |
| | | import com.jilongda.applet.vo.TCouponReceiveVO; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "优惠券记录") |
| | | @RestController |
| | | @RequestMapping("/t-coupon-receive") |
| | | public class TCouponReceiveController { |
| | | |
| | | @Autowired |
| | | private TCouponReceiveService tCouponReceiveService; |
| | | @Autowired |
| | | private TCouponService couponService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @ApiOperation(value = "优惠券列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult pageList(@RequestBody TCouponQuery query) { |
| | | Integer userId = loginInfoUtil.getUserId(); |
| | | query.setUserId(userId); |
| | | PageInfo<TCouponReceiveVO> page = tCouponReceiveService.pageList(query); |
| | | return ApiResult.success(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "扫码领取优惠券;优惠券id") |
| | | @GetMapping(value = "/getCoupons") |
| | | public ApiResult getCoupons(@RequestParam Integer id) { |
| | | Integer userId = loginInfoUtil.getUserId(); |
| | | |
| | | // 查询优惠券信息 |
| | | TCoupon coupon = couponService.getById(id); |
| | | if(Objects.isNull(coupon)){ |
| | | return ApiResult.failed("优惠券不存在"); |
| | | } |
| | | |
| | | TCouponReceive tCouponReceive = new TCouponReceive(); |
| | | tCouponReceive.setUserId(userId); |
| | | tCouponReceive.setCouponId(id); |
| | | tCouponReceive.setType(4); |
| | | tCouponReceive.setAmount(coupon.getAmount()); |
| | | tCouponReceive.setStoreId(coupon.getStoreId()); |
| | | tCouponReceive.setEndTime(LocalDateTime.now().plusDays(coupon.getTime())); |
| | | tCouponReceive.setAmountCondition(coupon.getAmountCondition()); |
| | | tCouponReceive.setStatus(1); |
| | | tCouponReceiveService.save(tCouponReceive); |
| | | return ApiResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.jilongda.applet.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.applet.model.TOptometrist; |
| | | import com.jilongda.applet.model.TOptometry; |
| | | import com.jilongda.applet.model.TOptometryDetail; |
| | | import com.jilongda.applet.model.TStore; |
| | | import com.jilongda.applet.query.TOptometryQuery; |
| | | import com.jilongda.applet.service.TOptometristService; |
| | | import com.jilongda.applet.service.TOptometryDetailService; |
| | | import com.jilongda.applet.service.TOptometryService; |
| | | import com.jilongda.applet.service.TStoreService; |
| | | import com.jilongda.applet.utils.LoginInfoUtil; |
| | | import com.jilongda.applet.vo.TOptometryVO; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "验光单") |
| | | @RestController |
| | | @RequestMapping("/t-optometry") |
| | | public class TOptometryController { |
| | | |
| | | @Autowired |
| | | private TOptometryService tOptometryService; |
| | | @Autowired |
| | | private TOptometryDetailService optometryDetailService; |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private TStoreService storeService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | |
| | | @ApiOperation(value = "视光档案") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult pageList(@RequestBody TOptometryQuery query) { |
| | | Integer userId = loginInfoUtil.getUserId(); |
| | | query.setUserId(userId); |
| | | PageInfo<TOptometryVO> tOptometryVOPageInfo = tOptometryService.pageList(query); |
| | | return ApiResult.success(tOptometryVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "视光档案详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult getDetailById(@RequestParam Integer id) { |
| | | TOptometry optometry = tOptometryService.getById(id); |
| | | TOptometryVO tOptometryVO = new TOptometryVO(); |
| | | BeanUtils.copyProperties(optometry, tOptometryVO); |
| | | TOptometrist optometrist = optometristService.getById(optometry.getOptometristId()); |
| | | if(Objects.nonNull(optometrist)){ |
| | | tOptometryVO.setOptometristName(optometry.getName()); |
| | | } |
| | | TStore store = storeService.getById(optometry.getStoreId()); |
| | | if(Objects.nonNull(store)){ |
| | | tOptometryVO.setStoreName(store.getName()); |
| | | } |
| | | |
| | | List<TOptometryDetail> list = optometryDetailService.list(Wrappers.<TOptometryDetail>lambdaQuery().eq(TOptometryDetail::getOptometryId, id)); |
| | | List<TOptometryDetail> completeCorrectionList = new ArrayList<>(); |
| | | List<TOptometryDetail> prescriptionGlassesList = new ArrayList<>(); |
| | | List<TOptometryDetail> oldMirrorInformationList = new ArrayList<>(); |
| | | for (TOptometryDetail tOptometryDetail : list) { |
| | | switch (tOptometryDetail.getType()){ |
| | | case 1: |
| | | prescriptionGlassesList.add(tOptometryDetail); |
| | | break; |
| | | case 2: |
| | | completeCorrectionList.add(tOptometryDetail); |
| | | break; |
| | | default: |
| | | oldMirrorInformationList.add(tOptometryDetail); |
| | | break; |
| | | } |
| | | } |
| | | tOptometryVO.setCompleteCorrectionList(completeCorrectionList); |
| | | tOptometryVO.setPrescriptionGlassesList(prescriptionGlassesList); |
| | | tOptometryVO.setOldMirrorInformationList(oldMirrorInformationList); |
| | | return ApiResult.success(tOptometryVO); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.jilongda.applet.model.TCouponReceive; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.applet.query.TCouponQuery; |
| | | import com.jilongda.applet.vo.TCouponReceiveVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCouponReceiveMapper extends BaseMapper<TCouponReceive> { |
| | | |
| | | /** |
| | | * 分页查询优惠券领取记录 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCouponReceiveVO> pageList(@Param("query") TCouponQuery query, @Param("pageInfo")PageInfo<TCouponReceiveVO> pageInfo); |
| | | |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TOptometry; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.applet.query.TOptometryQuery; |
| | | import com.jilongda.applet.vo.TOptometryVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOptometryMapper extends BaseMapper<TOptometry> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOptometryVO> pageList(@Param("query") TOptometryQuery query, @Param("pageInfo")PageInfo<TOptometryVO> pageInfo); |
| | | |
| | | } |
| | |
| | | import com.jilongda.applet.query.TStoreQuery; |
| | | import com.jilongda.applet.vo.TStoreVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Mapper |
| | | public interface TStoreMapper extends BaseMapper<TStore> { |
| | | |
| | | List<TStoreVO> pageList(@Param("query")TStoreQuery query, @Param("pageInfo")PageInfo<TStoreVO> pageInfo); |
| | |
| | | @TableField("amount") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "门店id 字段为null表示全部") |
| | | @ApiModelProperty(value = "门店id 字段为null表示全部,逗号分隔") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = "有效期(天)最高365") |
| | | @TableField("time") |
| | |
| | | @TableField("amount") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "门店id 字段为null表示全部") |
| | | @ApiModelProperty(value = "门店id 字段为null表示全部,逗号分隔") |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = "有效期截止日期") |
| | | @TableField("endTime") |
New file |
| | |
| | | package com.jilongda.applet.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "优惠券查询参数") |
| | | public class TCouponQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "用户id 前端忽略") |
| | | private Integer userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.applet.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单查询") |
| | | public class TOptometryQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "用户id 前端忽略") |
| | | private Integer userId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TCouponReceive; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.applet.query.TCouponQuery; |
| | | import com.jilongda.applet.vo.TCouponReceiveVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCouponReceiveService extends IService<TCouponReceive> { |
| | | |
| | | /** |
| | | * 优惠券列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TCouponReceiveVO> pageList(TCouponQuery query); |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TOptometry; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.applet.query.TOptometryQuery; |
| | | import com.jilongda.applet.vo.TOptometryVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOptometryService extends IService<TOptometry> { |
| | | |
| | | /** |
| | | * 视光档案 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOptometryVO> pageList(TOptometryQuery query); |
| | | } |
| | |
| | | package com.jilongda.applet.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.applet.mapper.TStoreMapper; |
| | | import com.jilongda.applet.model.TCouponReceive; |
| | | import com.jilongda.applet.mapper.TCouponReceiveMapper; |
| | | import com.jilongda.applet.model.TStore; |
| | | import com.jilongda.applet.query.TCouponQuery; |
| | | import com.jilongda.applet.service.TCouponReceiveService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.applet.service.TStoreService; |
| | | import com.jilongda.applet.vo.TCouponReceiveVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TCouponReceiveServiceImpl extends ServiceImpl<TCouponReceiveMapper, TCouponReceive> implements TCouponReceiveService { |
| | | |
| | | @Autowired |
| | | private TStoreMapper storeMapper; |
| | | @Override |
| | | public PageInfo<TCouponReceiveVO> pageList(TCouponQuery query) { |
| | | PageInfo<TCouponReceiveVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCouponReceiveVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (TCouponReceiveVO tCouponReceiveVO : list) { |
| | | if(StringUtils.hasLength(tCouponReceiveVO.getStoreId())){ |
| | | List<TStore> tStores = storeMapper.selectList(Wrappers.lambdaQuery(TStore.class) |
| | | .in(TStore::getId, Arrays.asList(tCouponReceiveVO.getStoreId().split(",")))); |
| | | tCouponReceiveVO.setStoreName(tStores.stream().map(TStore::getName).reduce((a, b) -> a + "," + b).orElse("")); |
| | | }else { |
| | | tCouponReceiveVO.setStoreName("全部门店"); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TOptometry; |
| | | import com.jilongda.applet.mapper.TOptometryMapper; |
| | | import com.jilongda.applet.query.TOptometryQuery; |
| | | import com.jilongda.applet.service.TOptometryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.applet.vo.TOptometryVO; |
| | | import com.jilongda.applet.vo.TStoreVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TOptometryServiceImpl extends ServiceImpl<TOptometryMapper, TOptometry> implements TOptometryService { |
| | | |
| | | @Override |
| | | public PageInfo<TOptometryVO> pageList(TOptometryQuery query) { |
| | | PageInfo<TOptometryVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOptometryVO> list = this.baseMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | // 获取列表 |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.applet.vo; |
| | | |
| | | import com.jilongda.applet.model.TCouponReceive; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "优惠券领取VO") |
| | | public class TCouponReceiveVO extends TCouponReceive { |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.applet.vo; |
| | | |
| | | import com.jilongda.applet.model.TOptometry; |
| | | import com.jilongda.applet.model.TOptometryDetail; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单VO") |
| | | public class TOptometryVO extends TOptometry { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "验光师名称") |
| | | private String optometristName; |
| | | |
| | | @ApiModelProperty(value = "完全矫正") |
| | | private List<TOptometryDetail> completeCorrectionList; |
| | | |
| | | @ApiModelProperty(value = "配镜处方") |
| | | private List<TOptometryDetail> prescriptionGlassesList; |
| | | |
| | | @ApiModelProperty(value = "旧镜信息") |
| | | private List<TOptometryDetail> oldMirrorInformationList; |
| | | |
| | | } |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, couponId, userId, type, amount, storeId, endTime, amountCondition, status, createTime, updateTime, createBy, updateBy, isDelete |
| | | id, couponId, userId, `type`, amount, storeId, endTime, amountCondition, status, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.applet.vo.TCouponReceiveVO"> |
| | | select tcr.id, tcr.couponId, tcr.userId, tcr.`type`, tcr.amount, tcr.storeId, tcr.endTime, tcr.amountCondition, tcr.status, |
| | | tcr.createTime, tcr.updateTime, tcr.createBy, tcr.updateBy, tcr.isDelete,tc.name as couponName |
| | | from t_coupon_receive tcr |
| | | left join t_coupon tc on tc.id = tcr.couponId |
| | | <where> |
| | | <if test="query.userId != null"> |
| | | and tcr.userId = #{query.userId} |
| | | </if> |
| | | AND tcr.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tcr.status ASC,tcr.createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, userId, age, gender, name, phone, optometristId, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | id, code, userId, age, gender, `name`, phone, optometristId, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.applet.vo.TOptometryVO"> |
| | | select o.id, o.code, o.userId, o.age, o.gender, o.`name`, o.phone, o.optometristId, o.storeId, o.status, o.registerTime, |
| | | o.createTime, o.updateTime, o.createBy, o.updateBy, o.isDelete, |
| | | t.name as optometristName, s.name as storeName |
| | | from t_optometry o |
| | | left join t_optometrist t on o.optometristId = t.id |
| | | left join t_store s on o.storeId = s.id |
| | | <where> |
| | | <if test="query.userId != null"> |
| | | and o.userId = #{query.userId} |
| | | </if> |
| | | AND o.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY o.createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | @ApiOperation(value = "添加镜架出库,入库,作废,退货") |
| | | @PostMapping(value = "/outBound") |
| | | public ApiResult<String> outBound(@Validated @RequestBody TWarehousingDTO dto) { |
| | | public ApiResult<Integer> outBound(@Validated @RequestBody TWarehousingDTO dto) { |
| | | // 获取当前用户 |
| | | String username = JwtTokenUtils.getUsername(); |
| | | dto.setCreateBy(username); |
| | |
| | | detail.setCode(WarehousingConstant.OUT_BOUND+CodeGenerateUtils.generateVolumeSn()); |
| | | }); |
| | | frameWarehousingDetailService.saveBatch(frameWarehousingDetails); |
| | | return ApiResult.success(); |
| | | return ApiResult.success(dto.getId()); |
| | | } |
| | | /** |
| | | * 添加镜片出库,入库,作废,退货 |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 镜架/镜片出库入库表 |
| | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "1=出库,2=入库,3=作废,4=退货") |
| | | @NotNull(message = "状态不能为空") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "明细记录查询/出入库单Query") |
| | | @ApiModel(value = "明细记录查询出入库单Query") |
| | | public class TWarehousingDetailQuery extends TimeRangePageDTO { |
| | | |
| | | @ApiModelProperty(value = "品牌") |