24 changed files with 1144 additions and 33 deletions
@ -0,0 +1,122 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
@Data |
|||
public class ItemHotlineDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 申请时返回的sqid |
|||
*/ |
|||
private String code; |
|||
|
|||
/** |
|||
* 诉求来源 01:12345热线 |
|||
*/ |
|||
private String sjly; |
|||
|
|||
/** |
|||
* 所属机构编码 |
|||
*/ |
|||
private String orgid; |
|||
|
|||
/** |
|||
* 所属机构名称 |
|||
*/ |
|||
private String orgname; |
|||
|
|||
/** |
|||
* 诉求状态字典3.5 |
|||
*/ |
|||
private String sjzt; |
|||
|
|||
/** |
|||
* 是否保密 |
|||
*/ |
|||
private String isbm; |
|||
|
|||
/** |
|||
* 是否公开 |
|||
*/ |
|||
private String ispublic; |
|||
|
|||
/** |
|||
* 诉求标题 |
|||
*/ |
|||
private String sqbt; |
|||
|
|||
/** |
|||
* 诉求内容 |
|||
*/ |
|||
private String sjnr; |
|||
|
|||
/** |
|||
* 诉求ID 青诉即办诉求唯一标识 |
|||
*/ |
|||
private String sqid; |
|||
|
|||
/** |
|||
* 所属专题 01:民生诉求 02:发展诉求 03:执法诉求 字典3.11 |
|||
*/ |
|||
private String sszt; |
|||
|
|||
/** |
|||
* 登记人ID |
|||
*/ |
|||
private String djr; |
|||
|
|||
/** |
|||
* 登记人姓名 |
|||
*/ |
|||
private String djrxm; |
|||
|
|||
/** |
|||
* 地理位置 |
|||
*/ |
|||
private String dlwzmc; |
|||
|
|||
/** |
|||
* 议题位置纬度 |
|||
*/ |
|||
private BigDecimal latitude; |
|||
|
|||
/** |
|||
* 议题位置经度 |
|||
*/ |
|||
private BigDecimal longitude; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.elink.esua.epdc.dto.item.form; |
|||
|
|||
/** |
|||
* @ClassName HotLineFromDTO * @Description TODO |
|||
* @Author Mia |
|||
* @Date 11:10 2024/6/26 |
|||
* @Version 1.0 |
|||
**/ |
|||
public class HotLineFromDTO { |
|||
|
|||
|
|||
/** |
|||
* count : 100 |
|||
* userName : qds |
|||
* pwd : qds |
|||
*/ |
|||
private Integer count; |
|||
private String userName; |
|||
private String pwd; |
|||
|
|||
public void setCount(Integer count) { |
|||
this.count = count; |
|||
} |
|||
|
|||
public void setUserName(String userName) { |
|||
this.userName = userName; |
|||
} |
|||
|
|||
public void setPwd(String pwd) { |
|||
this.pwd = pwd; |
|||
} |
|||
|
|||
public Integer getCount() { |
|||
return count; |
|||
} |
|||
|
|||
public String getUserName() { |
|||
return userName; |
|||
} |
|||
|
|||
public String getPwd() { |
|||
return pwd; |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.elink.esua.epdc.dto.item.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @ClassName UpdateAppealSendDTO * @Description TODO |
|||
* @Author Mia |
|||
* @Date 15:32 2024/6/26 |
|||
* @Version 1.0 |
|||
**/ |
|||
@Data |
|||
public class UpdateAppealSendDTO { |
|||
private String id; |
|||
} |
@ -0,0 +1,193 @@ |
|||
package com.elink.esua.epdc.dto.item.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @ClassName CenterData * @Description TODO 拉取12345 数据 |
|||
* @Author Mia |
|||
* @Date 17:57 2024/6/25 |
|||
* @Version 1.0 |
|||
**/ |
|||
public class CenterData implements Serializable { |
|||
|
|||
/** |
|||
* code : MS370202001-20240624-00001 |
|||
* orgName : 香港中路街道办事处 |
|||
* sjzt : 03 |
|||
* isBm : 0 |
|||
* sqbt : 诉求标题 |
|||
* sqid : fc474b6fe3a64889a0e64faaf5801d21 |
|||
* sszt : 01 |
|||
* djr : 登记人ID |
|||
* orgId : 370214 |
|||
* sjnr : 诉求内容 |
|||
* dlwzmc : 地理位置 |
|||
* sjly : 01 |
|||
* djrxm : 登记人姓名 |
|||
* isPublic : 1 |
|||
* fileList : [{"name":"附件名称","value":"base64"}] |
|||
*/ |
|||
private String code; |
|||
private String orgName; |
|||
private String sjzt; |
|||
private String isBm; |
|||
private String sqbt; |
|||
private String sqid; |
|||
private String sszt; |
|||
private String djr; |
|||
private String orgId; |
|||
private String sjnr; |
|||
private String dlwzmc; |
|||
private String sjly; |
|||
private String djrxm; |
|||
private String isPublic; |
|||
private List<FileListEntity> fileList; |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public void setOrgName(String orgName) { |
|||
this.orgName = orgName; |
|||
} |
|||
|
|||
public void setSjzt(String sjzt) { |
|||
this.sjzt = sjzt; |
|||
} |
|||
|
|||
public void setIsBm(String isBm) { |
|||
this.isBm = isBm; |
|||
} |
|||
|
|||
public void setSqbt(String sqbt) { |
|||
this.sqbt = sqbt; |
|||
} |
|||
|
|||
public void setSqid(String sqid) { |
|||
this.sqid = sqid; |
|||
} |
|||
|
|||
public void setSszt(String sszt) { |
|||
this.sszt = sszt; |
|||
} |
|||
|
|||
public void setDjr(String djr) { |
|||
this.djr = djr; |
|||
} |
|||
|
|||
public void setOrgId(String orgId) { |
|||
this.orgId = orgId; |
|||
} |
|||
|
|||
public void setSjnr(String sjnr) { |
|||
this.sjnr = sjnr; |
|||
} |
|||
|
|||
public void setDlwzmc(String dlwzmc) { |
|||
this.dlwzmc = dlwzmc; |
|||
} |
|||
|
|||
public void setSjly(String sjly) { |
|||
this.sjly = sjly; |
|||
} |
|||
|
|||
public void setDjrxm(String djrxm) { |
|||
this.djrxm = djrxm; |
|||
} |
|||
|
|||
public void setIsPublic(String isPublic) { |
|||
this.isPublic = isPublic; |
|||
} |
|||
|
|||
public void setFileList(List<FileListEntity> fileList) { |
|||
this.fileList = fileList; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getOrgName() { |
|||
return orgName; |
|||
} |
|||
|
|||
public String getSjzt() { |
|||
return sjzt; |
|||
} |
|||
|
|||
public String getIsBm() { |
|||
return isBm; |
|||
} |
|||
|
|||
public String getSqbt() { |
|||
return sqbt; |
|||
} |
|||
|
|||
public String getSqid() { |
|||
return sqid; |
|||
} |
|||
|
|||
public String getSszt() { |
|||
return sszt; |
|||
} |
|||
|
|||
public String getDjr() { |
|||
return djr; |
|||
} |
|||
|
|||
public String getOrgId() { |
|||
return orgId; |
|||
} |
|||
|
|||
public String getSjnr() { |
|||
return sjnr; |
|||
} |
|||
|
|||
public String getDlwzmc() { |
|||
return dlwzmc; |
|||
} |
|||
|
|||
public String getSjly() { |
|||
return sjly; |
|||
} |
|||
|
|||
public String getDjrxm() { |
|||
return djrxm; |
|||
} |
|||
|
|||
public String getIsPublic() { |
|||
return isPublic; |
|||
} |
|||
|
|||
public List<FileListEntity> getFileList() { |
|||
return fileList; |
|||
} |
|||
|
|||
public class FileListEntity { |
|||
/** |
|||
* name : 附件名称 |
|||
* value : base64 |
|||
*/ |
|||
private String name; |
|||
private String value; |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public void setValue(String value) { |
|||
this.value = value; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public String getValue() { |
|||
return value; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.elink.esua.epdc.dto.oss; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author LC |
|||
* @Date 2019/9/11 19:22 |
|||
*/ |
|||
@Data |
|||
public class UploadFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3595962954673866413L; |
|||
|
|||
private String base64String; |
|||
} |
@ -0,0 +1,96 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.events.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.ItemHotlineDTO; |
|||
import com.elink.esua.epdc.modules.events.service.ItemHotlineService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("itemhotline") |
|||
public class ItemHotlineController { |
|||
|
|||
@Autowired |
|||
private ItemHotlineService itemHotlineService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ItemHotlineDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ItemHotlineDTO> page = itemHotlineService.page(params); |
|||
return new Result<PageData<ItemHotlineDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ItemHotlineDTO> get(@PathVariable("id") String id){ |
|||
ItemHotlineDTO data = itemHotlineService.get(id); |
|||
return new Result<ItemHotlineDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ItemHotlineDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
itemHotlineService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ItemHotlineDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
itemHotlineService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
itemHotlineService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
// @GetMapping("export")
|
|||
// public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
|||
// List<ItemHotlineDTO> list = itemHotlineService.list(params);
|
|||
// ExcelUtils.exportExcelToTarget(response, null, list, ItemHotlineExcel.class);
|
|||
// }
|
|||
|
|||
@PostMapping("getHotLine") |
|||
public void getHotLine(){ |
|||
itemHotlineService.getHotLine(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.events.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.events.entity.ItemHotlineEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
@Mapper |
|||
public interface ItemHotlineDao extends BaseDao<ItemHotlineEntity> { |
|||
|
|||
} |
@ -0,0 +1,122 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.events.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_item_hotline") |
|||
public class ItemHotlineEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 申请时返回的sqid |
|||
*/ |
|||
private String code; |
|||
|
|||
/** |
|||
* 诉求来源 01:12345热线 |
|||
*/ |
|||
private String sjly; |
|||
|
|||
/** |
|||
* 所属机构编码 |
|||
*/ |
|||
private String orgid; |
|||
|
|||
/** |
|||
* 所属机构名称 |
|||
*/ |
|||
private String orgname; |
|||
|
|||
/** |
|||
* 诉求状态字典3.5 |
|||
*/ |
|||
private String sjzt; |
|||
|
|||
/** |
|||
* 是否保密 |
|||
*/ |
|||
private String isbm; |
|||
|
|||
/** |
|||
* 是否公开 |
|||
*/ |
|||
private String ispublic; |
|||
|
|||
/** |
|||
* 诉求标题 |
|||
*/ |
|||
private String sqbt; |
|||
|
|||
/** |
|||
* 诉求内容 |
|||
*/ |
|||
private String sjnr; |
|||
|
|||
/** |
|||
* 诉求ID 青诉即办诉求唯一标识 |
|||
*/ |
|||
private String sqid; |
|||
|
|||
/** |
|||
* 所属专题 01:民生诉求 02:发展诉求 03:执法诉求 字典3.11 |
|||
*/ |
|||
private String sszt; |
|||
|
|||
/** |
|||
* 登记人ID |
|||
*/ |
|||
private String djr; |
|||
|
|||
/** |
|||
* 登记人姓名 |
|||
*/ |
|||
private String djrxm; |
|||
|
|||
/** |
|||
* 地理位置 |
|||
*/ |
|||
private String dlwzmc; |
|||
|
|||
/** |
|||
* 议题位置纬度 |
|||
*/ |
|||
private BigDecimal latitude; |
|||
|
|||
/** |
|||
* 议题位置经度 |
|||
*/ |
|||
private BigDecimal longitude; |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.events.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.ItemHotlineDTO; |
|||
import com.elink.esua.epdc.modules.events.entity.ItemHotlineEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
public interface ItemHotlineService extends BaseService<ItemHotlineEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ItemHotlineDTO> |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
PageData<ItemHotlineDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ItemHotlineDTO> |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
List<ItemHotlineDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ItemHotlineDTO |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
ItemHotlineDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
void save(ItemHotlineDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
void update(ItemHotlineDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2024-06-26 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
|
|||
void getHotLine(); |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,138 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.events.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.constant.PushToCityGridConstant; |
|||
import com.elink.esua.epdc.dto.ItemHotlineDTO; |
|||
import com.elink.esua.epdc.dto.item.form.UpdateAppealSendDTO; |
|||
import com.elink.esua.epdc.dto.item.result.CenterData; |
|||
import com.elink.esua.epdc.dto.oss.UploadFormDTO; |
|||
import com.elink.esua.epdc.modules.events.dao.ItemHotlineDao; |
|||
import com.elink.esua.epdc.modules.events.entity.ItemHotlineEntity; |
|||
import com.elink.esua.epdc.modules.events.service.ItemHotlineService; |
|||
import com.elink.esua.epdc.modules.feign.OssFeignClient; |
|||
import com.elink.esua.epdc.modules.item.service.impl.PushToCityGridServiceImpl; |
|||
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 java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 12345热线数据 |
|||
* |
|||
* @author elink elink@elink-cn.com |
|||
* @since v1.0.0 2024-06-26 |
|||
*/ |
|||
@Service |
|||
public class ItemHotlineServiceImpl extends BaseServiceImpl<ItemHotlineDao, ItemHotlineEntity> implements ItemHotlineService { |
|||
|
|||
@Autowired |
|||
private PushToCityGridServiceImpl pushToCityGridServiceImpl; |
|||
|
|||
@Autowired |
|||
private OssFeignClient ossFeignClient; |
|||
|
|||
@Override |
|||
public PageData<ItemHotlineDTO> page(Map<String, Object> params) { |
|||
IPage<ItemHotlineEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ItemHotlineDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ItemHotlineDTO> list(Map<String, Object> params) { |
|||
List<ItemHotlineEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ItemHotlineDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ItemHotlineEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ItemHotlineEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ItemHotlineDTO get(String id) { |
|||
ItemHotlineEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ItemHotlineDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ItemHotlineDTO dto) { |
|||
ItemHotlineEntity entity = ConvertUtils.sourceToTarget(dto, ItemHotlineEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ItemHotlineDTO dto) { |
|||
ItemHotlineEntity entity = ConvertUtils.sourceToTarget(dto, ItemHotlineEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public void getHotLine() { |
|||
List<CenterData> centerHotLine = pushToCityGridServiceImpl.getCenterHotLine(); |
|||
List<ItemHotlineEntity> itemHotlineDTOList = ConvertUtils.sourceToTarget(centerHotLine, ItemHotlineEntity.class); |
|||
// 插入12345 数据
|
|||
// insertBatch(itemHotlineDTOList);
|
|||
|
|||
UploadFormDTO dto = new UploadFormDTO(); |
|||
UpdateAppealSendDTO appealSendDTO = new UpdateAppealSendDTO(); |
|||
for (CenterData item : centerHotLine) { |
|||
ItemHotlineEntity itemHotlineEntity = ConvertUtils.sourceToTarget(item, ItemHotlineEntity.class); |
|||
// 存入12345表
|
|||
baseDao.insert(itemHotlineEntity); |
|||
// 存入之后 告知市里
|
|||
appealSendDTO.setId(item.getSqid()); |
|||
pushToCityGridServiceImpl.sendAppealState(appealSendDTO); |
|||
|
|||
for (CenterData.FileListEntity entity : item.getFileList()) { |
|||
// 存附件
|
|||
dto.setBase64String(entity.getValue()); |
|||
ossFeignClient.uploadBase64(dto); |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.events.dao.ItemHotlineDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.events.entity.ItemHotlineEntity" id="itemHotlineMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="code" column="code"/> |
|||
<result property="sjly" column="sjly"/> |
|||
<result property="orgid" column="orgId"/> |
|||
<result property="orgname" column="orgName"/> |
|||
<result property="sjzt" column="sjzt"/> |
|||
<result property="isbm" column="isBm"/> |
|||
<result property="ispublic" column="isPublic"/> |
|||
<result property="sqbt" column="sqbt"/> |
|||
<result property="sjnr" column="sjnr"/> |
|||
<result property="sqid" column="sqid"/> |
|||
<result property="sszt" column="sszt"/> |
|||
<result property="djr" column="djr"/> |
|||
<result property="djrxm" column="djrxm"/> |
|||
<result property="dlwzmc" column="dlwzmc"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,10 @@ |
|||
package com.elink.esua.epdc.task.events; |
|||
|
|||
/** |
|||
* 定时任务:青岛12345热线数据接收接口 |
|||
*/ |
|||
public interface ItemHotLineTask { |
|||
|
|||
void run(String param); |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.task.events; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.ItemFeignClient; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 定时任务(半小时一执行):青岛12345热线数据接收接口 |
|||
*/ |
|||
@Component("ItemHotLineTask") |
|||
@Slf4j |
|||
public class ItemHotLineTaskImpl implements ItemHotLineTask { |
|||
|
|||
@Autowired |
|||
private ItemFeignClient itemFeignClient; |
|||
|
|||
@Override |
|||
public void run(String param) { |
|||
log.info("ItemHotLineTaskImpl定时任务开始执行,参数为:{}", param); |
|||
Result result = itemFeignClient.getHotLine(); |
|||
if (result.success()) { |
|||
log.info("{}定时任务执行成功,{}", getClass().getSimpleName(), param); |
|||
} else { |
|||
log.error("{}定时任务执行失败:{},param:{}", getClass().getSimpleName(), result.getMsg(), param); |
|||
} |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue