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.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.applet.model.TOptometryDetail; |
| | | import com.jilongda.applet.model.TOrder; |
| | | import com.jilongda.applet.model.TStore; |
| | | import com.jilongda.applet.query.TOrderQuery; |
| | | import com.jilongda.applet.service.*; |
| | | import com.jilongda.applet.utils.LoginInfoUtil; |
| | | import com.jilongda.applet.vo.TOrderVO; |
| | | 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.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "销售订单") |
| | | @RestController |
| | | @RequestMapping("/t-order") |
| | | public class TOrderController { |
| | | |
| | | @Autowired |
| | | private TOrderService tOrderService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @Autowired |
| | | private TStoreService tStoreService; |
| | | @Autowired |
| | | private TOptometryDetailService optometryDetailService; |
| | | @ApiOperation(value = "查询订单列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult pageList(@RequestBody TOrderQuery query) { |
| | | Integer userId = loginInfoUtil.getUserId(); |
| | | query.setUserId(userId); |
| | | PageInfo<TOrderVO> pageInfo = tOrderService.pageList(query); |
| | | return ApiResult.success(pageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult getDetailById(@RequestParam Integer id) { |
| | | |
| | | TOrder order = tOrderService.getById(id); |
| | | TOrderVO tOrderVO = new TOrderVO(); |
| | | BeanUtils.copyProperties(order, tOrderVO); |
| | | // 查询门店 |
| | | TStore store = tStoreService.getById(order.getStoreId()); |
| | | if(Objects.nonNull(store)){ |
| | | tOrderVO.setStoreName(store.getName()); |
| | | } |
| | | // 查询配镜处方 |
| | | List<TOptometryDetail> list = optometryDetailService.list(Wrappers.lambdaQuery(TOptometryDetail.class) |
| | | .eq(TOptometryDetail::getOptometryId, order.getOptometryId())); |
| | | tOrderVO.setOptometryDetails(list); |
| | | |
| | | return ApiResult.success(tOrderVO); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.jilongda.applet.model.TOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.applet.query.TOrderQuery; |
| | | import com.jilongda.applet.vo.TOrderVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderMapper extends BaseMapper<TOrder> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TOrderVO> pageList(@Param("query") TOrderQuery query, @Param("pageInfo") PageInfo<TOrderVO> pageInfo); |
| | | } |
| | |
| | | @TableField("accountingTime") |
| | | private LocalDateTime accountingTime; |
| | | |
| | | @ApiModelProperty(value = "品牌id") |
| | | @TableField("brandId") |
| | | private Integer brandId; |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
| | | @TableField("brandName") |
| | | private String brandName; |
| | | |
| | | @ApiModelProperty(value = "系列名称") |
| | | @TableField("seriesName") |
| | | private String seriesName; |
| | | |
| | | @ApiModelProperty(value = "型号名称") |
| | | @TableField("modelName") |
| | | private String modelName; |
| | | |
| | | } |
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 TOrderQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "用户id 前端忽略") |
| | | private Integer userId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.applet.query.TOrderQuery; |
| | | import com.jilongda.applet.vo.TOrderVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOrderService extends IService<TOrder> { |
| | | |
| | | /** |
| | | * 查询订单列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TOrderVO> pageList(TOrderQuery query); |
| | | } |
| | |
| | | |
| | | import com.jilongda.applet.model.TOrder; |
| | | import com.jilongda.applet.mapper.TOrderMapper; |
| | | import com.jilongda.applet.query.TOrderQuery; |
| | | import com.jilongda.applet.service.TOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.applet.vo.TOrderVO; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService { |
| | | |
| | | @Override |
| | | public PageInfo<TOrderVO> pageList(TOrderQuery query) { |
| | | PageInfo<TOrderVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOrderVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.jilongda.applet.vo; |
| | | |
| | | import com.jilongda.common.model.TGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.License; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
New file |
| | |
| | | package com.jilongda.applet.vo; |
| | | |
| | | import com.jilongda.applet.model.TOptometryDetail; |
| | | import com.jilongda.applet.model.TOrder; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "订单VO") |
| | | public class TOrderVO extends TOrder { |
| | | |
| | | @ApiModelProperty(value = "型号名称") |
| | | private String modelName; |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "处方详情") |
| | | private List<TOptometryDetail> optometryDetails; |
| | | } |
| | |
| | | <result column="isAccounting" property="isAccounting" /> |
| | | <result column="accountingName" property="accountingName" /> |
| | | <result column="accountingTime" property="accountingTime" /> |
| | | <result column="brandId" property="brandId" /> |
| | | <result column="brandName" property="brandName" /> |
| | | <result column="seriesName" property="seriesName" /> |
| | | <result column="modelName" property="modelName" /> |
| | | </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,brandId,brandName,seriesName,modelName |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.applet.vo.TOrderVO"> |
| | | select t.id, t.code, t.userId, t.optometryId, t.storeId, t.modelId, t.color, t.series, t.rLens, t.lLens, t.`type`, t.refractiveIndex, |
| | | t.createTime, t.updateTime, t.createBy, t.updateBy, t.isDelete, t.sysId, t.couponId, t.itemsId, t.remark, t.isMail, t.mailName, |
| | | t.mailPhone, t.mailAddress, t.orderMoney, t.couponMoney, t.payMoney, t.isMachining, t.machiningCode, t.isAccounting, t.accountingName, |
| | | t.accountingTime,t.brandId,t.brandName,t.seriesName,t.modelName,ts.name as storeName |
| | | from t_order t |
| | | left join t_store ts on ts.id = t.storeId |
| | | <where> |
| | | <if test="query.userId != null"> |
| | | and t.userId = #{query.userId} |
| | | </if> |
| | | AND t.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY t.createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.jilongda.optometry.vo; |
| | | |
| | | import com.jilongda.common.model.TGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | package com.jilongda.optometry.vo.vo; |
| | | |
| | | import com.jilongda.common.model.TOrder; |
| | | import com.jilongda.common.model.TOrderGood; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |