Commit 0247abb4 authored by 赵啸非's avatar 赵啸非

修改导入事项与材料

parent 93453f70
......@@ -8,6 +8,7 @@
package com.mortals.xhx.base.system.oper.service.impl;
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
......@@ -68,7 +69,8 @@ public class OperLogServiceImpl extends AbstractCRUDServiceImpl<OperLogDao,OperL
@Override
public void insertOperLog(HttpServletRequest request, IUser user, BaseEntity oldEntity, BaseEntity newEntity, OperTypeEnum operType, String content, String id) {
OperLogEntity operLogEntity = new OperLogEntity();
operLogEntity.setIp(HttpUtil.getRequestIP(request));
//operLogEntity.setIp(HttpUtil.getRequestIP(request));
operLogEntity.setIp( ServletUtil.getClientIP(request));
operLogEntity.setLogDate(new Date());
operLogEntity.setPlatformMark(GlobalSysInfo.getPropertyValue(SysConstains.PROP_PLATFORM_MARK));
......
......@@ -28,10 +28,12 @@ public class MatterDatumEntity extends MatterDatumVo {
/**
* 事项名称
*/
@Excel(name = "事项名称")
private String matterName;
/**
* 材料名
*/
@Excel(name = "材料名称")
private String materialName;
/**
* 必交性(非必要.非必要,必要.必要,必要|容缺后补.必要|容缺后补,非必要|容缺后补.非必要|容缺后补)
......
......@@ -76,6 +76,13 @@ public class MatterCustomImportEntity extends BaseEntityLong {
private String superviseShow;
/**
* 咨询方式
*/
@Excel(name = "投诉电话")
private String cousultingShow;
/**
* 事项类型
*/
......
package com.mortals.xhx.module.matter.model.vo;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
......@@ -19,4 +20,10 @@ public class MatterDatumVo extends BaseEntityLong {
private List<MatterDatumFileEntity> datumFileList;
/** 事项id列表 */
private List <Long> matterIdList;
/**
* 区域编码
*/
@Excel(name = "区域编码")
private String areaCode;
}
\ No newline at end of file
......@@ -94,8 +94,6 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
}
super.updateAfter(entity, context);
}
/**
* @param query
* @param context
......@@ -105,4 +103,14 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
public List<MatterDatumEntity> findMatterList(MatterDatumEntity query, Context context) {
return null;
}
@Override
public String importList(List<MatterDatumEntity> list, Boolean updateSupport, Context context) {
return super.importList(list, updateSupport, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.extra.servlet.ServletUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
......@@ -13,19 +14,25 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileEntity;
import com.mortals.xhx.module.matter.model.MatterDatumFileQuery;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.matter.model.*;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.matter.service.MatterService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteQuery;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -50,6 +57,10 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
@Autowired
private MatterDatumFileService matterDatumFileService;
@Autowired
private MatterService matterService;
public MatterDatumController() {
super.setModuleDesc("事项申请材料");
}
......@@ -193,4 +204,40 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
}
}
@Override
@UnAuth
public String importData(MultipartFile file, boolean updateSupport) {
return super.importData(file, updateSupport);
}
@Override
public void doImportDataBefore(List<MatterDatumEntity> list, boolean updateSupport, Context context) throws AppException {
super.doImportDataBefore(list, updateSupport, context);
list.stream().distinct().forEach(item -> {
if (ObjectUtils.isEmpty(item.getAreaCode())) {
log.info("事项名称:{},区域编码为空", item.getMatterName());
return;
}
MatterEntity matterEntity = matterService.selectOne(new MatterQuery().areaCode(item.getAreaCode())
.matterName(item.getMatterName()));
if (ObjectUtils.isEmpty(matterEntity)) {
log.info("事项名称:{},不存在", item.getMatterName());
return;
}
//根据事项id查询材料 并且删除
Long[] delIds = this.service.find(new MatterDatumQuery().matterId(matterEntity.getId()))
.stream().map(MatterDatumEntity::getId).toArray(Long[]::new);
this.service.remove(delIds, context);
item.setMatterId(matterEntity.getId());
item.setMatterCode(matterEntity.getMatterNo());
item.setSource(matterEntity.getSource());
});
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment