yujian
2020-04-24 916f8851ccddff8ff764d950667b5fa86f77d7b2
后台状态切换
9个文件已修改
111 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -55,7 +55,6 @@
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.tag.PageEntity;
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsAdminController.java
@@ -94,7 +94,6 @@
                }
            }
            
            long count = banLiShopGoodsService.countGoods(key, state);
            int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
@@ -144,4 +143,25 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
        }
    }
    /**
     * 修改状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "switchState")
    public void switchState(String callback, Long id, PrintWriter out) {
        try {
            banLiShopGoodsService.switchState(id);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (BanLiShopGoodsException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
}
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java
@@ -52,6 +52,25 @@
    }
    
     /** 
     * 修改状态
     * @param callback
     * @param id
     * @param out
     */
    @RequestMapping(value = "switchState")
    public void switchState(String callback, Long id, PrintWriter out) {
        try {
            banLiShopGoodsSetService.switchState(id);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
        } catch (BanLiShopGoodsSetException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
            e.printStackTrace();
        }
    }
     /**
     * 删除
     * @param callback
     * @param idArray
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml
@@ -109,7 +109,7 @@
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER}</if>
            <if test="weight != null">#{weight,jdbcType=INTEGER},</if>
            <if test="squarePicture != null">#{squarePicture,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsServiceImpl.java
@@ -187,6 +187,31 @@
    }
    
    @Override
    public void switchState(Long id) throws BanLiShopGoodsException {
        if (id == null) {
            throw new BanLiShopGoodsException(1, "请传递正确参数");
        }
        BanLiShopGoods resultObj = banLiShopGoodsMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new BanLiShopGoodsException(1, "此内容已不存在");
        }
        Integer state = resultObj.getState();
        if (state == null || state == 0) {
            state = 1;
        } else {
            state = 0;
        }
        BanLiShopGoods updateObj = new BanLiShopGoods();
        updateObj.setId(id);
        updateObj.setState(state);
        banLiShopGoodsMapper.updateByPrimaryKeySelective(updateObj);
    }
    /**
     * 上传图片
     * @param file
@@ -237,6 +262,9 @@
    }
    @Transactional
    @Override
    public void deleteByPrimaryKey(Long id) {
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java
@@ -136,6 +136,28 @@
    }
    
    @Override
    public void switchState(Long id) throws BanLiShopGoodsSetException {
        if (id == null) {
            throw new BanLiShopGoodsSetException(1, "请传递正确参数");
        }
        BanLiShopGoodsSets resultObj = banLiShopGoodsSetsMapper.selectByPrimaryKey(id);
        if (resultObj == null) {
            throw new BanLiShopGoodsSetException(1, "此内容已不存在");
        }
        Integer state = resultObj.getState();
        if (state == null || state == 0) {
            state = 1;
        } else {
            state = 0;
        }
        BanLiShopGoodsSets updateObj = new BanLiShopGoodsSets();
        updateObj.setId(id);
        updateObj.setState(state);
        banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(updateObj);
    }
    @Override
    public void updateSelectiveByPrimaryKey(BanLiShopGoodsSets set) {
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
@@ -347,6 +347,7 @@
        info.setId(userInfo.getId());
        info.setState(UserVIPInfo.STATE_INVALID);
        info.setUpdateTime(new Date());
        info.setBeiZhu(reason);
        userVIPInfoMapper.updateByPrimaryKeySelective(info);
        // 消息
        userAccountMsgNotificationService.vipUpgradeFail(uid, reason);
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsService.java
@@ -98,6 +98,14 @@
     */
    public void saveObject(MultipartFile file, MultipartFile file2, BanLiShopGoods record)
            throws BanLiShopGoodsException, Exception;
    /**
     * 状态切换
     * @param id
     * @throws BanLiShopGoodsSetException
     */
    public void switchState(Long id) throws BanLiShopGoodsException;
    
}
fanli/src/main/java/com/yeshi/fanli/service/inter/shop/BanLiShopGoodsSetService.java
@@ -91,4 +91,12 @@
     */
    public void saveObject(BanLiShopGoodsSets record) throws BanLiShopGoodsSetException;
    /**
     * 状态切换
     * @param id
     * @throws BanLiShopGoodsSetException
     */
    public void switchState(Long id) throws BanLiShopGoodsSetException;
}