yanghui
2022-11-17 521ce664622bcde916ed53d53a1d84e799717d5c
Merge branch 'local_20221104' into huacheng_test
3个文件已修改
189 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientGoodsCategoryMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -1,5 +1,7 @@
package com.panzhihua.applets.api;
import cn.hutool.core.util.StrUtil;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO;
import com.panzhihua.common.model.dtos.shop.*;
@@ -33,6 +35,8 @@
    @Resource
    private CommunityService communityService;
    @Resource
    private CheckService checkService;
    @ApiOperation(value = "查询便民服务商家详情", response = ConvenientMerchantVO.class)
@@ -217,6 +221,13 @@
    @ApiOperation(value = "保存评价")
    @PostMapping("/saveEvaluate")
    public R saveEvaluate(@RequestBody ComShopFlowerEvaluateDTO comShopFlowerEvaluateDTO) {
        String evaluateContent = comShopFlowerEvaluateDTO.getEvaluateContent();
        if (StrUtil.isNotBlank(evaluateContent)) {
            String result = checkService.checkMessageBy(evaluateContent,this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        return communityService.saveEvaluate(comShopFlowerEvaluateDTO);
    }
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -27,7 +27,7 @@
 * @describe 商城管理
 */
@Slf4j
@Api(tags = {"商城管理模块"})
@Api(tags = {"花城商城管理模块"})
@RestController("/shopFlower")
public class ShopFlowerApi extends BaseController {
    @Value("${excel.userurl}")
@@ -121,179 +121,5 @@
    public R detail(@RequestParam("orderId") Long orderId) {
        return communityService.orderDetailFlower(orderId);
    }
    /*@ApiOperation(value = "订单_导出表格")
    @PostMapping("/order/export")
    @ShopOperLog(operType = 12)
    public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO) {
        ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO);
        String url = excelUrl;
        String uuid = UUID.randomUUID().toString().replace("-", "");
        // String name=uuid+".xlsx";
        String ftpUrl = "/mnt/data/web/excel/";
        R r = communityService.shopOrderExportData(comShopOrderExportDTO);
        if (R.isOk(r)) {
            List<ExcelShopOrderDTO> excelShopOrderDTO =
                JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopOrderDTO.class);
            if (excelShopOrderDTO == null || excelShopOrderDTO.size() == 0) {
                return R.ok("未找到数据");
            }
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                String name = "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class)
                            .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                            .registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("订单").build();
                        excelWriter.write(excelShopOrderDTO, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(url + URLEncoder.encode(name, "UTF-8"));
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        return R.fail("导出数据失败");
    }
    @ApiOperation(value = "资金_统计信息")
    @GetMapping("/capital/stat")
    public R stat() {
        Long userId = 0L;
        return communityService.getFundsStat(userId);
    }
    @ApiOperation(value = "资金_分页列表")
    @PostMapping("/capital/page")
    public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO) {
        pageComShopFundsSearchDTO.setUserId(getUserId());
        ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO);
        return communityService.pageShopFunds(pageComShopFundsSearchDTO);
    }
    @ApiOperation(value = "资金_详情", response = CapitalDetailVO.class)
    @ApiImplicitParam(name = "orderId", value = "订单Id")
    @GetMapping("/capital/capitalDetailByStore")
    R capitalDetailByStore(@RequestParam("orderId") Long orderId) {
        return communityService.capitalDetailByStore(orderId);
    }
    @ApiOperation(value = "资金_导出表格")
    @PostMapping("/capital/export")
    @ShopOperLog(operType = 12)
    public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO) {
        ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO);
        String url = excelUrl;
        String uuid = UUID.randomUUID().toString().replace("-", "");
        // String name=uuid+".xlsx";
        String ftpUrl = "/mnt/data/web/excel/";
        Long userId = this.getUserId();
        comShopFundsExportDTO.setUserId(userId);
        R r = communityService.shopOrderFundsExportData(comShopFundsExportDTO);
        if (R.isOk(r)) {
            List<ExcelShopFundsDTO> excelShopFundsDTO =
                JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopFundsDTO.class);
            if (excelShopFundsDTO == null || excelShopFundsDTO.size() == 0) {
                return R.ok("未找到数据");
            }
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                String name = "商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class)
                            .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                            .registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("订单").build();
                        excelWriter.write(excelShopFundsDTO, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(url + URLEncoder.encode(name, "UTF-8"));
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        return R.fail("导出数据失败");
    }
    @ApiOperation(value = "商家配置修改")
    @PutMapping("/shop/conf")
    public R editConf(@RequestBody ComShopSysConfDTO comShopSysConfDTO) {
        return communityService.editShopSysConf(comShopSysConfDTO);
    }
    @ApiOperation(value = "商家配置查询", response = ComShopHiddenConfVO.class)
    @GetMapping("/shop/conf")
    public R getConf() {
        PageComShopSysConfDTO pageComShopSysConfDTO = new PageComShopSysConfDTO();
        R r = communityService.pageShopSysConf(pageComShopSysConfDTO);
        if (R.isOk(r) && r.getData() != null) {
            ComShopSysConfVO comShopSysConfVO =
                JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ComShopSysConfVO.class);
            if (comShopSysConfVO != null) {
                ComShopHiddenConfVO comShopHiddenConfVO = new ComShopHiddenConfVO();
                comShopHiddenConfVO.setId(comShopSysConfVO.getId());
                comShopHiddenConfVO.setHidden(comShopSysConfVO.getVal());
                return R.ok(comShopHiddenConfVO);
            }
        }
        return r;
    }*/
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientGoodsCategoryMapper.xml
@@ -25,7 +25,7 @@
            resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientGoodsCategoryVO">
        SELECT
        <include refid="Base_Column_List"/>
        FROM com_convenient_service_categories
        FROM com_convenient_goods_categories
        WHERE is_del = 0
        <if test="pageConvenientGoodsCategoryDTO.name != null and pageConvenientGoodsCategoryDTO.name.trim() != &quot;&quot;">
            AND `name` LIKE concat('%', #{pageConvenientGoodsCategoryDTO.name}, '%' )