|
@@ -0,0 +1,345 @@
|
|
|
+package com.jtgh.yjpt.webService.yjzyxxgl;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import javax.jws.HandlerChain;
|
|
|
+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.stereotype.Service;
|
|
|
+
|
|
|
+import com.jtgh.yjpt.common.Constants;
|
|
|
+import com.jtgh.yjpt.common.PredicateModel;
|
|
|
+import com.jtgh.yjpt.common.Utils;
|
|
|
+import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
|
+import com.jtgh.yjpt.common.SinglePageRequest;
|
|
|
+import com.jtgh.yjpt.common.SpecificationCreater;
|
|
|
+import com.jtgh.yjpt.controller.BaseController;
|
|
|
+import com.jtgh.yjpt.controller.yjzyxxgl.ZyyjjydwController;
|
|
|
+import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
+import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
+import com.jtgh.yjpt.entity.common.AccessoryEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.JzyjjydwryhzEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.YjwlEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.YjwzFlxxEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.YjwzxxEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.YjzjkEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.ZyyjjydwEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjzyxxgl.ZyyjjydwryhzEntity;
|
|
|
+import com.jtgh.yjpt.service.common.AccessoryService;
|
|
|
+import com.jtgh.yjpt.service.yjzyxxgl.YjwlService;
|
|
|
+import com.jtgh.yjpt.service.yjzyxxgl.YjwzFlxxService;
|
|
|
+import com.jtgh.yjpt.service.yjzyxxgl.YjwzxxService;
|
|
|
+import com.jtgh.yjpt.service.yjzyxxgl.YjzjkService;
|
|
|
+import com.jtgh.yjpt.service.yjzyxxgl.ZyyjjydwService;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 应急资源WebService
|
|
|
+ *
|
|
|
+ * @author chenkf
|
|
|
+ *
|
|
|
+ */
|
|
|
+@Service
|
|
|
+@WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "yjzyxxglService")
|
|
|
+@HandlerChain(file = "handle-chain.xml")
|
|
|
+public class YjzyxxglWebService extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private YjwzFlxxService yjwzFlxxService;
|
|
|
+ @Autowired
|
|
|
+ private YjzjkService yjzjkService;
|
|
|
+ @Autowired
|
|
|
+ private YjwzxxService yjwzxxService;
|
|
|
+ @Autowired
|
|
|
+ private YjwlService yjwlService;
|
|
|
+ @Autowired
|
|
|
+ private AccessoryService accessoryService;
|
|
|
+ @Autowired
|
|
|
+ private ZyyjjydwService zyjjydwService;
|
|
|
+ @Autowired
|
|
|
+ private ZyyjjydwController zyyjjydwController;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急专家库分页信息
|
|
|
+ *
|
|
|
+ * @param szd
|
|
|
+ * @param sfsygkj
|
|
|
+ * @param xm
|
|
|
+ * @param xb
|
|
|
+ * @param xjzd
|
|
|
+ * @param gzdw
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjzjkEntity> getYjzjkPageListByParams(Long szd, String sfsygkj,
|
|
|
+ String xm, String xb, String xjzd, String gzdw, int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 根据姓名过滤
|
|
|
+ addNotEmptyModel(filterList, "xm", xm, Operator.LIKE);
|
|
|
+ // 根据性别过滤
|
|
|
+ addNotEmptyModel(filterList, "xb", xb, Operator.EQ);
|
|
|
+ // 根据现居住地过滤
|
|
|
+ addNotEmptyModel(filterList, "xjzd", xjzd, Operator.LIKE);
|
|
|
+ // 根据工作单位过滤
|
|
|
+ addNotEmptyModel(filterList, "gzdw", gzdw, Operator.LIKE);
|
|
|
+ // 根据 所在地过滤
|
|
|
+ if (szd != null)
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ // 根据是否数据港口局专家库过滤
|
|
|
+ addNotEmptyModel(filterList, "sfsygkj", sfsygkj, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<YjzjkEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
|
|
|
+ "id");
|
|
|
+ Page<YjzjkEntity> list = yjzjkService.findAll(spec, page);
|
|
|
+ if (list == null || list.getTotalPages() < pageCount) {
|
|
|
+ return new ArrayList<YjzjkEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急专家库信息(返回附件)
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public YjzjkEntity findYjzjkById(Long id) {
|
|
|
+ YjzjkEntity entity = yjzjkService.queryYjzjk(id);
|
|
|
+ if (entity != null) {
|
|
|
+ // 检索附件
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ addNotEmptyModel(filterList, "entityType.id",
|
|
|
+ Constants.ACCESSORY_ENTITY_TYPE_YJZJK, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "entityId", entity.getId(),
|
|
|
+ PredicateModel.Operator.EQ);
|
|
|
+ Specification<AccessoryEntity> accSpec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ List<AccessoryEntity> acc = accessoryService.findAll(accSpec);
|
|
|
+ if (acc != null && acc.size() > 0)
|
|
|
+ entity.setAccessory(acc.get(0));
|
|
|
+ }
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急物资分页信息
|
|
|
+ *
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param gkdw
|
|
|
+ * @param lxr
|
|
|
+ * @param lxdh
|
|
|
+ * @param dw
|
|
|
+ * @param lb
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjwzxxEntity> getYjwzPageListByParams(Long szd, long gq,
|
|
|
+ Long gkdw, String lxr, String lxdh, String dw, String lb, int n,
|
|
|
+ int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ if (szd != 0l)
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ if (gq != 0l) {
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ }
|
|
|
+ addNotEmptyModel(filterList, "gkdw", gkdw, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "lxr", lxr, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "byzd1", lb, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "lxdh", lxdh, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "szdgkj", dw, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<YjwzxxEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
|
|
|
+ "id");
|
|
|
+ Page<YjwzxxEntity> list = yjwzxxService.findAll(spec, page);
|
|
|
+ if (list == null || list.getTotalPages() < pageCount) {
|
|
|
+ return new ArrayList<YjwzxxEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急物资详细信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public YjwzxxEntity findYjwzById(Long id) {
|
|
|
+ YjwzxxEntity entity = yjwzxxService.findOne(id);
|
|
|
+ if (entity != null) {
|
|
|
+ List<YjwzFlxxEntity> yjwzFlxx = findYjwzFlxxByYjwz(entity);
|
|
|
+ entity.setYjwzFlxx(yjwzFlxx);
|
|
|
+ }
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据应急物资获取应急物资设施详细信息列表
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjwzFlxxEntity> findYjwzFlxxByYjwz(YjwzxxEntity entity) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ if (entity != null) {
|
|
|
+ addNotEmptyModel(filterList, "wzid", entity.getId(), Operator.EQ);
|
|
|
+ }
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<YjwzFlxxEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ return yjwzFlxxService.findAll(spec);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急物资设施详细详细
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public YjwzFlxxEntity findYjwzFlxxById(Long id) {
|
|
|
+ return yjwzFlxxService.findOne(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急队伍分页信息
|
|
|
+ *
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param qymc
|
|
|
+ * @param jyxz
|
|
|
+ * @param zyfzr
|
|
|
+ * @param jzfzr
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ZyyjjydwEntity> getYjdwPageListByParams(Long szd, Long gq,
|
|
|
+ Long qymc, String jyxz, String zyfzr, String jzfzr, int n,
|
|
|
+ int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ addNotEmptyModel(filterList, "qymc", qymc, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ // 只检索所在地
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
+ // 只检索救援小组
|
|
|
+ addNotEmptyModel(filterList, "jyxz", jyxz, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "zy_fzr", zyfzr, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "jz_fzr", jzfzr, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<ZyyjjydwEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ if (Utils.getWebServiceUser() != null) {
|
|
|
+ UserEntity user = Utils.getWebServiceUser();
|
|
|
+ // 经营人只能查自己的
|
|
|
+ if (Constants.YES.equals(user.getSfjyr())
|
|
|
+ && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "ssjyr", user.getJyrjcxx(),
|
|
|
+ Operator.EQ);
|
|
|
+ } else {
|
|
|
+ // 行政人员根据权限过滤(应急队伍列表菜单ID=12)
|
|
|
+ addRecordCodeFilter(12l, filterList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
|
|
|
+ "id");
|
|
|
+ Page<ZyyjjydwEntity> list = zyjjydwService.findAll(spec, page);
|
|
|
+ if (list == null || list.getTotalPages() < pageCount) {
|
|
|
+ return new ArrayList<ZyyjjydwEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急队伍详细信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ZyyjjydwEntity findYjdwById(Long id) {
|
|
|
+ ZyyjjydwEntity entity = zyjjydwService.findOne(id);
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据应急队伍查询专业应急队伍人员
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ public List<ZyyjjydwryhzEntity> zyrylist(Long zyyjjydwId) {
|
|
|
+ return (List<ZyyjjydwryhzEntity>) zyyjjydwController.zyrylist(
|
|
|
+ zyyjjydwId).getAttribute("list");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据应急队伍查询兼职应急队伍人员
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ public List<JzyjjydwryhzEntity> jzrylist(Long jzyjjydwId) {
|
|
|
+ return (List<JzyjjydwryhzEntity>) zyyjjydwController.jzrylist(
|
|
|
+ jzyjjydwId).getAttribute("list");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急网络分页信息
|
|
|
+ *
|
|
|
+ * @param szd
|
|
|
+ * @param gq
|
|
|
+ * @param type
|
|
|
+ * @param name
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<YjwlEntity> getYjwlPageListByParams(Long szd, Long gq,
|
|
|
+ String type, String name, int n, int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 只检索非删除状态记录
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "name", name, PredicateModel.Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "type", type, PredicateModel.Operator.EQ);
|
|
|
+ if (!szd.equals(0l)) {
|
|
|
+ addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE);
|
|
|
+ }
|
|
|
+ addNotEmptyModel(filterList, "gq", gq, Operator.EQ);
|
|
|
+ Specification<YjwlEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
|
|
|
+ "id");
|
|
|
+ try {
|
|
|
+ Page<YjwlEntity> list = yjwlService.findAll(spec, page);
|
|
|
+ if (list == null || list.getTotalPages() < pageCount) {
|
|
|
+ return new ArrayList<YjwlEntity>();
|
|
|
+ }
|
|
|
+ return list.getContent();
|
|
|
+ } catch (Throwable e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return new ArrayList<YjwlEntity>();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取应急网络详细信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public YjwlEntity findYjwlById(Long id) {
|
|
|
+ return yjwlService.findOne(id);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|