Browse Source
			
			
			
			
				
		# Conflicts: # epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java # epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java 九小场所变更记录dev
				 13 changed files with 919 additions and 35 deletions
			
			
		@ -0,0 +1,144 @@ | 
				
			|||
package com.epmet.dto; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class IcEnterpriseChangeRecordDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 唯一标识 | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     */ | 
				
			|||
	private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id【场所区域】 | 
				
			|||
     */ | 
				
			|||
	private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格所属的组织Id | 
				
			|||
     */ | 
				
			|||
	private String agencyId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * agency_id的所有上级 | 
				
			|||
     */ | 
				
			|||
	private String agencyPids; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所类型:来源于ic_coverage_category_dict | 
				
			|||
     */ | 
				
			|||
	private String placeType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所名称 | 
				
			|||
     */ | 
				
			|||
	private String placeOrgName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所地址 | 
				
			|||
     */ | 
				
			|||
	private String address; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 经度 | 
				
			|||
     */ | 
				
			|||
	private String longitude; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 纬度 | 
				
			|||
     */ | 
				
			|||
	private String latitude; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 字典value,场所规模【 | 
				
			|||
0:10人以下 | 
				
			|||
1:10-20人 | 
				
			|||
2:21-40人 | 
				
			|||
3:41-100人 | 
				
			|||
4:100人以上】 | 
				
			|||
     */ | 
				
			|||
	private String scale; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所负责人 | 
				
			|||
     */ | 
				
			|||
	private String personInCharge; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 负责人电话 | 
				
			|||
     */ | 
				
			|||
	private String mobile; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 来源【新增:add 导入:import 】 | 
				
			|||
     */ | 
				
			|||
	private String sourceType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最新巡查结果【0:合格 1:不合格】 | 
				
			|||
     */ | 
				
			|||
	private String latestResult; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最新检查时间 | 
				
			|||
     */ | 
				
			|||
	private Date latestPatrolTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除标识:0.未删除 1.已删除 | 
				
			|||
     */ | 
				
			|||
	private Integer delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建人 | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新人 | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 原始记录id | 
				
			|||
     */ | 
				
			|||
    private String originId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 操作类型,upd,del | 
				
			|||
     */ | 
				
			|||
    private String type; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,46 @@ | 
				
			|||
package com.epmet.controller; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dto.IcEnterpriseChangeRecordDTO; | 
				
			|||
import com.epmet.service.IcEnterpriseChangeRecordService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.web.bind.annotation.*; | 
				
			|||
 | 
				
			|||
import java.util.HashMap; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("icEnterpriseChangeRecord") | 
				
			|||
public class IcEnterpriseChangeRecordController { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private IcEnterpriseChangeRecordService icEnterpriseChangeRecordService; | 
				
			|||
 | 
				
			|||
    @RequestMapping("page") | 
				
			|||
    public Result<PageData<IcEnterpriseChangeRecordDTO>> page(@RequestParam Map<String, Object> params) { | 
				
			|||
        PageData<IcEnterpriseChangeRecordDTO> page = icEnterpriseChangeRecordService.page(params); | 
				
			|||
        return new Result<PageData<IcEnterpriseChangeRecordDTO>>().ok(page); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) | 
				
			|||
    public Result<IcEnterpriseChangeRecordDTO> get(@PathVariable("id") String id) { | 
				
			|||
        IcEnterpriseChangeRecordDTO data = icEnterpriseChangeRecordService.get(id); | 
				
			|||
        return new Result<IcEnterpriseChangeRecordDTO>().ok(data); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @RequestMapping("history/{originId}") | 
				
			|||
    public Result<PageData<IcEnterpriseChangeRecordDTO>> page(@PathVariable("originId") String originId, @RequestParam Map<String, Object> params) { | 
				
			|||
        params.put("originId", originId); | 
				
			|||
        PageData<IcEnterpriseChangeRecordDTO> page = icEnterpriseChangeRecordService.page(params); | 
				
			|||
        return new Result<PageData<IcEnterpriseChangeRecordDTO>>().ok(page); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,29 @@ | 
				
			|||
package com.epmet.dao; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.epmet.dto.IcEnterpriseChangeRecordDTO; | 
				
			|||
import com.epmet.entity.IcEnterpriseChangeRecordEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface IcEnterpriseChangeRecordDao extends BaseDao<IcEnterpriseChangeRecordEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 分页列表 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<com.epmet.dto.IcEnterpriseChangeRecordDTO> | 
				
			|||
     * @author zhy | 
				
			|||
     * @date 2022/8/9 17:23 | 
				
			|||
     */ | 
				
			|||
    List<IcEnterpriseChangeRecordDTO> listPage(Map<String, Object> params); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,114 @@ | 
				
			|||
package com.epmet.entity; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("ic_enterprise_change_record") | 
				
			|||
public class IcEnterpriseChangeRecordEntity extends BaseEpmetEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     */ | 
				
			|||
	private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格Id【场所区域】 | 
				
			|||
     */ | 
				
			|||
	private String gridId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 网格所属的组织Id | 
				
			|||
     */ | 
				
			|||
	private String agencyId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * agency_id的所有上级 | 
				
			|||
     */ | 
				
			|||
	private String agencyPids; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所类型:来源于ic_coverage_category_dict | 
				
			|||
     */ | 
				
			|||
	private String placeType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所名称 | 
				
			|||
     */ | 
				
			|||
	private String placeOrgName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所地址 | 
				
			|||
     */ | 
				
			|||
	private String address; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 经度 | 
				
			|||
     */ | 
				
			|||
	private String longitude; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 纬度 | 
				
			|||
     */ | 
				
			|||
	private String latitude; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 字典value,场所规模【 | 
				
			|||
0:10人以下 | 
				
			|||
1:10-20人 | 
				
			|||
2:21-40人 | 
				
			|||
3:41-100人 | 
				
			|||
4:100人以上】 | 
				
			|||
     */ | 
				
			|||
	private String scale; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 场所负责人 | 
				
			|||
     */ | 
				
			|||
	private String personInCharge; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 负责人电话 | 
				
			|||
     */ | 
				
			|||
	private String mobile; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 来源【新增:add 导入:import 】 | 
				
			|||
     */ | 
				
			|||
	private String sourceType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最新巡查结果【0:合格 1:不合格】 | 
				
			|||
     */ | 
				
			|||
	private String latestResult; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 最新检查时间 | 
				
			|||
     */ | 
				
			|||
	private Date latestPatrolTime; | 
				
			|||
 | 
				
			|||
	/** | 
				
			|||
	 * 原始记录id | 
				
			|||
	 */ | 
				
			|||
	private String originId; | 
				
			|||
 | 
				
			|||
	/** | 
				
			|||
	 * 操作类型,upd,del | 
				
			|||
	 */ | 
				
			|||
	private String type; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,84 @@ | 
				
			|||
package com.epmet.excel; | 
				
			|||
 | 
				
			|||
import cn.afterturn.easypoi.excel.annotation.Excel; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class IcEnterpriseChangeRecordExcel { | 
				
			|||
 | 
				
			|||
    @Excel(name = "唯一标识") | 
				
			|||
    private String id; | 
				
			|||
 | 
				
			|||
    @Excel(name = "客户Id") | 
				
			|||
    private String customerId; | 
				
			|||
 | 
				
			|||
    @Excel(name = "网格Id【场所区域】") | 
				
			|||
    private String gridId; | 
				
			|||
 | 
				
			|||
    @Excel(name = "网格所属的组织Id") | 
				
			|||
    private String agencyId; | 
				
			|||
 | 
				
			|||
    @Excel(name = "agency_id的所有上级") | 
				
			|||
    private String agencyPids; | 
				
			|||
 | 
				
			|||
    @Excel(name = "场所类型:来源于ic_coverage_category_dict") | 
				
			|||
    private String placeType; | 
				
			|||
 | 
				
			|||
    @Excel(name = "场所名称") | 
				
			|||
    private String placeOrgName; | 
				
			|||
 | 
				
			|||
    @Excel(name = "场所地址") | 
				
			|||
    private String address; | 
				
			|||
 | 
				
			|||
    @Excel(name = "经度") | 
				
			|||
    private String longitude; | 
				
			|||
 | 
				
			|||
    @Excel(name = "纬度") | 
				
			|||
    private String latitude; | 
				
			|||
 | 
				
			|||
    @Excel(name = "字典value,场所规模") | 
				
			|||
    private String scale; | 
				
			|||
 | 
				
			|||
    @Excel(name = "场所负责人") | 
				
			|||
    private String personInCharge; | 
				
			|||
 | 
				
			|||
    @Excel(name = "负责人电话") | 
				
			|||
    private String mobile; | 
				
			|||
 | 
				
			|||
    @Excel(name = "来源【新增:add 导入:import 】") | 
				
			|||
    private String sourceType; | 
				
			|||
 | 
				
			|||
    @Excel(name = "最新巡查结果【0:合格 1:不合格】") | 
				
			|||
    private String latestResult; | 
				
			|||
 | 
				
			|||
    @Excel(name = "最新检查时间") | 
				
			|||
    private Date latestPatrolTime; | 
				
			|||
 | 
				
			|||
    @Excel(name = "删除标识:0.未删除 1.已删除") | 
				
			|||
    private Integer delFlag; | 
				
			|||
 | 
				
			|||
    @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; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,30 @@ | 
				
			|||
package com.epmet.redis; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.redis.RedisUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Component; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Component | 
				
			|||
public class IcEnterpriseChangeRecordRedis { | 
				
			|||
    @Autowired | 
				
			|||
    private RedisUtils redisUtils; | 
				
			|||
 | 
				
			|||
    public void delete(Object[] ids) { | 
				
			|||
 | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public void set(){ | 
				
			|||
 | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public String get(String id){ | 
				
			|||
        return null; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,78 @@ | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.BaseService; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dto.IcEnterpriseChangeRecordDTO; | 
				
			|||
import com.epmet.entity.IcEnterpriseChangeRecordEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 企事业单位变更记录表 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
public interface IcEnterpriseChangeRecordService extends BaseService<IcEnterpriseChangeRecordEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<IcEnterpriseChangeRecordDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    PageData<IcEnterpriseChangeRecordDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<IcEnterpriseChangeRecordDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    List<IcEnterpriseChangeRecordDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return IcEnterpriseChangeRecordDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    IcEnterpriseChangeRecordDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    void save(IcEnterpriseChangeRecordDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    void update(IcEnterpriseChangeRecordDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2022-08-16 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,98 @@ | 
				
			|||
package com.epmet.service.impl; | 
				
			|||
 | 
				
			|||
import com.alibaba.fastjson.JSON; | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.epmet.commons.tools.constant.FieldConstant; | 
				
			|||
import com.epmet.commons.tools.enums.DictTypeEnum; | 
				
			|||
import com.epmet.commons.tools.exception.EpmetException; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.security.user.LoginUserUtil; | 
				
			|||
import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.dao.IcEnterpriseChangeRecordDao; | 
				
			|||
import com.epmet.dto.IcEnterpriseChangeRecordDTO; | 
				
			|||
import com.epmet.dto.IcWorkLogDTO; | 
				
			|||
import com.epmet.entity.IcEnterpriseChangeRecordEntity; | 
				
			|||
import com.epmet.feign.EpmetAdminOpenFeignClient; | 
				
			|||
import com.epmet.redis.IcEnterpriseChangeRecordRedis; | 
				
			|||
import com.epmet.service.IcEnterpriseChangeRecordService; | 
				
			|||
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 generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2022-08-16 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class IcEnterpriseChangeRecordServiceImpl extends BaseServiceImpl<IcEnterpriseChangeRecordDao, IcEnterpriseChangeRecordEntity> implements IcEnterpriseChangeRecordService { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private IcEnterpriseChangeRecordRedis icEnterpriseChangeRecordRedis; | 
				
			|||
    @Autowired | 
				
			|||
    private LoginUserUtil loginUserUtil; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<IcEnterpriseChangeRecordDTO> page(Map<String, Object> params) { | 
				
			|||
        params.put("customerId", loginUserUtil.getLoginUserCustomerId()); | 
				
			|||
        IPage<IcWorkLogDTO> page = getPage(params); | 
				
			|||
        List<IcEnterpriseChangeRecordDTO> list = baseDao.listPage(params); | 
				
			|||
        return new PageData<>(list, page.getTotal()); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<IcEnterpriseChangeRecordDTO> list(Map<String, Object> params) { | 
				
			|||
        List<IcEnterpriseChangeRecordEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, IcEnterpriseChangeRecordDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<IcEnterpriseChangeRecordEntity> getWrapper(Map<String, Object> params) { | 
				
			|||
        String id = (String) params.get(FieldConstant.ID_HUMP); | 
				
			|||
        String originId = (String) params.get("originId"); | 
				
			|||
 | 
				
			|||
        QueryWrapper<IcEnterpriseChangeRecordEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(originId), "ORIGIN_ID", originId); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public IcEnterpriseChangeRecordDTO get(String id) { | 
				
			|||
        IcEnterpriseChangeRecordEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, IcEnterpriseChangeRecordDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(IcEnterpriseChangeRecordDTO dto) { | 
				
			|||
        IcEnterpriseChangeRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcEnterpriseChangeRecordEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(IcEnterpriseChangeRecordDTO dto) { | 
				
			|||
        IcEnterpriseChangeRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcEnterpriseChangeRecordEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,52 @@ | 
				
			|||
/* | 
				
			|||
 Navicat Premium Data Transfer | 
				
			|||
 | 
				
			|||
 Source Server         : epmet_cloud_dev_org | 
				
			|||
 Source Server Type    : MySQL | 
				
			|||
 Source Server Version : 50726 | 
				
			|||
 Source Host           : 192.168.1.140:3306 | 
				
			|||
 Source Schema         : epmet_gov_org | 
				
			|||
 | 
				
			|||
 Target Server Type    : MySQL | 
				
			|||
 Target Server Version : 50726 | 
				
			|||
 File Encoding         : 65001 | 
				
			|||
 | 
				
			|||
 Date: 17/08/2022 14:20:39 | 
				
			|||
*/ | 
				
			|||
 | 
				
			|||
SET NAMES utf8mb4; | 
				
			|||
SET FOREIGN_KEY_CHECKS = 0; | 
				
			|||
 | 
				
			|||
-- ---------------------------- | 
				
			|||
-- Table structure for ic_enterprise_change_record | 
				
			|||
-- ---------------------------- | 
				
			|||
DROP TABLE IF EXISTS `ic_enterprise_change_record`; | 
				
			|||
CREATE TABLE `ic_enterprise_change_record`  ( | 
				
			|||
  `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '唯一标识', | 
				
			|||
  `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户Id', | 
				
			|||
  `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格Id【场所区域】', | 
				
			|||
  `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织Id', | 
				
			|||
  `AGENCY_PIDS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'agency_id的所有上级', | 
				
			|||
  `PLACE_TYPE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所类型:来源于ic_coverage_category_dict', | 
				
			|||
  `PLACE_ORG_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所名称', | 
				
			|||
  `ADDRESS` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所地址', | 
				
			|||
  `LONGITUDE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度', | 
				
			|||
  `LATITUDE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度', | 
				
			|||
  `SCALE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典value,场所规模【\r\n0:10人以下\r\n1:10-20人\r\n2:21-40人\r\n3:41-100人\r\n4:100人以上】', | 
				
			|||
  `PERSON_IN_CHARGE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '场所负责人', | 
				
			|||
  `MOBILE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人电话', | 
				
			|||
  `SOURCE_TYPE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源【新增:add 导入:import 】', | 
				
			|||
  `LATEST_RESULT` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '最新巡查结果【0:合格 1:不合格】', | 
				
			|||
  `LATEST_PATROL_TIME` datetime NULL DEFAULT NULL COMMENT '最新检查时间', | 
				
			|||
  `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', | 
				
			|||
  `REVISION` int(11) NOT NULL COMMENT '乐观锁', | 
				
			|||
  `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', | 
				
			|||
  `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', | 
				
			|||
  `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', | 
				
			|||
  `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', | 
				
			|||
  `ORIGIN_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '原始记录ID', | 
				
			|||
  `TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作类型,upd,del', | 
				
			|||
  PRIMARY KEY (`ID`) USING BTREE | 
				
			|||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企事业单位变更记录表' ROW_FORMAT = COMPACT; | 
				
			|||
 | 
				
			|||
SET FOREIGN_KEY_CHECKS = 1; | 
				
			|||
@ -0,0 +1,45 @@ | 
				
			|||
<?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.epmet.dao.IcEnterpriseChangeRecordDao"> | 
				
			|||
 | 
				
			|||
    <resultMap type="com.epmet.entity.IcEnterpriseChangeRecordEntity" id="icEnterpriseChangeRecordMap"> | 
				
			|||
        <result property="id" column="ID"/> | 
				
			|||
        <result property="customerId" column="CUSTOMER_ID"/> | 
				
			|||
        <result property="gridId" column="GRID_ID"/> | 
				
			|||
        <result property="agencyId" column="AGENCY_ID"/> | 
				
			|||
        <result property="agencyPids" column="AGENCY_PIDS"/> | 
				
			|||
        <result property="placeType" column="PLACE_TYPE"/> | 
				
			|||
        <result property="placeOrgName" column="PLACE_ORG_NAME"/> | 
				
			|||
        <result property="address" column="ADDRESS"/> | 
				
			|||
        <result property="longitude" column="LONGITUDE"/> | 
				
			|||
        <result property="latitude" column="LATITUDE"/> | 
				
			|||
        <result property="scale" column="SCALE"/> | 
				
			|||
        <result property="personInCharge" column="PERSON_IN_CHARGE"/> | 
				
			|||
        <result property="mobile" column="MOBILE"/> | 
				
			|||
        <result property="sourceType" column="SOURCE_TYPE"/> | 
				
			|||
        <result property="latestResult" column="LATEST_RESULT"/> | 
				
			|||
        <result property="latestPatrolTime" column="LATEST_PATROL_TIME"/> | 
				
			|||
        <result property="delFlag" column="DEL_FLAG"/> | 
				
			|||
        <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="originId" column="ORIGIN_ID"/> | 
				
			|||
        <result property="type" column="TYPE"/> | 
				
			|||
    </resultMap> | 
				
			|||
 | 
				
			|||
    <select id="listPage" resultType="com.epmet.dto.IcEnterpriseChangeRecordDTO"> | 
				
			|||
        SELECT | 
				
			|||
            r.* | 
				
			|||
        FROM | 
				
			|||
            ic_enterprise_change_record r | 
				
			|||
        WHERE | 
				
			|||
            r.DEL_FLAG = '0' | 
				
			|||
          AND r.CUSTOMER_ID = #{customerId} | 
				
			|||
          AND r.ORIGIN_ID = #{originId} | 
				
			|||
        ORDER BY r.CREATED_TIME DESC | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue