26 files modified
1 files added
| | |
| | | */ |
| | | package org.springblade.modules.customTask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | |
| | | /** 更新时间 */ |
| | | @ApiModelProperty(value = "更新时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("update_time") |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** 创建时间 */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("create_time") |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** 创建人 */ |
| | |
| | | @ApiModelProperty(value = "任务id", example = "") |
| | | @TableField("job_id") |
| | | private Integer jobId; |
| | | |
| | | @ApiModelProperty(value = "任务范围", example = "") |
| | | @TableField("task_range") |
| | | private String taskRange; |
| | | } |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="cron" column="cron" /> |
| | | <result property="taskStatus" column="task_status" /> |
| | | <result property="taskRange" column="task_range" /> |
| | | <result property="jobId" column="job_id" /> |
| | | </resultMap> |
| | | |
| | |
| | | task_type, |
| | | label_id, |
| | | label_color, |
| | | category_id, |
| | | place_label, |
| | | place_small_label, |
| | | nineType, |
| | | delete_flag, |
| | | update_time, |
| | | create_time, |
| | | create_by, |
| | | update_by |
| | | update_by, |
| | | cron, |
| | | task_range, |
| | | task_status, |
| | | job_id |
| | | from |
| | | jczz_custom_task |
| | | </sql> |
| | |
| | | <if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if> |
| | | <if test="labelId != null "> and label_id = #{labelId}</if> |
| | | <if test="labelColor != null and labelColor != ''"> and label_color = #{labelColor}</if> |
| | | <if test="categoryId != null "> and category_id = #{categoryId}</if> |
| | | <if test="placeLabel != null "> and place_label = #{placeLabel}</if> |
| | | <if test="placeSmallLabel != null and placeSmallLabel != ''"> and place_small_label = #{placeSmallLabel}</if> |
| | | <if test="nineType != null "> and nineType = #{nineType}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="createBy != null "> and create_by = #{createBy}</if> |
| | | <if test="updateBy != null "> and update_by = #{updateBy}</if> |
| | | <if test="cron != null and cron != ''"> and cron = #{cron}</if> |
| | | <if test="taskRange != null and taskRange != ''"> and task_range = #{taskRange}</if> |
| | | <if test="taskStatus != null and taskStatus != ''"> and task_status = #{taskStatus}</if> |
| | | <if test="jobId != null "> and job_id = #{jobId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | setGridInfo(record); |
| | | addList.add(record); |
| | | } else { |
| | | setGridInfo(record); |
| | | updateList.add(record); |
| | | } |
| | | }); |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入gridWorkLog") |
| | | public R<GridWorkLogVO> detail(GridWorkLogEntity gridWorkLog) { |
| | | GridWorkLogEntity detail = gridWorkLogService.getOne(Condition.getQueryWrapper(gridWorkLog)); |
| | | return R.data(GridWorkLogWrapper.build().entityVO(detail)); |
| | | GridWorkLogVO detail = gridWorkLogService.getDetail(gridWorkLog); |
| | | return R.data(detail); |
| | | } |
| | | /** |
| | | * 网格工作日志表 分页 |
| | |
| | | * @return |
| | | */ |
| | | Integer getGridWorkCountHandleCount(@Param("gridCode") String gridCode,@Param("status") Integer status); |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param gridWorkLog |
| | | * @return |
| | | */ |
| | | GridWorkLogVO getDetail(GridWorkLogEntity gridWorkLog); |
| | | } |
| | |
| | | left join jczz_house jhs on jhs.house_code=jh.house_code and jhs.is_deleted = 0 |
| | | where jgwl.is_deleted = 0 |
| | | <if test="status!=null"> |
| | | and jgwl.status = #{status} |
| | | and (jgwl.status = #{status} or jgwl.status = 4) |
| | | </if> |
| | | <if test="gridCode!=null and gridCode!=''"> |
| | | and jhs.grid_code = #{gridCode} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="getDetail" resultType="org.springblade.modules.grid.vo.GridWorkLogVO"> |
| | | |
| | | SELECT |
| | | jgwl.id, |
| | | jgwl.type, |
| | | jgwl.person_type, |
| | | jgwl.household_id, |
| | | jgwl.context, |
| | | jgwl.url, |
| | | jgwl.work_time, |
| | | jgwl.source, |
| | | jgwl.status, |
| | | jgwl.create_time, |
| | | jgwl.create_user, |
| | | jgwl.is_deleted, |
| | | jl.label_name |
| | | FROM |
| | | jczz_grid_work_log jgwl |
| | | LEFT JOIN jczz_label jl ON jgwl.person_type = jl.id |
| | | <where> |
| | | <if test="id != null ">and jgwl.id = #{id}</if> |
| | | <if test="type != null ">and jgwl.type = #{type}</if> |
| | | <if test="personType != null ">and jgwl.person_type = #{personType}</if> |
| | | <if test="householdId != null ">and jgwl.household_id = #{householdId}</if> |
| | | <if test="context != null and context != ''">and jgwl.context = #{context}</if> |
| | | <if test="url != null and url != ''">and jgwl.url = #{url}</if> |
| | | <if test="workTime != null ">and jgwl.work_time = #{workTime}</if> |
| | | <if test="source != null ">and jgwl.source = #{source}</if> |
| | | <if test="status != null ">and jgwl.status = #{status}</if> |
| | | <if test="createTime != null ">and jgwl.create_time = #{createTime}</if> |
| | | <if test="createUser != null ">and jgwl.create_user = #{createUser}</if> |
| | | <if test="isDeleted != null ">and jgwl.is_deleted = #{isDeleted}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | Integer getGridWorkCountHandleCount(String gridCode, Integer status); |
| | | |
| | | /** |
| | | * |
| | | * @param gridWorkLog |
| | | * @return |
| | | */ |
| | | GridWorkLogVO getDetail(GridWorkLogEntity gridWorkLog); |
| | | } |
| | |
| | | @Override |
| | | public IPage<GridWorkLogVO> selectGridWorkLogPage(IPage<GridWorkLogVO> page, GridWorkLogVO gridWorkLog) { |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(GridWorkLogVO.class,gridWorkLog); |
| | | if (!Strings.isBlank(gridWorkLog.getRoleName()) && gridWorkLog.getRoleName().equals("网格员")){ |
| | | if (!Strings.isBlank(gridWorkLog.getRoleName()) && gridWorkLog.getRoleName().equals("wgy")){ |
| | | gridWorkLog.setGridId(getGridId()); |
| | | } |
| | | return page.setRecords(baseMapper.selectGridWorkLogPage(page, |
| | |
| | | public Integer getGridWorkCountHandleCount(String gridCode, Integer status) { |
| | | return baseMapper.getGridWorkCountHandleCount(gridCode,status); |
| | | } |
| | | |
| | | @Override |
| | | public GridWorkLogVO getDetail(GridWorkLogEntity gridWorkLog) { |
| | | return baseMapper.getDetail(gridWorkLog); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String communityCode; |
| | | |
| | | @ApiModelProperty(value = "标签名称") |
| | | private String labelName; |
| | | |
| | | } |
| | |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | private String taskRange; |
| | | |
| | | } |
| | |
| | | import org.springblade.modules.house.dto.UserHouseLabelDTO; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseholdLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<UserHouseLabelEntity> getLabelList(@Param("labelNames") String labelName); |
| | | |
| | | List<HouseholdLabelVO> followStatisticalLabels(IPage page, @Param("householdLabel") HouseholdLabelVO householdLabel); |
| | | |
| | | /** |
| | | * |
| | | * @param userHouseLabelVO |
| | | * @return |
| | | */ |
| | | List<UserHouseLabelEntity> getUserHouseLabelList(@Param("userHouseLabelVO") UserHouseLabelVO userHouseLabelVO); |
| | | } |
| | |
| | | LEFT JOIN jczz_label jl ON juhl.label_id = jl.id |
| | | WHERE |
| | | juhl.lable_type = 1 |
| | | AND jl.id = '1033' |
| | | AND jl.id = '1025' |
| | | AND juhl.household_id IS NOT NULL |
| | | AND juhl.house_code IN ( |
| | | SELECT |
| | |
| | | LEFT JOIN jczz_label jl ON juhl.label_id = jl.id |
| | | WHERE |
| | | juhl.lable_type = 1 |
| | | AND jl.id = '15' |
| | | AND jl.id = '23' |
| | | AND juhl.household_id IS NOT NULL |
| | | AND juhl.house_code IN ( |
| | | SELECT |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getUserHouseLabelList" resultType="org.springblade.modules.house.entity.UserHouseLabelEntity"> |
| | | SELECT |
| | | juhl.id, |
| | | juhl.house_code, |
| | | juhl.label_id, |
| | | juhl.label_name, |
| | | juhl.color, |
| | | juhl.remark, |
| | | juhl.user_id, |
| | | juhl.lable_type, |
| | | juhl.household_id |
| | | FROM |
| | | jczz_user_house_label juhl |
| | | LEFT JOIN jczz_house jh ON juhl.house_code = jh.house_code |
| | | LEFT JOIN jczz_grid jg on jg.id= jh.grid_id |
| | | LEFT JOIN blade_region br on br.code = jg.community_code |
| | | <where> |
| | | juhl.lable_type = 1 |
| | | and juhl.color = #{userHouseLabelVO.color} |
| | | and juhl.label_id = #{userHouseLabelVO.labelId} |
| | | and juhl.household_id is not null |
| | | <if test="userHouseLabelVO.taskRange != null ">and br.code like concat(#{userHouseLabelVO.taskRange},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.excel.UserHouseLabelExcel; |
| | | import org.springblade.modules.house.vo.HouseholdLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | IPage<HouseholdLabelVO> followStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel); |
| | | |
| | | /** |
| | | * 查询对应的label集合信息 |
| | | * @param userHouseLabelVO |
| | | * @return |
| | | */ |
| | | List<UserHouseLabelEntity> getUserHouseLabelList(UserHouseLabelVO userHouseLabelVO); |
| | | } |
| | |
| | | import org.springblade.modules.house.mapper.UserHouseLabelMapper; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.modules.house.vo.HouseholdLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.label.service.impl.LabelServiceImpl; |
| | |
| | | public List<UserHouseLabelEntity> getLabelList(String labelName) { |
| | | return baseMapper.getLabelList(labelName); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserHouseLabelEntity> getUserHouseLabelList(UserHouseLabelVO userHouseLabelVO) { |
| | | return baseMapper.getUserHouseLabelList(userHouseLabelVO); |
| | | } |
| | | } |
| | |
| | | public R getNearbyPlaceList(@RequestParam("lat") String lat, @RequestParam("lng") String lng) { |
| | | return R.data(placeService.getNearbyPlaceList(lat, lng)); |
| | | } |
| | | |
| | | /** |
| | | * 更新场所的POI标签颜色 |
| | | * @param placeId |
| | | * @param color |
| | | * @return |
| | | */ |
| | | @GetMapping("/updatePoiLabelColor") |
| | | public R updatePoiLabelColor(@RequestParam("placeId") Long placeId, @RequestParam("color") String color) { |
| | | return R.data(placeService.updatePoiLabelColor(placeId, color)); |
| | | } |
| | | } |
| | |
| | | jp.universal_account |
| | | from |
| | | jczz_place jp |
| | | LEFT JOIN jczz_place_poi_label jppl ON jppl.place_id = jp.id |
| | | LEFT JOIN jczz_place_poi_label jppl ON jppl.place_id = jp.id and jppl.type = 3 |
| | | LEFT JOIN jczz_grid jg on jg.id = jp.grid_id |
| | | LEFT JOIN blade_region br on br.code = jg.community_code |
| | | <where> |
| | | <if test="place.id != null "> and id = #{place.id}</if> |
| | | <if test="place.houseCode != null and place.houseCode != ''"> and house_code = #{place.houseCode}</if> |
| | |
| | | <if test="place.noExplosionCategory != null "> and no_explosion_category = #{place.noExplosionCategory}</if> |
| | | <if test="place.principalAccount != null "> and principal_account = #{place.principalAccount}</if> |
| | | <if test="place.universalAccount != null "> and universal_account = #{place.universalAccount}</if> |
| | | <if test="place.poiCodes != null "> and jppl.poi_code = #{place.poiCodes}</if> |
| | | <if test="place.placeSmallLabel != null "> and jppl.poi_code = #{place.placeSmallLabel}</if> |
| | | <if test="place.color != null "> and jppl.color = #{place.color}</if> |
| | | <if test="place.taskRange != null "> and br.code like concat(#{place.taskRange},'%') </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<PlaceVO> getNearbyPlaceList(String lat, String lng); |
| | | |
| | | /** |
| | | * 更新场所颜色 |
| | | * @param placeId |
| | | * @param color |
| | | * @return |
| | | */ |
| | | boolean updatePoiLabelColor(Long placeId, String color); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询附近场所 |
| | | * |
| | | * @param lat |
| | | * @param lng |
| | | * @return |
| | |
| | | public List<PlaceVO> getNearbyPlaceList(String lat, String lng) { |
| | | return baseMapper.getNearbyPlaceList(lat, lng); |
| | | } |
| | | |
| | | /** |
| | | * 更新场所颜色 |
| | | * |
| | | * @param placeId |
| | | * @param color |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updatePoiLabelColor(Long placeId, String color) { |
| | | List<PlacePoiLabel> list = placePoiLabelService.list(Wrappers.<PlacePoiLabel>lambdaQuery() |
| | | .eq(PlacePoiLabel::getPlaceId, placeId).eq(PlacePoiLabel::getType, 3)); |
| | | for (PlacePoiLabel placePoiLabel : list) { |
| | | if (null != placePoiLabel) { |
| | | placePoiLabel.setColor(color); |
| | | return placePoiLabelService.updateById(placePoiLabel); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.place.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import liquibase.pro.packaged.S; |
| | |
| | | @ApiModelProperty(value = "标签id集合") |
| | | private List<String> poiCodeList ; |
| | | |
| | | /** 分类id */ |
| | | @ApiModelProperty(value = "分类id", example = "") |
| | | private Integer placeLabel; |
| | | |
| | | |
| | | /** 分类id */ |
| | | @ApiModelProperty(value = "分类id", example = "") |
| | | private Integer placeSmallLabel; |
| | | |
| | | /** |
| | | * 房屋绑定 |
| | | */ |
| | |
| | | */ |
| | | private List<PlacePractitionerEntity> placePractitioner = new ArrayList<>(); |
| | | |
| | | @ApiModelProperty(value = "任务范围", example = "") |
| | | private String taskRange; |
| | | |
| | | } |
| | |
| | | br.district_code regionCode, |
| | | br.village_code neiCode, |
| | | br.town_code streetCode, |
| | | jp.principal as realName, |
| | | jp.principal_phone as phone, |
| | | jp.principal AS realName, |
| | | jp.principal_phone AS phone, |
| | | jp.nine_type, |
| | | jp.front_type, |
| | | jp.place_name, |
| | |
| | | jt.source, |
| | | jt.is_deleted, |
| | | jt.house_code, |
| | | jppl.color, |
| | | jc.category_name, |
| | | jt.report_type |
| | | FROM |
| | | jczz_task jt |
| | | LEFT JOIN jczz_place jp ON jt.house_code=jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN blade_user bu on bu.id = jt.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg on jg.grid_code = jp.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN blade_region br on br.code = jg.community_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN jczz_place jp ON jt.house_code = jp.house_code |
| | | AND jp.is_deleted = 0 |
| | | LEFT JOIN blade_user bu ON bu.id = jt.create_user |
| | | AND bu.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code |
| | | AND jg.is_deleted = 0 |
| | | LEFT JOIN blade_region br ON br.CODE = jg.community_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag ON jp.jw_grid_code = jpag.jw_grid_code |
| | | AND jpag.is_deleted = 0 |
| | | LEFT JOIN jczz_place_poi_label jppl on jppl.place_id = jp.id and jppl.type = 3 |
| | | LEFT JOIN jczz_category jc on jc.category_no = jppl.poi_code |
| | | <where> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | |
| | | <!--自定义分页查询--> |
| | | <select id="selectTaskPlaceSelfCheckPage" resultMap="taskPlaceSelfCheckResultMap"> |
| | | select jpc.*, |
| | | jp.id jpid, |
| | | jp.id placeId, |
| | | jp.place_name, |
| | | jp.location, |
| | | jg.grid_name, |
| | |
| | | br.village_name as communityName, |
| | | bu.`name`, |
| | | jpe.legal_tel, |
| | | jpe.legal_person |
| | | jpe.legal_person, |
| | | jppl.color |
| | | FROM jczz_task_place_self_check jpc |
| | | LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code and jg.is_deleted = 0 |
| | |
| | | LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0 |
| | | LEFT JOIN blade_user bu ON bu.id = jpc.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | LEFT JOIN jczz_place_poi_label jppl on jppl.place_id = jp.id |
| | | <where> |
| | | and jp.house_code is not null |
| | | and jppl.type = 3 |
| | | <if test="place.id != null ">and jpc.id = #{place.id}</if> |
| | | <if test="place.taskId != null ">and jpc.task_id = #{place.taskId}</if> |
| | | <if test="place.taskName != null and place.taskName != ''">and jpc.task_name = #{place.taskName}</if> |
| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.binlog.listener.BinlogListenerMixed; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | @Component("SelfExaminationTaskHandler") |
| | | public class SelfExaminationTaskHandler implements TaskHandle { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(SelfExaminationTaskHandler.class); |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | |
| | |
| | | Query query = new Query(); |
| | | IPage<PlaceVO> page = Condition.getPage(query); |
| | | PlaceVO placeVO = new PlaceVO(); |
| | | placeVO.setPoiCodes(customTask.getPlaceLabel().toString()); |
| | | placeVO.setPlaceLabel(customTask.getPlaceLabel()); |
| | | placeVO.setPlaceSmallLabel(customTask.getPlaceSmallLabel()); |
| | | placeVO.setNineType(customTask.getNineType()); |
| | | placeVO.setColor(customTask.getLabelColor()); |
| | | placeVO.setTaskRange(customTask.getTaskRange()); |
| | | IPage<PlaceVO> placePage = placeService.getPlacePage(page, placeVO); |
| | | ITaskService iTaskService = SpringUtils.getBean(ITaskService.class); |
| | | // 计算总页数 |
| | | long pages = placePage.getPages(); |
| | | System.out.println("总页数:" + pages); |
| | | for (int i = 1; i <= pages; i++) { |
| | | page = Condition.getPage(query); |
| | | page.setCurrent(i); |
| | |
| | | placePage.getRecords().forEach(place -> { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setType(1); |
| | | taskEntity.setName("自查"); |
| | | taskEntity.setName(customTask.getName()); |
| | | taskEntity.setCreateTime(new Date()); |
| | | taskEntity.setHouseCode(place.getHouseCode()); |
| | | taskEntity.setReportType(7); |
| | |
| | | taskPlaceSelfCheck.setHouseCode(place.getHouseCode()); |
| | | taskPlaceSelfCheck.setPlaceName(place.getPlaceName()); |
| | | taskPlaceSelfCheck.setStatus(4); |
| | | taskPlaceSelfCheck.setType("1"); |
| | | taskPlaceSelfCheckService.save(taskPlaceSelfCheck); |
| | | // taskPlaceSelfCheckList.add(taskPlaceSelfCheck); |
| | | }); |
| | |
| | | import org.springblade.modules.grid.service.IGridWorkLogService; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.task.service.TaskHandle; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public void taskHandle(CustomTaskEntity customTask) { |
| | | System.out.println("走访任务"); |
| | | // 查询有标签的颜色的人 |
| | | List<UserHouseLabelEntity> list = userHouseLabelService.list(Wrappers.<UserHouseLabelEntity>lambdaQuery() |
| | | .eq(UserHouseLabelEntity::getLableType, 1) |
| | | .eq(UserHouseLabelEntity::getLabelId, customTask.getLabelId()) |
| | | .eq(UserHouseLabelEntity::getColor, customTask.getLabelColor()) |
| | | .isNotNull(UserHouseLabelEntity::getHouseholdId)); |
| | | // List<UserHouseLabelEntity> list = userHouseLabelService.list(Wrappers.<UserHouseLabelEntity>lambdaQuery() |
| | | // .eq(UserHouseLabelEntity::getLableType, 1) |
| | | // .eq(UserHouseLabelEntity::getLabelId, customTask.getLabelId()) |
| | | // .eq(UserHouseLabelEntity::getColor, customTask.getLabelColor()) |
| | | // .isNotNull(UserHouseLabelEntity::getHouseholdId)); |
| | | UserHouseLabelVO userHouseLabelVO = new UserHouseLabelVO(); |
| | | userHouseLabelVO.setLabelId(customTask.getLabelId().longValue()); |
| | | userHouseLabelVO.setColor(customTask.getLabelColor()); |
| | | userHouseLabelVO.setTaskRange(customTask.getTaskRange()); |
| | | List<UserHouseLabelEntity> list = userHouseLabelService.getUserHouseLabelList(userHouseLabelVO); |
| | | List<GridWorkLogEntity> gridWorkLogEntities = new ArrayList<>(); |
| | | list.forEach(userHouseLabelEntity -> { |
| | | // 创建任务 |
| | | GridWorkLogEntity gridWorkLogEntity = new GridWorkLogEntity(); |
| | | gridWorkLogEntity.setType(1); |
| | | gridWorkLogEntity.setType(2); |
| | | gridWorkLogEntity.setHouseholdId(userHouseLabelEntity.getHouseholdId()); |
| | | gridWorkLogEntity.setPersonType(1); |
| | | gridWorkLogEntity.setPersonType(customTask.getLabelId()); |
| | | gridWorkLogEntity.setSource(2); |
| | | gridWorkLogEntity.setStatus(1); |
| | | gridWorkLogEntities.add(gridWorkLogEntity); |
| | |
| | | // 社区编号 |
| | | @ApiModelProperty(value = "社区编号", example = "") |
| | | private String communityCode; |
| | | |
| | | @ApiModelProperty(value = "颜色", example = "") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "场所id", example = "") |
| | | private Long placeId; |
| | | |
| | | } |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date returnTime; |
| | | |
| | | @ApiModelProperty(value = "颜色") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "分类名称") |
| | | private String categoryName; |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private ITaskService taskService; |
| | | |
| | | @Autowired |
| | | private EcOrderService ecOrderService; |
| | | |
| | | /** |
| | | * 三色定时任务 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建校园安全发送短信定时任务 0 15 0 * * ? |
| | | */ |
| | | @XxlJob("ehjbJobHandler") |
| | | public void ehjbJobHandler (){ |
| | | XxlJobHelper.log("开始执行任务...E呼即办定时任务"); |
| | | // 创建居住证发送短信定时任务 |
| | | EcOrderParamDTO ecOrderParamDTO = new EcOrderParamDTO(); |
| | | // 获取当前日期时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | // 获取前一天的开始时间 |
| | | LocalDateTime yesterdayStart = now.minus(1, ChronoUnit.DAYS).with(LocalTime.MIN); |
| | | // 获取前一天的结束时间 |
| | | LocalDateTime yesterdayEnd = now.minus(1, ChronoUnit.DAYS).with(LocalTime.MAX); |
| | | ecOrderParamDTO.setEndTime(yesterdayEnd.format(DateUtil.DATETIME_FORMATTER)); |
| | | ecOrderParamDTO.setStartTime(yesterdayStart.format(DateUtil.DATETIME_FORMATTER)); |
| | | boolean result = ecOrderService.SynchronizeData(ecOrderParamDTO); |
| | | XxlJobHelper.log("任务响应结果..." + result); |
| | | XxlJobHelper.log("E呼即办定时任务-结束自动创建任务..."); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.xxljob.jobhandler; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.xxl.job.core.context.XxlJobHelper; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.modules.eCallEventTwo.dto.EcOrderParamDTO; |
| | | import org.springblade.modules.eCallEventTwo.service.EcOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.temporal.ChronoUnit; |
| | | |
| | | @Component |
| | | public class SynchronizationEhjb { |
| | | |
| | | |
| | | @Autowired |
| | | private EcOrderService ecOrderService; |
| | | |
| | | @XxlJob("ehjbJobHandler") |
| | | public void ehjbJobHandler() { |
| | | String param = XxlJobHelper.getJobParam(); |
| | | |
| | | XxlJobHelper.log("开始执行任务..." + param); |
| | | |
| | | // 校园安全检查 |
| | | // 根据类型创建任务 |
| | | XxlJobHelper.log("开始执行任务...E呼即办定时任务"); |
| | | LocalDateTime localDateTime; |
| | | if (StringUtils.isNotBlank(param)) { |
| | | // 时间字符串转LocalDateTime |
| | | localDateTime = cn.hutool.core.date.DateUtil.parseLocalDateTime(param, DatePattern.NORM_DATETIME_PATTERN); |
| | | } else { |
| | | // 获取当前日期时间 |
| | | localDateTime = LocalDateTime.now(); |
| | | } |
| | | // 创建居住证发送短信定时任务 |
| | | EcOrderParamDTO ecOrderParamDTO = new EcOrderParamDTO(); |
| | | // 获取前一天的开始时间 |
| | | LocalDateTime yesterdayStart = localDateTime.minus(1, ChronoUnit.DAYS).with(LocalTime.MIN); |
| | | // 获取前一天的结束时间 |
| | | LocalDateTime yesterdayEnd = localDateTime.minus(1, ChronoUnit.DAYS).with(LocalTime.MAX); |
| | | ecOrderParamDTO.setEndTime(yesterdayEnd.format(DateUtil.DATETIME_FORMATTER)); |
| | | ecOrderParamDTO.setStartTime(yesterdayStart.format(DateUtil.DATETIME_FORMATTER)); |
| | | boolean result = ecOrderService.SynchronizeData(ecOrderParamDTO); |
| | | XxlJobHelper.log("任务响应结果..." + result); |
| | | XxlJobHelper.log("E呼即办定时任务-结束自动创建任务..."); |
| | | } |
| | | } |