Commit da6daa4b authored by shenxin's avatar shenxin

添加办件重新推送接口

parent fcf030ea
......@@ -4,12 +4,17 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.modules.information.model.InformationEntity;
/**
* <p>Title: 办件信息</p>
* <p>Description: InformationService service接口 </p>
* <p>Copyright: Copyright &reg; </p>
* @version 1.0.0
*/
* <p>Title: 办件信息</p>
* <p>Description: InformationService service接口 </p>
* <p>Copyright: Copyright &reg; </p>
*
* @version 1.0.0
*/
public interface InformationService extends ICRUDService<InformationEntity,Long>{
public interface InformationService extends ICRUDService<InformationEntity, Long> {
/**
* 重新推送
*/
void anewPush(Long[] ids);
}
\ No newline at end of file
package com.mortals.xhx.modules.information.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.NodeTypeEnum;
import com.mortals.xhx.modules.information.dao.InformationDao;
import com.mortals.xhx.modules.information.model.InformationEntity;
import com.mortals.xhx.modules.information.service.InformationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>Title: 办件信息</p>
* <p>Description: InformationService service接口 </p>
......@@ -15,4 +21,28 @@ import org.springframework.stereotype.Service;
@Service("informationService")
public class InformationServiceImpl extends AbstractCRUDServiceImpl<InformationDao, InformationEntity, Long> implements InformationService {
@Resource
private InformationDao informationDao;
@Override
public void anewPush(Long[] ids) {
List<InformationEntity> entities = informationDao.get(ids);
if(CollectionUtils.isNotEmpty(entities)){
entities.forEach(entity ->{
if(NodeTypeEnum.蓉易办受理.getCode().equals(entity.getNodeType())
|| NodeTypeEnum.受理.getCode().equals(entity.getNodeType())){
entity.setIsSuccess("1");
entity.setIsReport("0");
}else if(NodeTypeEnum.审查.getCode().equals(entity.getNodeType())
|| NodeTypeEnum.蓉易办环节.getCode().equals(entity.getNodeType())
|| NodeTypeEnum.决定.getCode().equals(entity.getNodeType())){
entity.setIsSuccess("1");
entity.setIsReport("1");
}
entity.setFailReason("");
entity.setFailTimes(0);
});
informationDao.insertBatch(entities);
}
}
}
\ No newline at end of file
package com.mortals.xhx.modules.information.web;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -8,6 +9,7 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonController;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.feign.ElasticsearchClient;
import com.mortals.xhx.modules.information.model.InformationEntity;
import com.mortals.xhx.modules.information.service.InformationService;
......@@ -15,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
import java.util.Map;
......@@ -33,6 +36,9 @@ public class InformationController extends BaseCRUDJsonController<InformationSer
// @Autowired
// private ElasticsearchClient elasticsearchClient;
@Resource
private InformationService informationService;
public InformationController(){
super.setFormClass(InformationForm.class);
......@@ -141,5 +147,20 @@ public class InformationController extends BaseCRUDJsonController<InformationSer
}
}
/**
* 重新推送
*/
@PostMapping(value="anewPush")
public ApiRespPdu anewPush(@RequestParam("ids") Long[] ids) {
ApiRespPdu respPdu=new ApiRespPdu();
try{
informationService.anewPush(ids);
respPdu.setCode(200);
respPdu.setMsg("上传文件成功");
}catch(Exception e){
respPdu.setCode(500);
respPdu.setMsg("操作失败");
}
return respPdu;
}
}
\ 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