Browse Source
# Conflicts: # esua-epdc/kettle-Code/governanceRankingMonth/blow_whistle/同步到中间表/吹哨-项目-月-基础数据.ktrfeature/dangjian
12 changed files with 812 additions and 44 deletions
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* 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; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ItemFusingDelayRecordDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String itemId; |
||||
|
|
||||
|
/** |
||||
|
* 申请状态:1-延期,2-熔断 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
private String stateName; |
||||
|
|
||||
|
/** |
||||
|
* 申请理由 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 审核状态:1-审核通过,2-驳回 |
||||
|
*/ |
||||
|
private Integer handleState; |
||||
|
private String handleStateName; |
||||
|
|
||||
|
/** |
||||
|
* 审批理由 |
||||
|
*/ |
||||
|
private String handleReason; |
||||
|
|
||||
|
/** |
||||
|
* 延期时间 |
||||
|
*/ |
||||
|
private Date delayTime; |
||||
|
private String delayTimeStr; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除标记 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
/** |
||||
|
* 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.item.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.ItemFusingDelayRecordDTO; |
||||
|
import com.elink.esua.epdc.dto.item.form.ItemFusingDelayInsertDTO; |
||||
|
import com.elink.esua.epdc.modules.item.excel.ItemFusingDelayRecordExcel; |
||||
|
import com.elink.esua.epdc.modules.item.service.ItemFusingDelayRecordService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("itemfusingdelayrecord") |
||||
|
public class ItemFusingDelayRecordController { |
||||
|
|
||||
|
@Autowired |
||||
|
private ItemFusingDelayRecordService itemFusingDelayRecordService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<ItemFusingDelayRecordDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<ItemFusingDelayRecordDTO> page = itemFusingDelayRecordService.getPhrasePage(params); |
||||
|
return new Result<PageData<ItemFusingDelayRecordDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<ItemFusingDelayRecordDTO> get(@PathVariable("id") String id){ |
||||
|
ItemFusingDelayRecordDTO data = itemFusingDelayRecordService.get(id); |
||||
|
return new Result<ItemFusingDelayRecordDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody ItemFusingDelayRecordDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
itemFusingDelayRecordService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("submitApply") |
||||
|
public Result submitApply(@RequestBody ItemFusingDelayRecordDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
itemFusingDelayRecordService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping("checkApply") |
||||
|
public Result checkApply(@RequestBody ItemFusingDelayRecordDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
itemFusingDelayRecordService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("getPageList/{itemId}") |
||||
|
public Result<List<ItemFusingDelayRecordDTO>> getPageList(@PathVariable("itemId") String itemId){ |
||||
|
List<ItemFusingDelayRecordDTO> list = itemFusingDelayRecordService.getPageList(itemId); |
||||
|
return new Result<List<ItemFusingDelayRecordDTO>>().ok(list); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody ItemFusingDelayRecordDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
itemFusingDelayRecordService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
itemFusingDelayRecordService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<ItemFusingDelayRecordDTO> list = itemFusingDelayRecordService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, ItemFusingDelayRecordExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
/** |
||||
|
* 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.item.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.ItemFusingDelayRecordDTO; |
||||
|
import com.elink.esua.epdc.modules.item.entity.ItemFusingDelayRecordEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ItemFusingDelayRecordDao extends BaseDao<ItemFusingDelayRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 条件查询 |
||||
|
* @param params |
||||
|
* @return |
||||
|
*/ |
||||
|
List<ItemFusingDelayRecordDTO> getPhrasePage(Map<String, Object> params); |
||||
|
|
||||
|
List<ItemFusingDelayRecordDTO> getPageList(@Param("itemId") String itemId); |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
/** |
||||
|
* 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.item.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_item_fusing_delay_record") |
||||
|
public class ItemFusingDelayRecordEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String itemId; |
||||
|
|
||||
|
/** |
||||
|
* 申请状态:1-延期,2-熔断 |
||||
|
*/ |
||||
|
private Integer state; |
||||
|
|
||||
|
/** |
||||
|
* 申请理由 |
||||
|
*/ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 审核状态:1-审核通过,2-驳回 |
||||
|
*/ |
||||
|
private Integer handleState; |
||||
|
|
||||
|
/** |
||||
|
* 审批理由 |
||||
|
*/ |
||||
|
private String handleReason; |
||||
|
|
||||
|
/** |
||||
|
* 延期时间 |
||||
|
*/ |
||||
|
private Date delayTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
/** |
||||
|
* 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.item.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ItemFusingDelayRecordExcel { |
||||
|
|
||||
|
@Excel(name = "主键") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "项目ID") |
||||
|
private String itemId; |
||||
|
|
||||
|
@Excel(name = "申请状态:1-延期,2-熔断") |
||||
|
private Integer state; |
||||
|
|
||||
|
@Excel(name = "申请理由") |
||||
|
private String reason; |
||||
|
|
||||
|
@Excel(name = "审核状态:1-审核通过,2-驳回") |
||||
|
private Integer handleState; |
||||
|
|
||||
|
@Excel(name = "审批理由") |
||||
|
private String handleReason; |
||||
|
|
||||
|
@Excel(name = "延期时间") |
||||
|
private Date delayTime; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
@Excel(name = "删除标记") |
||||
|
private String delFlag; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* 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.item.redis; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ItemFusingDelayRecordRedis { |
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
|
||||
|
public void delete(Object[] ids) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void set(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String get(String id){ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,104 @@ |
|||||
|
/** |
||||
|
* 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.item.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.ItemFusingDelayRecordDTO; |
||||
|
import com.elink.esua.epdc.modules.item.entity.ItemFusingDelayRecordEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
public interface ItemFusingDelayRecordService extends BaseService<ItemFusingDelayRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<ItemFusingDelayRecordDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
PageData<ItemFusingDelayRecordDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 分页条件查询 |
||||
|
* @param params |
||||
|
* @return |
||||
|
*/ |
||||
|
PageData<ItemFusingDelayRecordDTO> getPhrasePage(Map<String, Object> params); |
||||
|
|
||||
|
List<ItemFusingDelayRecordDTO> getPageList(String itemId); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<ItemFusingDelayRecordDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
List<ItemFusingDelayRecordDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return ItemFusingDelayRecordDTO |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
ItemFusingDelayRecordDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
void save(ItemFusingDelayRecordDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
void update(ItemFusingDelayRecordDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2022-01-05 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
} |
@ -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.item.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.dto.ItemFusingDelayRecordDTO; |
||||
|
import com.elink.esua.epdc.modules.item.dao.ItemFusingDelayRecordDao; |
||||
|
import com.elink.esua.epdc.modules.item.entity.ItemFusingDelayRecordEntity; |
||||
|
import com.elink.esua.epdc.modules.item.redis.ItemFusingDelayRecordRedis; |
||||
|
import com.elink.esua.epdc.modules.item.service.ItemFusingDelayRecordService; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 项目熔断/延期表 |
||||
|
* |
||||
|
* @author elink elink@elink-cn.com |
||||
|
* @since v1.0.0 2022-01-05 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ItemFusingDelayRecordServiceImpl extends BaseServiceImpl<ItemFusingDelayRecordDao, ItemFusingDelayRecordEntity> implements ItemFusingDelayRecordService { |
||||
|
|
||||
|
@Autowired |
||||
|
private ItemFusingDelayRecordRedis itemFusingDelayRecordRedis; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<ItemFusingDelayRecordDTO> page(Map<String, Object> params) { |
||||
|
IPage<ItemFusingDelayRecordEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, ItemFusingDelayRecordDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ItemFusingDelayRecordDTO> list(Map<String, Object> params) { |
||||
|
List<ItemFusingDelayRecordEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, ItemFusingDelayRecordDTO.class); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 条件查询 |
||||
|
* @param params |
||||
|
* @return |
||||
|
*/ |
||||
|
@Override |
||||
|
public PageData<ItemFusingDelayRecordDTO> getPhrasePage(Map<String, Object> params) { |
||||
|
IPage<ItemFusingDelayRecordDTO> page = getPage(params); |
||||
|
List<ItemFusingDelayRecordDTO> list = baseDao.getPhrasePage(params); |
||||
|
return new PageData<>(list, page.getTotal()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ItemFusingDelayRecordDTO> getPageList(String itemId) { |
||||
|
List<ItemFusingDelayRecordDTO> list = baseDao.getPageList(itemId); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<ItemFusingDelayRecordEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<ItemFusingDelayRecordEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ItemFusingDelayRecordDTO get(String id) { |
||||
|
ItemFusingDelayRecordEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, ItemFusingDelayRecordDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(ItemFusingDelayRecordDTO dto) { |
||||
|
ItemFusingDelayRecordEntity entity = ConvertUtils.sourceToTarget(dto, ItemFusingDelayRecordEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(ItemFusingDelayRecordDTO dto) { |
||||
|
ItemFusingDelayRecordEntity entity = ConvertUtils.sourceToTarget(dto, ItemFusingDelayRecordEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
<?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.item.dao.ItemFusingDelayRecordDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.item.entity.ItemFusingDelayRecordEntity" id="itemFusingDelayRecordMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="itemId" column="ITEM_ID"/> |
||||
|
<result property="state" column="STATE"/> |
||||
|
<result property="reason" column="REASON"/> |
||||
|
<result property="handleState" column="HANDLE_STATE"/> |
||||
|
<result property="handleReason" column="HANDLE_REASON"/> |
||||
|
<result property="delayTime" column="DELAY_TIME"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="getPhrasePage" resultType="com.elink.esua.epdc.dto.ItemFusingDelayRecordDTO"> |
||||
|
select |
||||
|
ID, |
||||
|
ITEM_ID, |
||||
|
STATE, |
||||
|
(case STATE when '1' then '延期' when '2' then '熔断' else '' end) stateName, |
||||
|
REASON, |
||||
|
HANDLE_STATE, |
||||
|
(case HANDLE_STATE when '1' then '通过' when '2' then '驳回' else '' end) handleStateName, |
||||
|
HANDLE_REASON, |
||||
|
DELAY_TIME, |
||||
|
DATE_FORMAT(DELAY_TIME,'%Y-%m-%d') delayTimeStr, |
||||
|
REVISION, |
||||
|
CREATED_BY, |
||||
|
CREATED_TIME, |
||||
|
UPDATED_BY, |
||||
|
UPDATED_TIME, |
||||
|
DEL_FLAG |
||||
|
from epdc_item_fusing_delay_record |
||||
|
where DEL_FLAG = '0' |
||||
|
<if test="state != null and state != ''"> |
||||
|
and STATE = #{state} |
||||
|
</if> |
||||
|
order by UPDATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="getPageList" resultType="com.elink.esua.epdc.dto.ItemFusingDelayRecordDTO"> |
||||
|
select |
||||
|
ID, |
||||
|
ITEM_ID, |
||||
|
STATE, |
||||
|
(case STATE when '1' then '延期' when '2' then '熔断' else '' end) stateName, |
||||
|
REASON, |
||||
|
HANDLE_STATE, |
||||
|
(case HANDLE_STATE when '1' then '通过' when '2' then '驳回' else '' end) handleStateName, |
||||
|
HANDLE_REASON, |
||||
|
DELAY_TIME, |
||||
|
DATE_FORMAT(DELAY_TIME,'%Y-%m-%d') delayTimeStr, |
||||
|
REVISION, |
||||
|
CREATED_BY, |
||||
|
CREATED_TIME, |
||||
|
UPDATED_BY, |
||||
|
UPDATED_TIME, |
||||
|
DEL_FLAG |
||||
|
from epdc_item_fusing_delay_record |
||||
|
where DEL_FLAG = '0' |
||||
|
<if test="itemId != null and itemId != ''"> |
||||
|
and ITEM_ID = #{itemId} |
||||
|
</if> |
||||
|
order by UPDATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue