/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package com.unis.basic.info.modular.grainPriceCollectCitySum.service.impl;

import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unis.auth.core.util.StpLoginUserUtil;
import com.unis.basic.info.modular.grainPriceCollect.entity.GrainPriceCollect;
import com.unis.basic.info.modular.grainPriceCollectCategory.entity.GrainPriceCollectCategory;
import com.unis.basic.info.modular.grainPriceCollectCategory.enums.GrainPriceCollectTypeEnum;
import com.unis.basic.info.modular.grainPriceCollectCategory.service.GrainPriceCollectCategoryService;
import com.unis.basic.info.modular.grainPriceCollectCitySum.entity.GrainPriceCollectCitySum;
import com.unis.basic.info.modular.grainPriceCollectCitySum.mapper.GrainPriceCollectCitySumMapper;
import com.unis.basic.info.modular.grainPriceCollectCitySum.param.GrainPriceCollectCitySumAddParam;
import com.unis.basic.info.modular.grainPriceCollectCitySum.param.GrainPriceCollectCitySumEditParam;
import com.unis.basic.info.modular.grainPriceCollectCitySum.param.GrainPriceCollectCitySumIdParam;
import com.unis.basic.info.modular.grainPriceCollectCitySum.param.GrainPriceCollectCitySumPageParam;
import com.unis.basic.info.modular.grainPriceCollectCitySum.param.SummaryAnalysisParam;

import com.unis.basic.info.modular.grainPriceCollectCitySum.service.GrainPriceCollectCitySumService;
import com.unis.basic.info.modular.grainPriceCollectProvinceSum.entity.GrainPriceCollectProvinceSum;
import com.unis.basic.info.modular.grainPriceCollectProvinceSum.service.GrainPriceCollectProvinceSumService;
import com.unis.common.enums.CommonSortOrderEnum;
import com.unis.common.exception.CommonException;
import com.unis.common.page.CommonPageRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 市级粮食价格采集汇总Service接口实现类
 *
 * @author TS
 * @date 2024/04/03 10:36
 **/
@Service
public class GrainPriceCollectCitySumServiceImpl extends ServiceImpl<GrainPriceCollectCitySumMapper, GrainPriceCollectCitySum> implements GrainPriceCollectCitySumService {

    @Resource
    private GrainPriceCollectCitySumMapper grainPriceCollectCitySumMapper;
    @Autowired
    private GrainPriceCollectCategoryService grainPriceCollectCategoryService;
    @Autowired
    private GrainPriceCollectProvinceSumService grainPriceCollectProvinceSumService;

    @Override
    public Page<GrainPriceCollectCitySum> page(GrainPriceCollectCitySumPageParam grainPriceCollectCitySumPageParam) {
        QueryWrapper<GrainPriceCollectCitySum> queryWrapper = new QueryWrapper<>();
        if (ObjectUtil.isAllNotEmpty(grainPriceCollectCitySumPageParam.getSortField(), grainPriceCollectCitySumPageParam.getSortOrder())) {
            CommonSortOrderEnum.validate(grainPriceCollectCitySumPageParam.getSortOrder());
            queryWrapper.orderBy(true, grainPriceCollectCitySumPageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
                    StrUtil.toUnderlineCase(grainPriceCollectCitySumPageParam.getSortField()));
        } else {
            queryWrapper.lambda().orderByAsc(GrainPriceCollectCitySum::getId);
        }
        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void add(GrainPriceCollectCitySumAddParam grainPriceCollectCitySumAddParam) {
        GrainPriceCollectCitySum grainPriceCollectCitySum = BeanUtil.toBean(grainPriceCollectCitySumAddParam, GrainPriceCollectCitySum.class);
        this.save(grainPriceCollectCitySum);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void edit(GrainPriceCollectCitySumEditParam grainPriceCollectCitySumEditParam) {
        GrainPriceCollectCitySum grainPriceCollectCitySum = this.queryEntity(grainPriceCollectCitySumEditParam.getId());
        BeanUtil.copyProperties(grainPriceCollectCitySumEditParam, grainPriceCollectCitySum);
        this.updateById(grainPriceCollectCitySum);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void delete(List<GrainPriceCollectCitySumIdParam> grainPriceCollectCitySumIdParamList) {
        // 执行删除
        this.removeByIds(CollStreamUtil.toList(grainPriceCollectCitySumIdParamList, GrainPriceCollectCitySumIdParam::getId));
    }

    @Override
    public GrainPriceCollectCitySum detail(GrainPriceCollectCitySumIdParam grainPriceCollectCitySumIdParam) {
        return this.queryEntity(grainPriceCollectCitySumIdParam.getId());
    }

    @Override
    public GrainPriceCollectCitySum queryEntity(String id) {
        GrainPriceCollectCitySum grainPriceCollectCitySum = this.getById(id);
        if (ObjectUtil.isEmpty(grainPriceCollectCitySum)) {
            throw new CommonException("市级粮食价格采集汇总不存在，id值为：{}", id);
        }
        //得到采集价格品种
        QueryWrapper<GrainPriceCollectCategory> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type_id", id);
        //按一级，二级，三级，价格类型排序
        queryWrapper.orderByAsc("first_level,second_level,three_level,price_type");
        List<GrainPriceCollectCategory> collectCategoryList = grainPriceCollectCategoryService.list(queryWrapper);
        grainPriceCollectCitySum.setCollectCategoryList(collectCategoryList);
        return grainPriceCollectCitySum;
    }

    /**
     * 市级粮食价格采集汇总
     *
     * @param orgId
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String collectCitySum(String orgId, String userId) {
        //得到
//        List<RemindCycle>  remindCycles =   remindCycleService.list();
//        if (remindCycles == null || remindCycles.size() <= 0){
//            throw new CommonException("报送周期不存在");
//        }
        //比较当天是不是报送日
//        RemindCycle remindCycle = remindCycles.get(0);
//       if ( DateUtil.dayOfWeek(DateUtil.date())-1 != remindCycle.getDayOfWeek()){
//           throw new CommonException("当前不是报送日");
//       }
        //得到当前周的周一时间,周末时间
        // 获取当前周一
        String monday = DateUtil.beginOfWeek(new Date()).toStringDefaultTimeZone();
        // 获取当前周日
        String sunday = DateUtil.endOfWeek(new Date()).toStringDefaultTimeZone();

/* 测试
        DateTime offWeek1 = DateUtil.offsetWeek(new Date(),-1);
        // 获取上周周一
        monday = DateUtil.beginOfWeek(offWeek1).toStringDefaultTimeZone();
        // 获取上前周日
        sunday = DateUtil.endOfWeek(offWeek1).toStringDefaultTimeZone();*/

        //查询是否汇总，如果本期间已汇总，但是状态是驳回，可以重新进行汇总
        QueryWrapper<GrainPriceCollectCitySum> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sys_org_id", orgId);
        queryWrapper.ne("audit_status", 2); //未审核,已审核
        queryWrapper.between("sum_time", monday, sunday);
        List<GrainPriceCollectCitySum> grainPriceCollectCitySums = this.list(queryWrapper);
        if (grainPriceCollectCitySums.size() > 0) {//有未审核的
            throw new CommonException("在当前期间内,本单位已汇总");
        }
        GrainPriceCollectCitySum citySum = new GrainPriceCollectCitySum();
       queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sys_org_id", orgId);
        queryWrapper.eq("audit_status",2); //驳回
        queryWrapper.between("sum_time", monday, sunday);
         grainPriceCollectCitySums = this.list(queryWrapper);
        if (grainPriceCollectCitySums.size() > 0) {//有驳回的
            citySum = grainPriceCollectCitySums.get(0);
            //删除市级明细数据，重新生成
            QueryWrapper<GrainPriceCollectCategory> categoryQueryWrapper = new QueryWrapper<>();
            categoryQueryWrapper.eq("type_id",citySum.getId());
            if(!grainPriceCollectCategoryService.remove(categoryQueryWrapper)) { //删除市级汇总明细数据
                throw new CommonException("删除市级粮食价格采集汇总明细失败！");
            }
        }
        //得到每个监测点已审核通过数据,只要有一个站点未审核通过,就不能汇总
        //表示有未审核通过监测点,在当前期间内
        List<Map<String, Object>> monitors = grainPriceCollectCitySumMapper.getMonitors(orgId, "0,2", monday, sunday);
        if (monitors != null && monitors.size() > 0) {
            String str1 = "";
            String str2 = "";
            String str3 = "";
            for (int i = 0; i < monitors.size(); i++) {
                Map<String, Object> map = monitors.get(i);
                String status = (String) map.getOrDefault("status", "-1");
                if (StringUtils.equals(status, "-1")) { //未填报监测点
                    str1 += map.getOrDefault("name", "") + ",";
                } else if (StringUtils.equals(status, "0")) { //未审核通过监测点
                    str2 += map.getOrDefault("name", "") + ",";
                }else {
                    str3 += map.getOrDefault("name", "") + ",";
                }
            }
            throw new CommonException("未填报监测点:{};未审核通过监测点:{};驳回监测点:{}", str1, str2,str3);
        }
        //处理当前期间的上报数据
        //需求:当天填报,当天审核,当天汇总,如果漏报,当天就不能上报,只有进行补报后,才能上报,
        // 需要添加期间字段,记录所属期间,以便补报(填表默认日报,取当天日期,补报如何选择未确定)
        //保存汇总主表信息

        citySum.setSysOrgId(orgId);
        citySum.setSysUserId(userId);
        citySum.setSumTime(new Date());
        citySum.setStatus(0); // 上报状态 0:未上报；1：已上报；
        citySum.setAuditStatus(0); // 状态 0：未审核；1：已审核；2：驳回；
        if (!this.saveOrUpdate(citySum)) {
            throw new CommonException("保存市级汇总信息失败");
        }
        String id = citySum.getId();
        List<Map<String, Object>> prictTypes = grainPriceCollectCitySumMapper.getAvgPrice(orgId, GrainPriceCollectTypeEnum.PriceCollect.getValue(), monday, sunday);
        if (prictTypes == null || prictTypes.size() <= 0) {
            throw new CommonException("未有审核通过数据");
        }
        DateTime offWeek = DateUtil.offsetWeek(new Date(), -1);
        // 获取上周周一
        String offMonday = DateUtil.beginOfWeek(offWeek).toStringDefaultTimeZone();
        // 获取当前周日
        String offSunday = DateUtil.endOfWeek(offWeek).toStringDefaultTimeZone();
        //保存市级汇总从表信息
        List<GrainPriceCollectCategory> categoryList = new ArrayList<>();
        for (int i = 0; i < prictTypes.size(); i++) {
            Map<String, Object> map = prictTypes.get(i);
            GrainPriceCollectCategory category = new GrainPriceCollectCategory();
            category.setType(Integer.parseInt(GrainPriceCollectTypeEnum.CitySum.getValue()));
            category.setTypeId(id);
            category.setFirstLevel(NumberUtil.parseInt(map.get("firstLevel").toString()));
            category.setSecondLevel(NumberUtil.parseInt(map.get("secondLevel").toString()));
            category.setThreeLevel(NumberUtil.parseInt(map.get("threeLevel").toString()));
            category.setPriceType(NumberUtil.parseInt(map.get("priceType").toString()));
            category.setPrice(NumberUtil.toBigDecimal(map.get("avgPrice").toString()));
            //与上一期间进行比较，现在默认一周为一期间
            List<Map<String, Object>> categoryList1 = grainPriceCollectCitySumMapper.getOffAvgPrice(orgId, category.getType().toString(), offMonday, offSunday,
                    category.getPriceType().toString(),
                    category.getFirstLevel().toString(),
                    category.getSecondLevel().toString(),
                    category.getThreeLevel().toString()
            );
            //未查到数据表示上一期间没有数据，则按平价价格为0计算
            BigDecimal offAvgPrice = NumberUtil.toBigDecimal("0.00");
            if (categoryList1.size() == 1) {
                //得到上一期间价格
                offAvgPrice = NumberUtil.toBigDecimal(categoryList1.get(0).get("offAvgPrice").toString());
            }
            //得到本期价格
            BigDecimal avgPrice = category.getPrice();
            //与上周同期比 =（本期间平价价格-上期间平价价格）/本期间平价价格
            BigDecimal weekRate = NumberUtil.div(NumberUtil.sub(avgPrice, offAvgPrice), avgPrice);
            category.setWeekRate(weekRate);
            categoryList.add(category);
        }
        if (!grainPriceCollectCategoryService.saveBatch(categoryList)) {
            throw new CommonException("保存市级汇明细总信息失败");
        }
        //通过条件修改价格采集对应的市级汇总表Id
        grainPriceCollectCitySumMapper.updateGrainPriceCollect(orgId,id,monday,sunday);
        return "保存成功";
    }

    /**
     * 市级粮食价格采集上报
     *
     * @param grainPriceCollectCitySumIdParam
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String collectCityUpload(GrainPriceCollectCitySumIdParam grainPriceCollectCitySumIdParam) {
        GrainPriceCollectCitySum citySum = this.getById(grainPriceCollectCitySumIdParam.getId());
        if (citySum == null) {
            throw new CommonException("市级粮食价格采集汇总不存在，id值为：{}", grainPriceCollectCitySumIdParam.getId());
        }
        if (citySum.getStatus() != 0) {
            throw new CommonException("在当前期间内,本单位已上报，不能再上报");
        }
        if (citySum.getAuditStatus() == 0) {
            throw new CommonException("在当前期间内,本单位未审核通过，不能上报");
        }
        if (citySum.getAuditStatus() == 2) {
            throw new CommonException("在当前期间内,本单位已驳回通过，不能上报");
        }
        //TODO TS 此需求是站点上报进行检测，此功能暂时废弃
//        本周/月汇总粮食平均价超出上周/月汇总粮食平均价5%以上，需要填报备注说明，否则不能上报。
//        如果今日汇总粮食平均价超出上日粮食平均价2%以上，需要填报备注说明，否则不能上报。
//        if (StringUtils.isBlank(grainPriceCollectCitySumIdParam.getRemark())){
//            //检查本期间内是否超过5%，当前是一周上报一次
//            QueryWrapper<GrainPriceCollectCategory> queryWrapper = new QueryWrapper<>();
//            queryWrapper.eq("type_id",citySum.getId());
//            queryWrapper.gt("week_rate",0.05);
//            List<GrainPriceCollectCategory> collectCategoryLsit = grainPriceCollectCategoryService.list(queryWrapper);
//            if (collectCategoryLsit.size() > 0){
//                throw new CommonException("在当前期间内,汇总数据有超过上期间汇总粮食平均价格5%以上，请备注说明");
//            }
//        }
        citySum.setStatus(1); //上报
        citySum.setRemark(grainPriceCollectCitySumIdParam.getRemark());
        return this.updateById(citySum) ? "上报成功" : "上报失败";
    }

    /**
     * 获取自定义市级粮食价格采集汇总分页
     *
     * @param pageParam
     * @author TS
     * @date 2024/04/08 10:36
     */
    @Override
    public IPage<Map<String, Object>> findPage(GrainPriceCollectCitySumPageParam pageParam) {
        //条形查询器
        QueryWrapper<GrainPriceCollectCitySum> queryWrapper = new QueryWrapper<>();
        // 校验数据范围
//        List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
//        if(ObjectUtil.isNotEmpty(loginUserDataScope)) {
//            //数据范围不为空，则查询这些机构内的
//            queryWrapper.in("a.sys_org_id", loginUserDataScope);
//        } else {
//            return new Page<>();
//        }
        //分页相关
        if (StringUtils.isNotBlank(pageParam.getOrgId())) {
            queryWrapper.like("b.id", pageParam.getOrgId());
        }
        if (StringUtils.isNotBlank(pageParam.getSumEndTime()) && StringUtils.isNotBlank(pageParam.getSumEndTime())) {
            queryWrapper.apply(" DATE_FORMAT(ifnull(a.sum_time,NOW()),'%Y-%m-%d') >=  '" + pageParam.getSumStartTime() + "' AND DATE_FORMAT(ifnull(a.sum_time,NOW()),'%Y-%m-%d') <= '" + pageParam.getSumEndTime() + " 23:59:59'");

        }
        Page<GrainPriceCollectCitySum> p = new Page<>(pageParam.getCurrent(), pageParam.getSize());

        IPage<Map<String, Object>> page = grainPriceCollectCitySumMapper.selectMyMapsPage(p, queryWrapper);
        return page;


    }

    @Override
    public List<GrainPriceCollectCitySum> summaryAnalysis(SummaryAnalysisParam summaryAnalysisParam) {
        QueryWrapper<GrainPriceCollectCitySum> queryWrapper = new QueryWrapper<>();
        if (ObjectUtil.isAllNotEmpty(summaryAnalysisParam.getSumStartTime(), summaryAnalysisParam.getSumEndTime())) {
            queryWrapper.between("sum_time", summaryAnalysisParam.getSumStartTime(), summaryAnalysisParam.getSumEndTime());
            //queryWrapper.le("sum_time",summaryAnalysisParam.getSumEndTime());
            //queryWrapper.ge("sum_time",summaryAnalysisParam.getSumStartTime());
        }
        if (ObjectUtil.isNotNull(summaryAnalysisParam.getSysOrgId())) {
            queryWrapper.eq("sys_org_id", summaryAnalysisParam.getSysOrgId());
        }
        queryWrapper.eq("status", 1);//已上报
        queryWrapper.orderByAsc("sum_time");
        List<GrainPriceCollectCitySum> cityList = grainPriceCollectCitySumMapper.selectList(queryWrapper);
        if (summaryAnalysisParam.getSysOrgId() != null && cityList.size() > 0) {//市级粮食价格采集汇总
            for (GrainPriceCollectCitySum grainPriceCollectCitySum : cityList) {
                QueryWrapper<GrainPriceCollectCategory> queryWrapperZ = new QueryWrapper<>();
                queryWrapperZ.eq("type_id", grainPriceCollectCitySum.getId());
                queryWrapperZ.eq("type", 2);//市级
                if (summaryAnalysisParam.getFirstLevel().equals(1)) {//一级分类 1：原粮；2：杂粮；3：成品粮；4：省级储备
                    if (ObjectUtil.isNotNull(summaryAnalysisParam.getSecondLevel())) {
                        queryWrapperZ.eq("second_level", summaryAnalysisParam.getSecondLevel());
                    }
                    queryWrapperZ.eq("price_type", 1);//价格类型 1：收购价；2：入库价；3：出库价；4：出厂价；5：批发价；6：零售价；
                    queryWrapperZ.eq("first_level", 1);
                }
                if (summaryAnalysisParam.getFirstLevel().equals(3)) {//一级分类 1：原粮；2：杂粮；3：成品粮；4：省级储备
                    if (ObjectUtil.isNotNull(summaryAnalysisParam.getThreeLevel())) {
                        queryWrapperZ.eq("three_level", summaryAnalysisParam.getThreeLevel());
                    }
                    //queryWrapperZ.eq("price_type",5).or().eq("price_type",6);
                    queryWrapperZ.le("price_type", 6);
                    queryWrapperZ.ge("price_type", 5);
                    queryWrapperZ.eq("first_level", 3);
                }
                if (summaryAnalysisParam.getFirstLevel().equals(4)) {//一级分类 1：原粮；2：杂粮；3：成品粮；4：省级储备
                    if (ObjectUtil.isNotNull(summaryAnalysisParam.getSecondLevel())) {
                        queryWrapperZ.eq("second_level", summaryAnalysisParam.getSecondLevel());
                    }
                    //queryWrapperZ.eq("price_type",2).or().eq("price_type",3);
                    queryWrapperZ.le("price_type", 3);
                    queryWrapperZ.ge("price_type", 2);
                    queryWrapperZ.eq("first_level", 4);
                }

                List<GrainPriceCollectCategory> zList = grainPriceCollectCategoryService.list(queryWrapperZ);
                grainPriceCollectCitySum.setCollectCategoryList(zList);
            }
        }
        return cityList;
    }

    /**
     * 审核市级粮食价格采集
     *
     * @param idParam
     * @return
     */
    @Override
    public String audit(GrainPriceCollectCitySumIdParam idParam) {
        GrainPriceCollectCitySum collectCitySum = this.getById(idParam.getId());
        if(ObjectUtil.isEmpty(collectCitySum)) {
            throw new CommonException("市级粮食价格采集汇总不存在，id值为：{}", collectCitySum.getId());
        }
        //表示已经审核,并且不能再次审核
        if(collectCitySum.getAuditStatus() == 1 && idParam.getAuditStatus() == 1) {
            throw new CommonException("市级粮食价格采集汇总已审核，id值为：{}", collectCitySum.getId());
        }
        if(idParam.getAuditStatus() == 2){ //表示是驳回
            if(collectCitySum.getAuditStatus() == 2) {
                throw new CommonException("市级粮食价格采集汇总已驳回，id值为：{}", collectCitySum.getId());
            }
            if(StringUtils.isBlank(idParam.getAuditRejectAdvice())){
                throw new CommonException("驳回必须填写驳回意见！");
            }
            //检测省级是否汇总.如果省级已经汇总，则必须删除省级汇总
            if (StringUtils.isNotBlank(collectCitySum.getGrainPriceCollectProvinceSumId())){

                GrainPriceCollectProvinceSum provinceSum =  grainPriceCollectProvinceSumService.getById(collectCitySum.getGrainPriceCollectProvinceSumId());
                if (ObjectUtil.isNotEmpty(provinceSum)){
                    QueryWrapper<GrainPriceCollectCategory> queryWrapper = new QueryWrapper<>();
                    queryWrapper.eq("type_id",provinceSum.getId());
                    if(!grainPriceCollectCategoryService.remove(queryWrapper)){ //删除省级汇总明细数据
                        throw new CommonException("删除省级粮食价格采集汇总明细失败！");
                    }
                    if(!grainPriceCollectProvinceSumService.removeById(provinceSum.getId())){ //删除省级汇总明细
                        throw new CommonException("删除省级粮食价格采集汇总失败！");
                    }
                }
                //设置省级汇总id为空
                collectCitySum.setGrainPriceCollectProvinceSumId(null);
            }
        }
        collectCitySum.setAuditStatus(idParam.getAuditStatus());
        if (StringUtils.isNotBlank(idParam.getAuditRejectAdvice())){
            collectCitySum.setAuditRejectAdvice(idParam.getAuditRejectAdvice());
        }
        return this.updateById(collectCitySum)?"处理成功":"处理失败";
    }

}
