|
@@ -1,5 +1,6 @@
|
|
|
package com.jtgh.yjpt.webService.yjgl;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -10,15 +11,20 @@ import javax.jws.WebService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.jtgh.yjpt.client.yjzyxxgl.sgalgl.SgalglWebService;
|
|
|
+import com.jtgh.yjpt.common.Constants;
|
|
|
import com.jtgh.yjpt.common.PredicateModel;
|
|
|
import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
|
+import com.jtgh.yjpt.common.GlobalData;
|
|
|
import com.jtgh.yjpt.common.SinglePageRequest;
|
|
|
import com.jtgh.yjpt.common.SpecificationCreater;
|
|
|
import com.jtgh.yjpt.common.Utils;
|
|
|
import com.jtgh.yjpt.controller.BaseController;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
+import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
import com.jtgh.yjpt.entity.sgalgl.SgalglEntity;
|
|
|
import com.jtgh.yjpt.entity.sgalgl.SgalglwzddEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.YjpxEntity;
|
|
@@ -40,9 +46,10 @@ import com.jtgh.yjpt.webService.WsResult;
|
|
|
*/
|
|
|
@Service
|
|
|
@WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "yjglService")
|
|
|
-@HandlerChain(file="handle-chain.xml")
|
|
|
+@HandlerChain(file = "handle-chain.xml")
|
|
|
public class YjglWebService extends BaseController {
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private ThreadPoolTaskExecutor threadPool;
|
|
|
@Autowired
|
|
|
private YjpxService yjpxService;
|
|
|
@Autowired
|
|
@@ -53,19 +60,19 @@ public class YjglWebService extends BaseController {
|
|
|
private SgalglService sgalglService;
|
|
|
@Autowired
|
|
|
private YjwzFlxxService yjwzFlxxService;
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 保存应急培训
|
|
|
+ *
|
|
|
* @param entity
|
|
|
* @return
|
|
|
*/
|
|
|
public YjpxEntity saveYjpx(YjpxEntity entity) {
|
|
|
- if(entity.getId()==null || entity.getId().equals(0l)){
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
entity.setAddDate(new Date());
|
|
|
entity.setAddUser(Utils.getWebServiceUser());
|
|
|
entity.setRecordCode("90");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
YjpxEntity vo = yjpxService.findOne(entity.getId());
|
|
|
entity.setAddDate(vo.getAddDate());
|
|
|
entity.setAddUser(vo.getAddUser());
|
|
@@ -81,45 +88,108 @@ public class YjglWebService extends BaseController {
|
|
|
entity = yjpxService.saveEntity(entity);
|
|
|
return entity;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除应急培训
|
|
|
+ *
|
|
|
* @param entities
|
|
|
*/
|
|
|
- public WsResult deleteYjpx(YjpxEntity entity){
|
|
|
+ public WsResult deleteYjpx(YjpxEntity entity) {
|
|
|
WsResult ws = new WsResult();
|
|
|
try {
|
|
|
- if(entity.getId()!=null)
|
|
|
+ if (entity.getId() != null)
|
|
|
yjpxService.logicDeleteEntity(entity);
|
|
|
ws.setResultCode(WsResult.SUCCESS);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
ws.setResultCode(WsResult.FAILURE);
|
|
|
}
|
|
|
- return ws;
|
|
|
+ return ws;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询应急培训详细信息
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public YjpxEntity findYjpxById(Long id){
|
|
|
+ public YjpxEntity findYjpxById(Long id) {
|
|
|
YjpxEntity entity = yjpxService.findOne(id);
|
|
|
- return entity;
|
|
|
+ return entity;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 应急培训的分页列表
|
|
|
+ *
|
|
|
+ * @param pxmc
|
|
|
+ * @param beginDate
|
|
|
+ * @param endDate
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param lb
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjpxEntity> getYjpxPageListByParam(String pxmc, String qymc,
|
|
|
+ String pxdd, Date beginDate, Date endDate, Long szd, Long gq,
|
|
|
+ String lb, int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 根据培训名称过滤
|
|
|
+ addNotEmptyModel(filterList, "pxmc", pxmc, Operator.LIKE);
|
|
|
+ // 所在地
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ // 根据机构名称
|
|
|
+ addNotEmptyModel(filterList, "qymc.gkjyr", qymc, Operator.LIKE);
|
|
|
+ // 培训地点
|
|
|
+ addNotEmptyModel(filterList, "pxdd", pxdd, Operator.LIKE);
|
|
|
+
|
|
|
+ addNotEmptyModel(filterList, "byzd1", lb, Operator.EQ);
|
|
|
+ // 港区
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ // 开始时间
|
|
|
+ addNotEmptyModel(filterList, "pxsj", Utils.getDateFirstTime(beginDate),
|
|
|
+ Operator.GTE);
|
|
|
+ // 结束时间
|
|
|
+ addNotEmptyModel(filterList, "pxsj", Utils.getDateLastTime(endDate),
|
|
|
+ Operator.LTE);
|
|
|
+ // 只检索非删除状态记录
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ // 根据当前登录用户的经营人信息判断它是否为经营人
|
|
|
+ if (Utils.getWebServiceUser() != null) {
|
|
|
+ UserEntity user = Utils.getWebServiceUser();
|
|
|
+ // 经营人只能查自己的
|
|
|
+ if (Constants.YES.equals(user.getSfjyr())
|
|
|
+ && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "qymc", user.getJyrjcxx(),
|
|
|
+ Operator.EQ);
|
|
|
+ } else {
|
|
|
+ // 行政人员根据权限过滤(培训列表菜单ID=15)
|
|
|
+ addRecordCodeFilter(15l, filterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Specification<YjpxEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
+ Page<YjpxEntity> list = yjpxService.findAll(spec, pageable);
|
|
|
+ if (list == null || list.getTotalPages() <= pageCount) {
|
|
|
+ return new ArrayList<YjpxEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存应急演习
|
|
|
+ *
|
|
|
* @param entity
|
|
|
* @return
|
|
|
*/
|
|
|
public YjyxEntity saveYjyx(YjyxEntity entity) {
|
|
|
- if(entity.getId()==null || entity.getId().equals(0l)){
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
entity.setAddDate(new Date());
|
|
|
entity.setAddUser(Utils.getWebServiceUser());
|
|
|
entity.setRecordCode("90");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
YjyxEntity vo = yjyxService.findById(entity.getId());
|
|
|
entity.setAddDate(vo.getAddDate());
|
|
|
entity.setAddUser(vo.getAddUser());
|
|
@@ -135,45 +205,108 @@ public class YjglWebService extends BaseController {
|
|
|
entity = yjyxService.saveEntity(entity);
|
|
|
return entity;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除应急演习
|
|
|
+ *
|
|
|
* @param entities
|
|
|
*/
|
|
|
- public WsResult deleteYjyx(YjyxEntity entity){
|
|
|
+ public WsResult deleteYjyx(YjyxEntity entity) {
|
|
|
WsResult ws = new WsResult();
|
|
|
try {
|
|
|
- if(entity.getId()!=null)
|
|
|
+ if (entity.getId() != null)
|
|
|
yjyxService.logicDeleteEntity(entity);
|
|
|
ws.setResultCode(WsResult.SUCCESS);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
ws.setResultCode(WsResult.FAILURE);
|
|
|
}
|
|
|
- return ws;
|
|
|
+ return ws;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查询应急演习详细信息
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public YjyxEntity findYjyxById(Long id){
|
|
|
+ public YjyxEntity findYjyxById(Long id) {
|
|
|
YjyxEntity entity = yjyxService.findById(id);
|
|
|
- return entity;
|
|
|
+ return entity;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 应急演习分页查询
|
|
|
+ *
|
|
|
+ * @param yxmc
|
|
|
+ * @param qymc
|
|
|
+ * @param yxdd
|
|
|
+ * @param beginDate
|
|
|
+ * @param endDate
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjyxEntity> getYjyxPageListByParam(String yxmc, String qymc,
|
|
|
+ String yxdd, Date beginDate, Date endDate, Long szd, Long gq,
|
|
|
+ int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 根据演习名称过滤
|
|
|
+ addNotEmptyModel(filterList, "yxmc", yxmc, Operator.LIKE);
|
|
|
+ // 根据机构名称
|
|
|
+ addNotEmptyModel(filterList, "qymc.gkjyr", qymc, Operator.LIKE);
|
|
|
+ // 演习地点
|
|
|
+ addNotEmptyModel(filterList, "yxdd", yxdd, Operator.LIKE);
|
|
|
+ // 所在地
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ // 港区
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ // 开始时间
|
|
|
+ addNotEmptyModel(filterList, "yxsj", Utils.getDateFirstTime(beginDate),
|
|
|
+ Operator.GTE);
|
|
|
+ // 结束时间
|
|
|
+ addNotEmptyModel(filterList, "yxsj", Utils.getDateLastTime(endDate),
|
|
|
+ Operator.LTE);
|
|
|
+ // 只检索非删除状态记录
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ if (Utils.getWebServiceUser() != null) {
|
|
|
+ UserEntity user = Utils.getWebServiceUser();
|
|
|
+ // 经营人只能查自己的
|
|
|
+ if (Constants.YES.equals(user.getSfjyr())
|
|
|
+ && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "qymc", user.getJyrjcxx(),
|
|
|
+ Operator.EQ);
|
|
|
+ } else {
|
|
|
+ // 行政人员根据权限过滤(演习列表菜单ID=16)
|
|
|
+ addRecordCodeFilter(16l, filterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Specification<YjyxEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
+ Page<YjyxEntity> list = yjyxService.findAll(spec, pageable);
|
|
|
+ if (list == null || list.getTotalPages() <= pageCount) {
|
|
|
+ return new ArrayList<YjyxEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存应急演练
|
|
|
+ *
|
|
|
* @param entity
|
|
|
* @return
|
|
|
*/
|
|
|
public YjylEntity saveYjyl(YjylEntity entity) {
|
|
|
- if(entity.getId()==null || entity.getId().equals(0l)){
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
entity.setAddDate(new Date());
|
|
|
entity.setAddUser(Utils.getWebServiceUser());
|
|
|
entity.setRecordCode("90");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
YjylEntity vo = yjylService.findById(entity.getId());
|
|
|
entity.setAddDate(vo.getAddDate());
|
|
|
entity.setAddUser(vo.getAddUser());
|
|
@@ -189,47 +322,108 @@ public class YjglWebService extends BaseController {
|
|
|
entity = yjylService.saveEntity(entity);
|
|
|
return entity;
|
|
|
}
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
+ * 查询应急演练详细信息/**
|
|
|
* 删除应急演练
|
|
|
+ *
|
|
|
* @param entities
|
|
|
*/
|
|
|
- public WsResult deleteYjyl(YjylEntity entity){
|
|
|
+ public WsResult deleteYjyl(YjylEntity entity) {
|
|
|
WsResult ws = new WsResult();
|
|
|
try {
|
|
|
- if(entity.getId()!=null)
|
|
|
+ if (entity.getId() != null)
|
|
|
yjylService.logicDeleteEntity(entity);
|
|
|
ws.setResultCode(WsResult.SUCCESS);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
ws.setResultCode(WsResult.FAILURE);
|
|
|
}
|
|
|
- return ws;
|
|
|
+ return ws;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 查询应急演练详细信息
|
|
|
+ /* *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
- public YjylEntity findYjylById(Long id){
|
|
|
+ public YjylEntity findYjylById(Long id) {
|
|
|
YjylEntity entity = yjylService.findById(id);
|
|
|
- return entity;
|
|
|
+ return entity;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 应急演练分页查询
|
|
|
+ *
|
|
|
+ * @param ylmc
|
|
|
+ * @param beginDate
|
|
|
+ * @param endDate
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjylEntity> getYjylPageListByParam(String ylmc, String qymc,
|
|
|
+ String yldd, Date beginDate, Date endDate, Long szd, Long gq,
|
|
|
+ int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 根据演练名称过滤
|
|
|
+ addNotEmptyModel(filterList, "ylmc", ylmc, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ // 根据机构名称
|
|
|
+ addNotEmptyModel(filterList, "qymc.gkjyr", qymc, Operator.LIKE);
|
|
|
+ // 演练地点
|
|
|
+ addNotEmptyModel(filterList, "yldd", yldd, Operator.LIKE);
|
|
|
+ // 港区
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ // 开始时间
|
|
|
+ addNotEmptyModel(filterList, "ylsj", Utils.getDateFirstTime(beginDate),
|
|
|
+ Operator.GTE);
|
|
|
+ // 结束时间
|
|
|
+ addNotEmptyModel(filterList, "ylsj", Utils.getDateLastTime(endDate),
|
|
|
+ Operator.LTE);
|
|
|
+ // 只检索非删除状态记录
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ if (Utils.getWebServiceUser() != null) {
|
|
|
+ UserEntity user = Utils.getWebServiceUser();
|
|
|
+ // 经营人只能查自己的
|
|
|
+ if (Constants.YES.equals(user.getSfjyr())
|
|
|
+ && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "qymc", user.getJyrjcxx(),
|
|
|
+ Operator.EQ);
|
|
|
+ } else {
|
|
|
+ // 行政人员根据权限过滤(演练列表菜单ID=17)
|
|
|
+ addRecordCodeFilter(17l, filterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Specification<YjylEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
+ Page<YjylEntity> list = yjylService.findAll(spec, pageable);
|
|
|
+ if (list == null || list.getTotalPages() <= pageCount) {
|
|
|
+ return new ArrayList<YjylEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存事故案例
|
|
|
+ *
|
|
|
* @param entity
|
|
|
* @param saveList
|
|
|
* @return
|
|
|
*/
|
|
|
- public SgalglEntity saveSgal(SgalglEntity entity,List<SgalglwzddEntity> saveList){
|
|
|
- if(entity.getId()==null || entity.getId().equals(0l)){
|
|
|
+ public SgalglEntity saveSgal(SgalglEntity entity,
|
|
|
+ List<SgalglwzddEntity> saveList) {
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
entity.setAddDate(new Date());
|
|
|
entity.setAddUser(Utils.getWebServiceUser());
|
|
|
entity.setRecordCode("90");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
SgalglEntity vo = sgalglService.findOne(entity.getId());
|
|
|
entity.setAddDate(vo.getAddDate());
|
|
|
entity.setAddUser(vo.getAddUser());
|
|
@@ -245,10 +439,111 @@ public class YjglWebService extends BaseController {
|
|
|
entity = sgalglService.save(entity, saveList);
|
|
|
return entity;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取事故案例 详细 信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public SgalglEntity findSgalById(Long id) {
|
|
|
+ return sgalglService.findOne(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急事故的分页列表
|
|
|
+ *
|
|
|
+ * @param sglx
|
|
|
+ * @param sgdj
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param dwmc
|
|
|
+ * @param fzr
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ public List<SgalglEntity> getSgalPageListByParam(Long sglx, Long sgdj,
|
|
|
+ Long szd, Long gq, Long dwmc, String fzr, int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 根据事故类别过滤
|
|
|
+ addNotEmptyModel(filterList, "sglx", sglx, Operator.EQ);
|
|
|
+ // 根据事故等级过滤
|
|
|
+ addNotEmptyModel(filterList, "sgdj", sgdj, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "sgdwmc.id", dwmc, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "chargeman", fzr, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ if (Utils.getWebServiceUser() != null) {
|
|
|
+ UserEntity user = Utils.getWebServiceUser();
|
|
|
+ // 经营人只能查自己的
|
|
|
+ if (Constants.YES.equals(user.getSfjyr())
|
|
|
+ && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "sgdwmc", user.getJyrjcxx(),
|
|
|
+ Operator.EQ);
|
|
|
+ } else {
|
|
|
+ // 行政人员根据权限过滤(事故案例列表菜单ID=18)
|
|
|
+ addRecordCodeFilter(18l, filterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Specification<SgalglEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
+ Page<SgalglEntity> pageList = sgalglService.findAll(spec, pageable);
|
|
|
+ if (pageList == null || pageList.getTotalPages() <= pageCount) {
|
|
|
+ return new ArrayList<SgalglEntity>();
|
|
|
+ }
|
|
|
+ return pageList.getContent();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 删除事故案例
|
|
|
+ *
|
|
|
+ * @param entities
|
|
|
+ */
|
|
|
+ public WsResult deleteSgal(final SgalglEntity entity) {
|
|
|
+ WsResult ws = new WsResult();
|
|
|
+ try {
|
|
|
+ if (entity.getId() != null)
|
|
|
+ {
|
|
|
+ sgalglService.logicDelete(entity.getId());
|
|
|
+ // 数据同步
|
|
|
+ if (Constants.DEPLOY_MODE_CITY.equals(GlobalData.DEPLOY_MODE)
|
|
|
+ && Constants.YES.equals(GlobalData.JAXWS_SYNC)) {
|
|
|
+ Thread thread = new Thread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ SgalglWebService webService = sgalglService
|
|
|
+ .getWebService();
|
|
|
+ if (webService != null) {
|
|
|
+ webService.delete(entity);
|
|
|
+ entity.setTbzt(Constants.YES);
|
|
|
+ sgalglService.save(entity);
|
|
|
+ } else {
|
|
|
+ entity.setTbzt(Constants.NO);
|
|
|
+ sgalglService.save(entity);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ threadPool.execute(thread);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ws.setResultCode(WsResult.SUCCESS);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ ws.setResultCode(WsResult.FAILURE);
|
|
|
+ }
|
|
|
+ return ws;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取应急物资分页列表
|
|
|
+ *
|
|
|
* @param gkdw
|
|
|
* @param dw
|
|
|
* @param ssmc
|
|
@@ -256,8 +551,8 @@ public class YjglWebService extends BaseController {
|
|
|
* @param pageCount
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<YjwzFlxxEntity> queryWzzz(Long gkdw, String dw,
|
|
|
- String ssmc,int n,int pageCount) {
|
|
|
+ public List<YjwzFlxxEntity> queryWzzz(Long gkdw, String dw, String ssmc,
|
|
|
+ int n, int pageCount) {
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
// 根据事故类别过滤
|
|
|
if (0l != gkdw) {
|
|
@@ -273,10 +568,10 @@ public class YjglWebService extends BaseController {
|
|
|
BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
Specification<YjwzFlxxEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
- SinglePageRequest pageable = new SinglePageRequest(pageCount, n, "desc",
|
|
|
- "id");
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
Page<YjwzFlxxEntity> list = yjwzFlxxService.findAll(spec, pageable);
|
|
|
- if(list==null || list.getTotalPages()<=pageCount){
|
|
|
+ if (list == null || list.getTotalPages() <= pageCount) {
|
|
|
return new ArrayList<YjwzFlxxEntity>();
|
|
|
}
|
|
|
return list.getContent();
|