44323
2023-11-17 2bb111939922d8e48fe11374bfe8ef2834a5bb43
cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -16,7 +16,6 @@
import com.dsh.activity.feignclient.account.StudentClient;
import com.dsh.activity.feignclient.account.model.AppUserByNameAndPhoneDTO;
import com.dsh.activity.feignclient.account.model.TCityManager;
import com.dsh.activity.feignclient.account.model.TStoreStaff;
import com.dsh.activity.feignclient.model.CouponExamineListSearch;
import com.dsh.activity.feignclient.model.CouponListOfSearch;
import com.dsh.activity.feignclient.model.TAppUser;
@@ -25,6 +24,7 @@
import com.dsh.activity.feignclient.other.StoreClient;
import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo;
import com.dsh.activity.feignclient.other.model.Store;
import com.dsh.activity.feignclient.other.model.StoreInfoDto;
import com.dsh.activity.feignclient.other.model.TOperatorCity;
import com.dsh.activity.model.CouponListVo;
import com.dsh.activity.model.CouponRecordQuery;
@@ -44,7 +44,6 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -84,6 +83,7 @@
    @Resource
    private StoreClient stoClient;
    @Resource
@@ -274,6 +274,7 @@
    @PostMapping("/base/coupon/queryCouponListSearch")
    public List<Map<String,Object>> getCouponListOfSearch(@RequestBody CouponListOfSearch ofSearch){
        List<Map<String, Object>> mapList1 = couponService.queryCouponListOfSearch(ofSearch);
        List<Map<String, Object>> mapList = new ArrayList<>();
        if (ofSearch.getStoreIds()==null){
            ArrayList<Integer> list = new ArrayList<>();
@@ -407,11 +408,7 @@
                Integer publisherType = (Integer) stringObjectMap.get("publisherType");
                if (publisherType!=null) {
                    if (publisherType == 1) {
                        Integer cityManagerId = (Integer) stringObjectMap.get("cityManagerId");
                        TCityManager byId = citClient.getById(cityManagerId);
                        stringObjectMap.put("province", byId.getProvince());
                        stringObjectMap.put("city", byId.getCity());
                    }
                }
            }
@@ -430,11 +427,7 @@
            couponInfo.put("id",coupon.getId());
            couponInfo.put("auditStatus",coupon.getAuditStatus());
            couponInfo.put("publisherType",coupon.getPublisherType());
            if (coupon.getPublisherType() == 1){
                TCityManager byId = citClient.getById(coupon.getCityManagerId());
                couponInfo.put("province",byId.getProvince());
                couponInfo.put("city",byId.getCity());
            }
            couponInfo.put("name",coupon.getName());
            couponInfo.put("type",coupon.getType());
            JSONObject jsonObject = JSON.parseObject(coupon.getContent());
@@ -508,14 +501,16 @@
                    List<CouponStore> list = couStoreService.list(new LambdaQueryWrapper<CouponStore>()
                            .eq(CouponStore::getCouponId,coupon.getId()));
                    if (list.size() > 0){
                        // 获取门店ids
                        List<Integer> collect = list.stream().map(CouponStore::getStoreId).collect(Collectors.toList());
                        List<Store> storeList = stoClient.queryStoreByIds(collect);
                        if (storeList.size() > 0){
                            for (Store store : storeList) {
                                TStoreStaff list1 = stoStaClient.baseInfo(store.getStoreStaffId());
                                StoreInfoDto storeInfo = stoClient.getStoreInfo(store.getStoreStaffId());
                                HashMap<String, Object> stringObjectHashMap = new HashMap<>();
                                stringObjectHashMap.put("procity",store.getProvince()+store.getCity());
                                stringObjectHashMap.put("storeAccount",list1.getName()+"+"+list1.getPhone());
                                stringObjectHashMap.put("storeAccount",storeInfo.getInfo());
                                stringObjectHashMap.put("storeName",store.getName());
                                maps.add(stringObjectHashMap);
                            }
@@ -580,10 +575,7 @@
                    case 1:
                        coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints()));
                        break;
                    case 2:
                        coupon.setCash(dataVo.getRequiredCash());
                        coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints()));
                        break;
                    case 3:
                        coupon.setCash(dataVo.getRequiredCash());
                        break;
@@ -618,21 +610,18 @@
            }
            if (dataVo.getUserType() == 1){
                coupon.setPublisherType(2);
                coupon.setAuditStatus(2);
                coupon.setCityManagerId(dataVo.getCityManagerId());
            }
            if (dataVo.getUserType() == 2){
                coupon.setPublisherType(1);
                coupon.setAuditStatus(1);
                coupon.setCityManagerId(dataVo.getCityManagerId());
            }
            if(dataVo.getObjType()!=1){
                coupon.setAuditStatus(1);
            }
            if (dataVo.getUserType()==1){
            if (dataVo.getUserType() == 3){
                coupon.setPublisherType(3);
                coupon.setAuditStatus(2);
            }else{
                coupon.setAuditStatus(1);
            }
            if(dataVo.getObjType()!=1){
                coupon.setAuditStatus(1);
                coupon.setCityManagerId(dataVo.getCityManagerId());
            }
            boolean save = couponService.save(coupon);