nickchange
2023-11-09 c036557db88c6297b9a626a892dce35c14ab8ee5
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponExamineController.java
@@ -10,9 +10,13 @@
import com.dsh.guns.core.common.constant.factory.PageFactory;
import com.dsh.guns.core.exception.GunsException;
import com.dsh.guns.core.util.ToolUtil;
import com.dsh.guns.modular.system.model.User;
import com.dsh.guns.modular.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -33,6 +37,8 @@
    @Resource
    private CouponClient client;
    @Autowired
    private IUserService userService;
    /**
     * 优惠券审核列表页
@@ -43,7 +49,15 @@
    }
    /**
     * 获取根据门店id 获取店长信息
     */
    @RequestMapping(value = "/getStoreInfo")
    @ResponseBody
    public String getStoreInfo(@RequestBody Integer id) {
        User byId = userService.getById(id);
        return byId.getName() + "-" + byId.getAccount();
    }
    /**
     * 获取 优惠券审核列表
     */
@@ -65,7 +79,6 @@
     * 获取 优惠券审核详情
     */
    @RequestMapping(value = "/couponOfDetail/{id}")
    @ResponseBody
    public String detailOfCoupon(@PathVariable Integer id, Model model){
        Map<String, Object> stringObjectMap = client.queryCouponExamineDetail(id);
        model.addAttribute(stringObjectMap);
@@ -77,7 +90,6 @@
     * 获取 优惠券审核详情
     */
    @RequestMapping(value = "/couponExaminePage/{id}")
    @ResponseBody
    public String couponExaminePage(@PathVariable Integer id, Model model){
        model.addAttribute("id",id);
        return PREFIX + "TCouponExamine.html";
@@ -87,13 +99,13 @@
    @RequestMapping(value = "/examine")
    @ResponseBody
    public Object examine(Integer couponOfId, Integer state, String remark) {
        Coupon coupon = client.queryCouponById(couponOfId);
    public Object examine(Integer id, Integer state, String remark) {
        Coupon coupon = client.queryCouponById(id);
        try {
            if (state == 1) {
            if (state == 2) {
                coupon.setAuditStatus(2);
            }
            if (state == 2) {
            if (state == 3) {
                coupon.setAuditStatus(3);
                coupon.setAuditRemark(remark);
            }