| | |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.apache.poi.hssf.record.DVALRecord; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static org.springblade.core.secure.utils.AuthUtil.getUserRole; |
| | | |
| | | public class CommonParamSet<T> { |
| | | /** |
| | |
| | | * 是否为超级管理员 |
| | | */ |
| | | private Integer isAdministrator; |
| | | |
| | | /** |
| | | * 社区编号 |
| | | */ |
| | | private String communityCode; |
| | | /** |
| | | * 网格编号集合 |
| | | */ |
| | |
| | | return str; |
| | | } |
| | | |
| | | public String getCommunityCode() { |
| | | return communityCode; |
| | | } |
| | | |
| | | public <U> CommonParamSet invoke(Class<U> clazz, T t) { |
| | | //获取传入对象信息 |
| | | U u = clazz.cast(t); |
| | |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 获取请求头中的社区编号 |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | |
| | | and br.town_name like concat('%',#{backblastPubRecord.townName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.communityName != null and backblastPubRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | and br.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.pcsName != null and backblastPubRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{backblastPubRecord.pcsName},'%') |
| | |
| | | and br.town_name like concat('%',#{backblastPubRecord.townName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.communityName != null and backblastPubRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | and br.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.pcsName != null and backblastPubRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{backblastPubRecord.pcsName},'%') |
| | |
| | | and br.town_name like concat('%',#{backblastPubRecord.townName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.communityName != null and backblastPubRecord.communityName != ''"> |
| | | and jbr.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | and br.name like concat('%',#{backblastPubRecord.communityName},'%') |
| | | </if> |
| | | <if test="backblastPubRecord.pcsName != null and backblastPubRecord.pcsName != ''"> |
| | | and jpag.pcs_name like concat('%',#{backblastPubRecord.pcsName},'%') |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | public void processPages(int pageSize, EcOrderParamDTO ecOrderParamDTO) { |
| | | QueryWrapper<EcOrder> ecOrderQueryWrapper = new QueryWrapper<>(); |
| | | if (ecOrderParamDTO.getStartTime() != null) { |
| | | if (StringUtils.isNotBlank(ecOrderParamDTO.getStartTime()) && StringUtils.isNotEmpty(ecOrderParamDTO.getEndTime())) { |
| | | ecOrderQueryWrapper.between("import_time", ecOrderParamDTO.getStartTime(), ecOrderParamDTO.getEndTime()); |
| | | } |
| | | long count = count(ecOrderQueryWrapper); |
| | |
| | | IPage<EcOrder> resultPage = baseMapper.selectPage(page, objectQueryWrapper); |
| | | List<EcOrder> records = resultPage.getRecords(); |
| | | List<ECallEventTwoEntity> recordEntityList = BeanUtil.copy(records, ECallEventTwoEntity.class); |
| | | boolean b = ecOrderService.saveOrUpdateBatch(recordEntityList); |
| | | List<ECallEventTwoEntity> arrayList = new ArrayList<>(); |
| | | // 过滤出已同步的订单 |
| | | recordEntityList.forEach(record -> { |
| | | long count1 = ecOrderService.count(Wrappers.<ECallEventTwoEntity>lambdaQuery().eq(ECallEventTwoEntity::getOrderId, record.getOrderId())); |
| | | if (count1 == 0) { |
| | | arrayList.add(record); |
| | | } |
| | | }); |
| | | // 同步订单 |
| | | boolean b = false; |
| | | if (arrayList.size() > 0) { |
| | | b = ecOrderService.saveOrUpdateBatch(arrayList); |
| | | } |
| | | System.out.println("更新第" + pageNum + "页" + b); |
| | | } |
| | | } |
| | |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("aoiCodeList") List<String> aoiCodeList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("communityCode") String communityCode); |
| | | |
| | | |
| | | /** |
| | |
| | | jda.aoi_name, |
| | | br.village_name communityName, |
| | | jda.address_name as addressName |
| | | from jczz_task_report_for_repairs jtrfr |
| | | left join jczz_doorplate_address jda on jda.address_code = jtrfr.address_code |
| | | FROM jczz_task_report_for_repairs jtrfr |
| | | LEFT JOIN jczz_doorplate_address jda on jda.address_code = jtrfr.address_code |
| | | LEFT JOIN jczz_house jh on jh.house_code=jtrfr.address_code |
| | | left join jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0 |
| | | left join blade_region br on br.code = jg.community_code |
| | | LEFT JOIN jczz_place jp on jtrfr.address_code = jp.house_code and jp.is_deleted = 0 |
| | | where jtrfr.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg on (jg.grid_code = jh.grid_code or jg.grid_code = jp.grid_code) and jg.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jg.community_code |
| | | WHERE jtrfr.is_deleted = 0 |
| | | <if test="vo.createUser != null and vo.createUser != ''"> |
| | | AND jtrfr.create_user = #{vo.createUser} |
| | | </if> |
| | | |
| | | <if test="communityCode !=null and communityCode !=''"> |
| | | and jg.community_code = #{communityCode} |
| | | </if> |
| | | |
| | | <if test="vo.houseCode != null and vo.houseCode != ''"> |
| | |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | <if test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jg.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | and jg.grid_code in ('') |
| | |
| | | aoiCodeList = districtEntityList.stream().map(i -> i.getAoiCode()).collect(Collectors.toList()); |
| | | } |
| | | |
| | | return page.setRecords(baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), aoiCodeList, commonParamSet.getGridCodeList())); |
| | | List list = baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), aoiCodeList, commonParamSet.getGridCodeList(),commonParamSet.getCommunityCode()); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | /** |