puhanshu
2022-01-17 161e27e08b1495c04cd3f35906c1d7dd873f1d60
商业街bug修改
11个文件已修改
98 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/MicroCommercialStreetApi.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsGameDAO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsGameService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsEvaluateMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsGameMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsVerifiedRecordMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/ConvenientApi.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -8235,4 +8235,11 @@
     */
    @GetMapping("/microcommercialstreet/product/get")
    R getMcsProduct(@RequestParam("productId") Long productId);
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
     * @return
     */
    @GetMapping("/microcommercialstreet/endStatusForMcsGame")
    R endStatusForMcsGame();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/MicroCommercialStreetApi.java
@@ -613,4 +613,13 @@
    public R getMcsProduct(@RequestParam("productId") Long productId) {
        return mcsProductService.getMcsProduct(productId);
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
     * @return
     */
    @GetMapping("/endStatusForMcsGame")
    public R endStatusForMcsGame() {
        return mcsGameService.endStatusForMcsGame();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsGameDAO.java
@@ -101,4 +101,10 @@
     * @return
     */
    Integer setOffByMerchantIds(@Param("needDealIds") List<Long> needDealIds);
    /**
     * 获取需要处理的到期数据
     * @return
     */
    List<McsGame> selectNeedDealExpire();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsGameService.java
@@ -103,4 +103,10 @@
     * @return
     */
    R getMcsGame(Long gameId);
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
     * @return
     */
    R endStatusForMcsGame();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java
@@ -11,15 +11,9 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.service_community.dao.McsEvaluateDAO;
import com.panzhihua.service_community.entity.McsCoupon;
import com.panzhihua.service_community.util.NearbyUtil;
import com.panzhihua.service_community.util.QRCodeUtil;
import com.spatial4j.core.shape.Rectangle;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -30,16 +24,22 @@
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.service_community.dao.McsCouponDAO;
import com.panzhihua.service_community.dao.McsEvaluateDAO;
import com.panzhihua.service_community.dao.McsGameDAO;
import com.panzhihua.service_community.dao.McsMerchantDAO;
import com.panzhihua.service_community.entity.McsCoupon;
import com.panzhihua.service_community.entity.McsGame;
import com.panzhihua.service_community.entity.McsMerchant;
import com.panzhihua.service_community.service.McsGameService;
import org.springframework.transaction.annotation.Transactional;
import com.panzhihua.service_community.util.NearbyUtil;
import com.panzhihua.service_community.util.QRCodeUtil;
import com.spatial4j.core.shape.Rectangle;
/**
 * (McsGame)表服务实现类
@@ -451,6 +451,20 @@
        return R.ok(mcsGameVO);
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
     * @return
     */
    @Override
    public R endStatusForMcsGame() {
        List<McsGame> games = this.baseMapper.selectNeedDealExpire();
        if (nonNull(games) && !games.isEmpty()) {
            games.forEach(e -> e.setStatus(McsGame.Status.yjs));
            this.updateBatchById(games);
        }
        return R.ok();
    }
    public static void main(String[] args) {
        int total = 500;
        int people = 10;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsEvaluateMapper.xml
@@ -47,14 +47,14 @@
        </if>
        <if test="pageMcsEvaluateDTO.keyword != null and pageMcsEvaluateDTO.keyword != &quot;&quot;">
            AND (
            t3.nick_name LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%')
            t3.`name` LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%')
            OR t3.phone LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%')
            )
        </if>
    </select>
    <select id="getMcsEvaluate"
            resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO">
        SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.nick_name, t3.phone, t2.`name` AS gameName
        SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.`name` AS nickName, t3.phone, t2.`name` AS gameName
        FROM mcs_evaluate t1
        LEFT JOIN mcs_game t2 ON t1.game_id = t2.id
        LEFT JOIN sys_user t3 ON t1.user_id = t3.user_id
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsGameMapper.xml
@@ -166,6 +166,9 @@
        LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id
        WHERE t1.id = #{gameId}
    </select>
    <select id="selectNeedDealExpire" resultType="com.panzhihua.service_community.entity.McsGame">
        SELECT * FROM mcs_game WHERE expire_at &lt;= NOW() AND `status` != 4
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsVerifiedRecordMapper.xml
@@ -48,9 +48,9 @@
            AND t1.verified_at &lt;= #{pageVerifyRecordDTO.verifiedEnd}
        </if>
        <if test="pageVerifyRecordDTO.keyword != null and pageVerifyRecordDTO.keyword != &quot;&quot;">
            AND (t1.nick_name LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            OR t1.coupon_id LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            OR t1.`name` LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            AND (t1.nick_name LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%')
            OR t1.coupon_id LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%')
            OR t1.`name` LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%')
            )
        </if>
    </select>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -2825,12 +2825,13 @@
                .eq(SysUserDO::getPhone, mcsMerchantDTO.getPhone()).eq(SysUserDO::getType, 11));
        String encode = new BCryptPasswordEncoder().encode(mcsMerchantDTO.getPassword());
        if (nonNull(sysUserDO)) {
            BeanUtils.copyProperties(mcsMerchantDTO, sysUserDO);
            sysUserDO.setAccount(mcsMerchantDTO.getAccount());
            sysUserDO.setStatus(mcsMerchantDTO.getAccountStatus());
            sysUserDO.setPhone(mcsMerchantDTO.getPhone());
            sysUserDO.setPassword(encode);
            sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword());
            sysUserDO.setImageUrl(mcsMerchantDTO.getLogo());
            sysUserDO.setName(mcsMerchantDTO.getName());
            userDao.updateById(sysUserDO);
            McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO();
            BeanUtils.copyProperties(sysUserDO, loginUserInfoVO);
@@ -2846,6 +2847,7 @@
        sysUserDO.setPhone(mcsMerchantDTO.getPhone());
        sysUserDO.setPassword(encode);
        sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword());
        sysUserDO.setImageUrl(mcsMerchantDTO.getLogo());
        try {
            userDao.insert(sysUserDO);
            McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO();
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/ConvenientApi.java
@@ -183,19 +183,19 @@
    @ApiOperation(value = "上传文件")
    @PostMapping(value = "/upload/file", consumes = "multipart/*", headers = "content-type=multipart/form-date")
    public R uploadImage(@RequestParam MultipartFile[] files, HttpServletRequest request) {
    public R uploadImage(@RequestParam MultipartFile[] file, HttpServletRequest request) {
        List<UploadFilesVO> urlList = new ArrayList<>();
        SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
        sftp.login();
        for (MultipartFile file : files) {
            String fileExtension = FilenameUtils.getExtension(file.getOriginalFilename());
        for (MultipartFile f : file) {
            String fileExtension = FilenameUtils.getExtension(f.getOriginalFilename());
            String name = UUID.randomUUID().toString().replaceAll("-", "") + fileExtension;
            try {
                InputStream is = file.getInputStream();
                InputStream is = f.getInputStream();
                String fileName =
                        UUID.randomUUID().toString().replace("-", "") + fileExtension;
                File file1 = new File(fileName);
                file.transferTo(file1);
                f.transferTo(file1);
                boolean delete = file1.delete();
                log.info("临时文件删除【{}】", delete);
                sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is);
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java
@@ -287,4 +287,17 @@
        log.info("执行结果【{}】", r.toString());
        return ReturnT.SUCCESS;
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街游戏结束
     * @param param
     * @return
     */
    @XxlJob("endStatusForMcsGameJobHandler")
    public ReturnT<String> endStatusForMcsGameJobHandler(String param) {
        log.info("定时任务,将已到期的微商业街游戏结束");
        R r = communityService.endStatusForMcsGame();
        log.info("执行结果【{}】", r.toString());
        return ReturnT.SUCCESS;
    }
}