Merge remote-tracking branch 'origin/master'
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单_详细") |
| | | @ApiOperation(value = "订单_详细",response = ComShopOrderPageVO.class) |
| | | @GetMapping("/order/detail") |
| | | @ShopOperLog(operType = 11) |
| | | public R detail(@RequestParam("orderId") Long orderId){ |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_统计信息") |
| | | @GetMapping("/stat") |
| | | @GetMapping("/capital/stat") |
| | | public R stat(){ |
| | | return communityService.getFundsStat(getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_分页列表") |
| | | @PostMapping("/page") |
| | | @PostMapping("/capital/page") |
| | | public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO){ |
| | | pageComShopFundsSearchDTO.setUserId(getUserId()); |
| | | ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO); |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_详情",response = CapitalDetailVO.class) |
| | | @ApiImplicitParam(name = "id",value = "订单Id") |
| | | @GetMapping("/order/capitalDetailByStore") |
| | | R capitalDetailByStore(@RequestParam("id") Long id){ |
| | | return communityService.capitalDetailByStore(id); |
| | | @ApiImplicitParam(name = "orderId",value = "订单Id") |
| | | @GetMapping("/capital/capitalDetailByStore") |
| | | R capitalDetailByStore(@RequestParam("orderId") Long orderId){ |
| | | return communityService.capitalDetailByStore(orderId); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "资金_导出表格") |
| | | @PostMapping("/export") |
| | | @PostMapping("/capital/export") |
| | | @ShopOperLog(operType = 12) |
| | | public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO); |
| | |
| | | @ApiModel("商城店铺") |
| | | public class PageShopStoreVO { |
| | | |
| | | @ApiModelProperty("负责人") |
| | | @ApiModelProperty("商家、联系人") |
| | | private String contacts; |
| | | |
| | | @ApiModelProperty("店铺登陆账号") |
| | |
| | | <version>${feign-httpclient.version}</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | |
| | | @Select("<script> " + |
| | | " SELECT sys_user_id,\n" + |
| | | " sum(case when abt.days = DATE_FORMAT(NOW(),'%Y%m%d') then abt.t END) AS todayTotal,\n" + |
| | | " sum(case when abt.days = DATE_FORMAT(NOW(),'%Y%u') then abt.t END) AS weekTotal,\n" + |
| | | " sum(case when abt.days = DATE_FORMAT(NOW(),'%Y%m') then abt.t END) AS monthTotal\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%m%d') THEN abt.t END), 0) AS todayTotal,\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%u') THEN abt.t END), 0) AS weekTotal,\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%m') THEN abt.t END), 0) AS monthTotal\n" + |
| | | "FROM (\n" + |
| | | "SELECT ss.sys_user_id, (sr.pay_amount) AS t , DATE_FORMAT(sr.pay_time,'%Y%m%d') days\n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t , DATE_FORMAT(sr.pay_time,'%Y%m%d') days\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')\n" + |
| | | "<if test='userId!=null'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY days\n" + |
| | | "UNION \n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%u') weeks\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%u') = DATE_FORMAT(NOW(),'%Y%u')\n" + |
| | | "<if test='userId!=null'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY weeks\n" + |
| | | "UNION \n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%m') months\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m') = DATE_FORMAT(NOW(),'%Y%m')\n" + |
| | | "<if test='userId!=null'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY months\n" + |
| | | ") abt\n" + |
| | | "GROUP BY abt.sys_user_id "+ |
| | | "</script>") |
| | | ComShopFundsVO queryStatis(Long userId); |
| | | ComShopFundsVO queryStatis(@Param("userId") Long userId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT sr.id, sr.total_amount, sr.pay_time, sr.order_no, \n" + |
| | |
| | | public interface ComShopStoreDAO extends BaseMapper<ComShopStoreDO> { |
| | | |
| | | @Select("<script>" + |
| | | "select id,`name`,store_account,classify_id,logo,phone,delivery_type,remark,`status`,sale,sale_volume,store_detail,create_at from com_shop_store c" + |
| | | "select id,`name`,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`,sale,sale_volume,store_detail,create_at from com_shop_store c" + |
| | | " <where>" + |
| | | "<if test='pageComShopStoreDTO.contacts != null and pageComShopStoreDTO.contacts.trim() != ""'>" + |
| | | "and c.contacts like concat('%',#{pageComShopStoreDTO.contacts},'%') \n" + |
| | |
| | | |
| | | @Override |
| | | public R deleteStore(Long[] id) { |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | storeDO.setDeleteStatus(2); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getId, id); |
| | | int update = this.baseMapper.update(storeDO, query); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().in(ComShopStoreDO::getId, id); |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(query); |
| | | comShopStoreDO.setDeleteStatus(2); |
| | | int update = this.baseMapper.updateById(comShopStoreDO); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | <name>shop_backstage</name> |
| | | <description>商家后台</description> |
| | | |
| | | |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/funs") |
| | | @Api(tags = {"商家后台", "资金管理"}) |
| | | @Api(tags = {"资金管理"}) |
| | | public class FundsApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/goods") |
| | | @Api(tags = {"商家后台", "商品管理"}) |
| | | @Api(tags = {"商品管理"}) |
| | | public class GoodsApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/log") |
| | | @Api(tags = {"商家后台", "操作日志"}) |
| | | @Api(tags = {"操作日志"}) |
| | | public class LogApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/") |
| | | @Api(tags = {"商家后台", "登录"}) |
| | | @Api(tags = {"登录"}) |
| | | public class LoginApi extends BaseController { |
| | | @Resource |
| | | private TokenService tokenService; |
| | |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.common.model.vos.shop.ComShopOrderPageVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @Api(tags = {"商家后台", "订单管理"}) |
| | | @Api(tags = {"订单管理"}) |
| | | public class OrderApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | return communityService.finishDeliverOrder(deliverDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单详细") |
| | | @ApiOperation(value = "订单详细",response = ComShopOrderPageVO.class) |
| | | @GetMapping("/detail") |
| | | @ShopOperLog(operType = 11) |
| | | public R detail(@RequestParam("orderId") Long orderId){ |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.netflix.zuul.filters.Route; |
| | | import org.springframework.cloud.netflix.zuul.filters.RouteLocator; |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | |
| | | import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | |
| | | import static java.util.stream.Collectors.collectingAndThen; |
| | |
| | | @Override |
| | | public List<SwaggerResource> get() { |
| | | List resources = new ArrayList(); |
| | | List<Route> routes = routeLocator.getRoutes(); |
| | | routes = routes.stream().collect( |
| | | collectingAndThen( |
| | | toCollection(() -> new TreeSet<>(Comparator.comparing(Route::getId))), ArrayList::new) |
| | | ); |
| | | //通过RouteLocator获取路由配置,遍历获取所配置服务的接口文档,这样不需要手动添加,实现动态获取 |
| | | List<String>stringList= Arrays.asList(ids); |
| | | for (Route route: routes) { |
| | | String id = route.getId(); |
| | | boolean contains = stringList.contains(id); |
| | | String fullPath = route.getFullPath(); |
| | | String s = fullPath.replaceFirst("/api", ""); |
| | | String s1 = s.replaceFirst("/" + id, ""); |
| | | if (contains) { |
| | | resources.add(swaggerResource(id,s1.replace("**", "v2/api-docs"),"1.0")); |
| | | } |
| | | } |
| | | Arrays.asList(ids).forEach(id->{ |
| | | resources.add(swaggerResource(id, MessageFormat.format("/api/{0}/v2/api-docs", id), "1.0")); |
| | | }); |
| | | return resources; |
| | | } |
| | | |