Commit 3d4bbccc authored by 廖旭伟's avatar 廖旭伟

增加辅助接件事项功能接口,增加站点事项材料列表查询接口

parent 1eecd484
package com.mortals.xhx.module.matter.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -11,14 +14,20 @@ 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.MatterDatumQuery;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -37,6 +46,8 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
private ParamService paramService;
@Autowired
private MatterDatumFileService matterDatumFileService;
@Autowired
private SiteMatterService siteMatterService;
public MatterDatumController() {
super.setFormClass(MatterDatumForm.class);
......@@ -89,4 +100,49 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
}
return jsonObject.toJSONString();
}
@PostMapping({"subList"})
@UnAuth
public Rest<Object> subList(@RequestBody MatterDatumQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
PageInfo pageInfo = this.buildPageInfo(query);
subListBefore(query, model, context);
Result<MatterDatumEntity> result = this.getService().find(query, pageInfo, context);
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, model, context);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
protected void subListBefore(MatterDatumQuery query, Map<String, Object> model, Context context) throws AppException {
List<SiteMatterEntity> siteMatterEntityList = siteMatterService.find(new SiteMatterQuery());
List<Long> matterIds = new ArrayList<>();
if(CollectionUtils.isNotEmpty(siteMatterEntityList)){
for(SiteMatterEntity siteMatterEntity:siteMatterEntityList){
matterIds.add(siteMatterEntity.getMatterId());
}
}else {
matterIds.add(0l);
}
query.setMatterIdList(matterIds);
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
import java.util.List;
/**
* 辅助接件事项Dao
* 辅助接件事项 DAO接口
*
* @author zxfei
* @date 2023-03-17
*/
public interface SiteMatterAssistDao extends ICRUDDao<SiteMatterAssistEntity,Long>{
}
package com.mortals.xhx.module.site.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.site.dao.SiteMatterAssistDao;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 辅助接件事项DaoImpl DAO接口
*
* @author zxfei
* @date 2023-03-17
*/
@Repository("siteMatterAssistDao")
public class SiteMatterAssistDaoImpl extends BaseCRUDDaoMybatis<SiteMatterAssistEntity,Long> implements SiteMatterAssistDao {
}
package com.mortals.xhx.module.site.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.site.model.vo.SiteMatterAssistVo;
/**
* 辅助接件事项实体对象
*
* @author zxfei
* @date 2023-03-17
*/
public class SiteMatterAssistEntity extends SiteMatterAssistVo {
private static final long serialVersionUID = 1L;
/**
* 站点事项id
*/
private Long siteMatterId;
/**
* 事项ID
*/
private Long matterId;
/**
* 事项名称
*/
private String matterName;
/**
* 事项编码
*/
private String matterCode;
/**
* 部门ID
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 部门编码
*/
private String deptCode;
/**
* 股室ID
*/
private Long officeId;
/**
* 股室名称
*/
private String officeName;
/**
* 负责人姓名
*/
private String dutyer;
/**
* 联系电话
*/
private String telephone;
/**
* 政务网地址
*/
private String govUrl;
public SiteMatterAssistEntity(){}
/**
* 获取 站点事项id
* @return Long
*/
public Long getSiteMatterId(){
return siteMatterId;
}
/**
* 设置 站点事项id
* @param siteMatterId
*/
public void setSiteMatterId(Long siteMatterId){
this.siteMatterId = siteMatterId;
}
/**
* 获取 事项ID
* @return Long
*/
public Long getMatterId(){
return matterId;
}
/**
* 设置 事项ID
* @param matterId
*/
public void setMatterId(Long matterId){
this.matterId = matterId;
}
/**
* 获取 事项名称
* @return String
*/
public String getMatterName(){
return matterName;
}
/**
* 设置 事项名称
* @param matterName
*/
public void setMatterName(String matterName){
this.matterName = matterName;
}
/**
* 获取 事项编码
* @return String
*/
public String getMatterCode(){
return matterCode;
}
/**
* 设置 事项编码
* @param matterCode
*/
public void setMatterCode(String matterCode){
this.matterCode = matterCode;
}
/**
* 获取 部门ID
* @return Long
*/
public Long getDeptId(){
return deptId;
}
/**
* 设置 部门ID
* @param deptId
*/
public void setDeptId(Long deptId){
this.deptId = deptId;
}
/**
* 获取 部门名称
* @return String
*/
public String getDeptName(){
return deptName;
}
/**
* 设置 部门名称
* @param deptName
*/
public void setDeptName(String deptName){
this.deptName = deptName;
}
/**
* 获取 部门编码
* @return String
*/
public String getDeptCode(){
return deptCode;
}
/**
* 设置 部门编码
* @param deptCode
*/
public void setDeptCode(String deptCode){
this.deptCode = deptCode;
}
/**
* 获取 股室ID
* @return Long
*/
public Long getOfficeId(){
return officeId;
}
/**
* 设置 股室ID
* @param officeId
*/
public void setOfficeId(Long officeId){
this.officeId = officeId;
}
/**
* 获取 股室名称
* @return String
*/
public String getOfficeName(){
return officeName;
}
/**
* 设置 股室名称
* @param officeName
*/
public void setOfficeName(String officeName){
this.officeName = officeName;
}
/**
* 获取 负责人姓名
* @return String
*/
public String getDutyer(){
return dutyer;
}
/**
* 设置 负责人姓名
* @param dutyer
*/
public void setDutyer(String dutyer){
this.dutyer = dutyer;
}
/**
* 获取 联系电话
* @return String
*/
public String getTelephone(){
return telephone;
}
/**
* 设置 联系电话
* @param telephone
*/
public void setTelephone(String telephone){
this.telephone = telephone;
}
/**
* 获取 政务网地址
* @return String
*/
public String getGovUrl(){
return govUrl;
}
/**
* 设置 政务网地址
* @param govUrl
*/
public void setGovUrl(String govUrl){
this.govUrl = govUrl;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof SiteMatterAssistEntity) {
SiteMatterAssistEntity tmp = (SiteMatterAssistEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",siteMatterId:").append(getSiteMatterId());
sb.append(",matterId:").append(getMatterId());
sb.append(",matterName:").append(getMatterName());
sb.append(",matterCode:").append(getMatterCode());
sb.append(",deptId:").append(getDeptId());
sb.append(",deptName:").append(getDeptName());
sb.append(",deptCode:").append(getDeptCode());
sb.append(",officeId:").append(getOfficeId());
sb.append(",officeName:").append(getOfficeName());
sb.append(",dutyer:").append(getDutyer());
sb.append(",telephone:").append(getTelephone());
sb.append(",govUrl:").append(getGovUrl());
return sb.toString();
}
public void initAttrValue(){
this.siteMatterId = null;
this.matterId = null;
this.matterName = "";
this.matterCode = "";
this.deptId = null;
this.deptName = "";
this.deptCode = "";
this.officeId = null;
this.officeName = "";
this.dutyer = "";
this.telephone = "";
this.govUrl = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.site.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 辅助接件事项视图对象
*
* @author zxfei
* @date 2023-03-17
*/
public class SiteMatterAssistVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.site.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
/**
* SiteMatterAssistService
*
* 辅助接件事项 service接口
*
* @author zxfei
* @date 2023-03-17
*/
public interface SiteMatterAssistService extends ICRUDService<SiteMatterAssistEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.site.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.site.dao.SiteMatterAssistDao;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
import com.mortals.xhx.module.site.service.SiteMatterAssistService;
/**
* SiteMatterAssistService
* 辅助接件事项 service实现
*
* @author zxfei
* @date 2023-03-17
*/
@Service("siteMatterAssistService")
public class SiteMatterAssistServiceImpl extends AbstractCRUDServiceImpl<SiteMatterAssistDao, SiteMatterAssistEntity, Long> implements SiteMatterAssistService {
}
\ No newline at end of file
package com.mortals.xhx.module.site.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.site.model.SiteMatterAssistEntity;
import com.mortals.xhx.module.site.service.SiteMatterAssistService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 辅助接件事项
*
* @author zxfei
* @date 2023-03-17
*/
@RestController
@RequestMapping("site/matter/assist")
public class SiteMatterAssistController extends BaseCRUDJsonBodyMappingController<SiteMatterAssistService,SiteMatterAssistEntity,Long> {
@Autowired
private ParamService paramService;
public SiteMatterAssistController(){
super.setModuleDesc( "辅助接件事项");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.matter.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BasePhpCRUDJsonMappingController;
......@@ -11,14 +14,20 @@ 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.MatterDatumQuery;
import com.mortals.xhx.module.matter.service.MatterDatumFileService;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.site.model.SiteMatterEntity;
import com.mortals.xhx.module.site.model.SiteMatterQuery;
import com.mortals.xhx.module.site.service.SiteMatterService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -37,6 +46,8 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
private ParamService paramService;
@Autowired
private MatterDatumFileService matterDatumFileService;
@Autowired
private SiteMatterService siteMatterService;
public MatterDatumController() {
super.setFormClass(MatterDatumForm.class);
......@@ -89,4 +100,49 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
}
return jsonObject.toJSONString();
}
@PostMapping({"subList"})
@UnAuth
public Rest<Object> subList(@RequestBody MatterDatumQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
int code;
try {
PageInfo pageInfo = this.buildPageInfo(query);
subListBefore(query, model, context);
Result<MatterDatumEntity> result = this.getService().find(query, pageInfo, context);
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, model, context);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
protected void subListBefore(MatterDatumQuery query, Map<String, Object> model, Context context) throws AppException {
List<SiteMatterEntity> siteMatterEntityList = siteMatterService.find(new SiteMatterQuery());
List<Long> matterIds = new ArrayList<>();
if(CollectionUtils.isNotEmpty(siteMatterEntityList)){
for(SiteMatterEntity siteMatterEntity:siteMatterEntityList){
matterIds.add(siteMatterEntity.getMatterId());
}
}else {
matterIds.add(0l);
}
query.setMatterIdList(matterIds);
}
}
\ 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