Bläddra i källkod

git-svn-id: https://192.168.57.71/svn/lyggkj@26 1a6f6e3a-4066-fe46-b609-79c204482ece

ld_liufl 9 år sedan
förälder
incheckning
67f978d24e

+ 8 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Constants.java

@@ -1,3 +1,4 @@
+
 package com.jtgh.yjpt.common;
 
 /**
@@ -32,6 +33,8 @@ public class Constants {
 
 	/** 附证二维码地址 */
 	public static String FZ_QRCODE = "";
+	/** 基础信息二维码地址 */
+	public static String ALL_QRCODE = "";
 	// ------------------------------编号规则------------------------------
 	/** 危险货物作业附证编号 */
 	public static final String NO_RULE_WHZYFZ = "WHZYFZ";
@@ -848,4 +851,9 @@ public class Constants {
 	 */
 	public final static String GNMK_JYRJCXX = "1";
 	public final static String GNMK_JYRJCXX_BW = "2";
+
+	// ************************二维码类型********************************************
+	public final static String QRCODE_CG = "CG|";// 储罐
+	public final static String QRCODE_RYJBXX = "CG|";// 储罐
+	
 }

+ 92 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Utils.java

@@ -1,6 +1,14 @@
 package com.jtgh.yjpt.common;
 
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.reflect.Field;
@@ -19,6 +27,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import javax.imageio.ImageIO;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
@@ -48,6 +57,7 @@ import com.jtgh.yjpt.entity.qlyg.ApplyEntity;
 import com.jtgh.yjpt.entity.qlyg.ApplyProcessEntity;
 import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
 import com.jtgh.yjpt.webService.common.AuthHandler;
+import com.swetake.util.Qrcode;
 
 import flex.messaging.FlexContext;
 
@@ -735,4 +745,86 @@ public abstract class Utils {
 		t.printStackTrace(new PrintWriter(sw));
 		return sw.toString();
 	}
+
+	public static byte[] getQrcodeImage(int length,int width, String content){
+		BufferedImage img = new BufferedImage(length, width,
+				BufferedImage.TYPE_INT_RGB);
+		for (int i = 0; i < img.getWidth(); i++) {
+			for (int j = 0; j < img.getHeight(); j++) {
+				img.setRGB(i, j, 0xffffff);
+			}
+		}
+		Graphics2D g = (Graphics2D) img.getGraphics();
+		g.rotate(Math.PI / 2, length / 2, length / 2);
+		g.setColor(new Color(0, 0, 0));
+		g.setFont(new Font("宋体", Font.PLAIN, 14));
+		// 二维码
+		try {
+			// 二维码版本
+			int version = 7;
+			// 图片尺寸
+			int imgSize = 67 + 12 * (version - 1);
+			BufferedImage qrImg = new BufferedImage(imgSize, imgSize,
+					BufferedImage.TYPE_INT_RGB);
+			Graphics2D gs = qrImg.createGraphics();
+			gs.setBackground(Color.WHITE);
+			gs.clearRect(0, 0, imgSize, imgSize);
+			Qrcode qrcodeHandler = new Qrcode();
+			// 设置二维码排错率,可选L(7%)、M(15%)、Q(25%)、H(30%),排错率越高可存储的信息越少,但对二维码清晰度的要求越小
+			qrcodeHandler.setQrcodeErrorCorrect('M');
+			// N代表数字,A代表字符a-Z,B代表其他字符
+			qrcodeHandler.setQrcodeEncodeMode('B');
+			// 设置二维码版本,取值范围1-40,值越大尺寸越大,可存储的信息越大
+			qrcodeHandler.setQrcodeVersion(version);
+			byte[] contentBytes = content.getBytes("gb2312");
+			gs.setColor(Color.BLACK);
+			// 设置偏移量 不设置可能导致解析出错
+			int pixoff = 2;
+			// 输出内容> 二维码
+			if (contentBytes.length > 0 && contentBytes.length < 120) {
+				boolean[][] codeOut = qrcodeHandler
+						.calQrcode(contentBytes);
+				for (int i = 0; i < codeOut.length; i++) {
+					for (int j = 0; j < codeOut.length; j++) {
+						if (codeOut[j][i]) {
+							gs.fillRect(j * 3 + pixoff, i * 3 + pixoff,
+									3, 3);
+						}
+					}
+				}
+			} else {
+				System.err.println("QRCode content bytes length = "
+						+ contentBytes.length + " not in [ 0,120 ]. ");
+			}
+			// 中间logo
+			InputStream imgIn = new FileInputStream(Utils.getSession()
+					.getServletContext().getRealPath("/")
+					+ "resource/yjpt/login/login_logo.png");
+			Image logo = ImageIO.read(imgIn);
+			int widthLogo = logo.getWidth(null) > qrImg.getWidth() * 2 / 10 ? (qrImg
+					.getWidth() * 2 / 10) : logo.getWidth(null);
+			int heightLogo = logo.getHeight(null) > qrImg.getHeight() * 2 / 10 ? (qrImg
+					.getHeight() * 2 / 10) : logo.getWidth(null);
+			int x = (qrImg.getWidth() - widthLogo) / 2;
+			int y = (qrImg.getHeight() - heightLogo) / 2;
+			gs.drawImage(logo, x, y, widthLogo, heightLogo, null);
+			gs.dispose();
+			qrImg.flush();
+
+			g.drawImage(qrImg.getScaledInstance(100, 100,
+					Image.SCALE_DEFAULT), 6, 6, null);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		g.dispose();
+		ByteArrayOutputStream bos = new ByteArrayOutputStream();
+		try {
+			ImageIO.write(img, "PNG", bos);
+			return bos.toByteArray();
+		} catch(Exception e){
+			e.printStackTrace();
+		}
+		return null;
+	}
+			
 }

+ 22 - 43
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/check/DcController.java

@@ -523,9 +523,18 @@ public class DcController extends BaseController {
 		return createBusinessContext(dcEntity);
 	}
 
+	/**
+	 * 获取督查详细 信息
+	 * @param dcId
+	 * @return
+	 */
 	public BusinessContext getDcxxById(Long dcId) {
 		BusinessContext bc = new BusinessContext();
 		DcEntity dcEntity = dcService.findOne(dcId);
+		//获取督查任务信息
+		if (dcEntity.getTaskList() != null && dcEntity.getTaskList().size() > 0) {
+			dcEntity.getTaskList().get(0);
+		}
 		List<AccessoryEntity> acc;
 		List<byte[]> list;
 		if (BaseEntity.RECORD_STATE_DELETE == dcEntity.getRecordStatus()) {
@@ -747,42 +756,7 @@ public class DcController extends BaseController {
 			dcService.claim(entity.getId().toString(), Utils.getCurrentUser()
 					.getId().toString());
 		}
-		boolean init = false;
-		if (null == entity.getId()) {
-			if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {// 市级新增的添加人设置为当前登录用户
-				entity.setAddUser(Utils.getCurrentUser());
-			} else {// 省级新增的添加人设置统一的TB_USER
-				entity.setAddUser(GlobalData.TB_USER);
-			}
-			entity.setAddDate(new Date());
-			entity.setRecordCode(getCurrentRoleCode(functionId));
-			init = true;
-		} else {
-			if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {// 市级新增的修改人设置为当前登录用户
-				entity.setUpdateUser(Utils.getCurrentUser());
-			} else {// 省级新增的添加人设置统一的TB_USER
-				entity.setUpdateUser(GlobalData.TB_USER);
-			}
-			entity.setUpdateDate(new Date());
-		}
-		DcEntity dcEntity = dcService.save(entity);
-		if (null != accessoryList) {
-			for (AccessoryEntity acc : accessoryList) {
-				acc = accessoryService.findOne(acc.getId());
-				acc.setEntityId(dcEntity.getId());
-				accessoryService.save(acc);
-			}
-		}
-		AccessoryEntity acc = null;
-		if (init) {
-			if (null != entity.getZgjg()) {
-				acc = accessoryService.findOne(entity.getZgjg().getId());
-				if (null != acc) {
-					acc.setEntityId(entity.getId());
-					accessoryService.save(acc);
-				}
-			}
-		}
+		DcEntity dcEntity = dcService.findOne(entity.getId());
 		// ===============数据保存完后开始逻辑======
 		DcEntity tbEntity = null;
 		if (flag == false) {// 如果不通过,记录历史
@@ -828,6 +802,17 @@ public class DcController extends BaseController {
 					.listById(dcEntity.getId(),
 							Long.parseLong(Constants.FJSSLX_DCZGHZP))
 					.getAttribute("records");
+			// 查询整改措施附件
+			List<AccessoryEntity> acc4 = (List<AccessoryEntity>) accessoryController
+					.listById(dcEntity.getId(),
+							Long.parseLong(Constants.FJSSLX_DCZGYQFJ))
+					.getAttribute("records");
+			for (AccessoryEntity accessoryEntity : acc4) {
+				AccessoryEntity copy = accessoryEntity.clone();
+				copy.setId(null);
+				copy.setEntityId(tbEntity.getId());
+				accessoryService.save(copy);
+			}			
 			for (AccessoryEntity accessoryEntity : acc3) {
 				AccessoryEntity copy = accessoryEntity.clone();
 				copy.setId(null);
@@ -875,13 +860,7 @@ public class DcController extends BaseController {
 						}
 					}
 				}
-
-				if (init && null != entity.getZgjg()
-						&& null != accessoryWebService) {// 同步整改结果附件
-					entity.getZgjg().setEntityId(dcEntity.getId());
-					entity.getZgjg().setId(null);
-					accessoryWebService.save(entity.getZgjg());
-				} else if (null == accessoryWebService) {
+				if (null == accessoryWebService) {
 					entity.getZgjg().setTbzt(Constants.NO);
 					accessoryService.save(entity.getZgjg());
 				}

+ 114 - 90
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/jyrxxgl/RyjbxxController.java

@@ -139,24 +139,24 @@ public class RyjbxxController extends BaseController {
 	@RequestMapping(value = "ryjcxxJasper", method = RequestMethod.POST)
 	@ResponseBody
 	@RemotingExclude
-	public void jasperPrint(@RequestParam String id,String sfzh,
+	public void jasperPrint(@RequestParam String id, String sfzh,
 			HttpServletResponse response, HttpServletRequest request) {
 		List<RyjbxxEntity> dataList = new ArrayList<RyjbxxEntity>();
 		RyjbxxEntity data = service.findOne(Long.parseLong(id));
 		dataList.add(data);
-		Map<String, Object> parameters=new HashMap<String, Object>();
-		
-		List<RyjbxxZSEntity> dataList2 =  new ArrayList<RyjbxxZSEntity>();
+		Map<String, Object> parameters = new HashMap<String, Object>();
+
+		List<RyjbxxZSEntity> dataList2 = new ArrayList<RyjbxxZSEntity>();
 		dataList2 = service.ryjbxxzsByRyid(sfzh);
-		//parameters.put("SUBREPORT_DIR", "iReport/jyr/");
+		// parameters.put("SUBREPORT_DIR", "iReport/jyr/");
 		parameters.put("SUBREPORT_DIR", "iReport/jyr/");
 
 		parameters.put("sublist", dataList2);
 		download(parameters, "人员基础信息", "iReport/jyr/ryjcxx.jasper",
 				ReportExportHelper.REPORT_EXPORT_TYPE_WORD,
 				new JRBeanCollectionDataSource(dataList), response, request);
-		}
-	
+	}
+
 	public Collection<String[]> print(List<String> param) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		addNotEmptyModel(filterList, "szd.id", param.get(0), Operator.LIKE_R);
@@ -221,8 +221,8 @@ public class RyjbxxController extends BaseController {
 	@Log(Type.ADD)
 	public BusinessContext doAdd(RyjbxxEntity ryjbxxEntity,
 			List<RyjbxxZSEntity> zsList, List<RyjbxxZSEntity> deleteZsList,
-			Long functionId ,Long accId) {
-		return save(ryjbxxEntity, zsList, deleteZsList, functionId,accId);
+			Long functionId, Long accId) {
+		return save(ryjbxxEntity, zsList, deleteZsList, functionId, accId);
 	}
 
 	/**
@@ -234,13 +234,13 @@ public class RyjbxxController extends BaseController {
 	@Log(Type.EDIT)
 	public BusinessContext doEdit(RyjbxxEntity ryjbxxEntity,
 			List<RyjbxxZSEntity> zsList, List<RyjbxxZSEntity> deleteZsList,
-			Long functionId,Long accId) {
-		return save(ryjbxxEntity, zsList, deleteZsList, functionId,accId);
+			Long functionId, Long accId) {
+		return save(ryjbxxEntity, zsList, deleteZsList, functionId, accId);
 	}
 
 	public BusinessContext save(RyjbxxEntity ryjbxxEntity,
 			List<RyjbxxZSEntity> zsList, List<RyjbxxZSEntity> deleteZsList,
-			Long functionId,Long accId) {
+			Long functionId, Long accId) {
 		BusinessContext bContext = new BusinessContext();
 		if (null == ryjbxxEntity.getId()) {
 			// 新增
@@ -253,7 +253,7 @@ public class RyjbxxController extends BaseController {
 			ryjbxxEntity.setUpdateUser(Utils.getCurrentUser());
 		}
 		RyjbxxEntity ryjbxx = new RyjbxxEntity();
-		ryjbxx = service.save(ryjbxxEntity, zsList, deleteZsList,accId);
+		ryjbxx = service.save(ryjbxxEntity, zsList, deleteZsList, accId);
 		bContext.setResult(ryjbxx);
 		bContext.addMsg("save.success", "common", MsgLevel.INFO);
 		return bContext;
@@ -312,10 +312,37 @@ public class RyjbxxController extends BaseController {
 		}
 		bContext.setResult(ryjbxxEntity);
 		bContext.setAttribute("zss", zsEntities);
+		bContext.setAttribute("acc", getAccById(ryjbxxEntity.getId()));
+		bContext.setAttribute(
+				"qrcode",
+				Utils.getQrcodeImage(100, 100, Constants.ALL_QRCODE
+						+ Constants.QRCODE_RYJBXX + ryjbxxEntity.getId()));
 		return bContext;
 	}
 
 	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public byte[] getAccById(Long id) {
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		addNotEmptyModel(filterList, "entityType.id", Constants.FJSSLX_RYJBXX,
+				Operator.EQ);
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		addNotEmptyModel(filterList, "entityId", id, PredicateModel.Operator.EQ);
+		Specification<AccessoryEntity> accSpec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		List<AccessoryEntity> accList = accessoryService.findAll(accSpec);
+		byte[] acc =null;
+		if (accList != null && accList.size() > 0) {
+			acc = accList.get(0).getContent().getValue();
+		}
+		return acc;
+	}
+
+	/**
 	 * 经营人人员信息查看
 	 * 
 	 * @return
@@ -378,7 +405,7 @@ public class RyjbxxController extends BaseController {
 			outputStream.close();
 		}
 	}
-	
+
 	@RequestMapping(value = "ryjbxx", method = RequestMethod.POST)
 	@ResponseBody
 	@RemotingExclude
@@ -400,167 +427,164 @@ public class RyjbxxController extends BaseController {
 			return "0";
 		}
 	}
-	
+
 	private Map<String, List<?>> getRyjbxx(HSSFWorkbook workbook, Long fid) {
 		Map<String, List<?>> map = new HashMap<String, List<?>>();
 		List<RyjbxxEntity> list = new ArrayList<RyjbxxEntity>();// 记录有效的数据
 		List<HSSFRow> rowlist = new ArrayList<HSSFRow>();// 记录无效的数据
 		List<String> strList = new ArrayList<String>();// 记录错误信息
 		HSSFSheet sheet = workbook.getSheetAt(0);
-		RyjbxxEntity ryjbxxEntity =  new RyjbxxEntity();//人员基本信息
-		List<RyjbxxZSEntity> zsList = new ArrayList<RyjbxxZSEntity>();//证书信息
-		for(int i = 6; i<=sheet.getLastRowNum(); i++) {
+		RyjbxxEntity ryjbxxEntity = new RyjbxxEntity();// 人员基本信息
+		List<RyjbxxZSEntity> zsList = new ArrayList<RyjbxxZSEntity>();// 证书信息
+		for (int i = 6; i <= sheet.getLastRowNum(); i++) {
 			List<CodeEntity> codelist = null;
 			HSSFRow row = sheet.getRow(i);
 			try {
-				//过滤掉序号没填或已删除的数据
-				if(getRowCellString(row, 0) == null || "".equals(getRowCellString(row, 0).trim()))
+				// 过滤掉序号没填或已删除的数据
+				if (getRowCellString(row, 0) == null
+						|| "".equals(getRowCellString(row, 0).trim()))
 					continue;
-				ryjbxxEntity =  new RyjbxxEntity();
+				ryjbxxEntity = new RyjbxxEntity();
 				zsList = new ArrayList<RyjbxxZSEntity>();
 				// 所在地
-			   if(getRowCellString(row, 1)==null)
-				   continue;
+				if (getRowCellString(row, 1) == null)
+					continue;
 				codelist = codeService.findByBz(getRowCellString(row, 1));
 				if (codelist != null && codelist.size() > 0) {
 					ryjbxxEntity.setSzd(codelist.get(0));
 				} else {
 					rowlist.add(row);
-					strList.add("序号"
-							+getRowCellString(row, 0)+ ":不存在的所在地");
+					strList.add("序号" + getRowCellString(row, 0) + ":不存在的所在地");
 					continue;
 				}
 				// 港区
 				List<GqEntity> gqlist = null;
-				//查询所在地下的港区
+				// 查询所在地下的港区
 				if (codelist != null && codelist.size() > 0) {
-					gqlist = gqService.findByNameAndSzd(getRowCellString(row, 2),codelist.get(0).getId() + "%");
+					gqlist = gqService.findByNameAndSzd(
+							getRowCellString(row, 2), codelist.get(0).getId()
+									+ "%");
 				} else {
 					gqlist = gqService.findByName(getRowCellString(row, 2));
-				} 
+				}
 				// 港区不是这个所在地下的也不行
 				if (gqlist != null && gqlist.size() > 0) {
-					//根据港区的所在地来设置所在地
+					// 根据港区的所在地来设置所在地
 					ryjbxxEntity.setSsgq(gqlist.get(0));
 					ryjbxxEntity.setSzd(gqlist.get(0).getSzd());
 				} else {
 					rowlist.add(row);
-					strList.add("序号"
-							+ getRowCellString(row, 0) + ":不存在的港区");
+					strList.add("序号" + getRowCellString(row, 0) + ":不存在的港区");
 					continue;
 				}
-				//姓名
+				// 姓名
 				String xm = getRowCellString(row, 3);
-				if(xm == null || xm.trim().isEmpty()) {
-					rowlist.add(row);	
-					strList.add("序号"
-							+ getRowCellString(row, 0) + ":姓名为空");
+				if (xm == null || xm.trim().isEmpty()) {
+					rowlist.add(row);
+					strList.add("序号" + getRowCellString(row, 0) + ":姓名为空");
 					continue;
 				}
 				ryjbxxEntity.setXm(xm.trim());
-				//证件类型
-				codelist = codeService.findByBz(getRowCellString( row, 4));
+				// 证件类型
+				codelist = codeService.findByBz(getRowCellString(row, 4));
 				if (codelist != null && codelist.size() > 0) {
 					ryjbxxEntity.setZjlx(codelist.get(0));
 				} else {
 					rowlist.add(row);
-					strList.add("序号"
-							+getRowCellString(row, 0)+ ":不存在的证件类型");
+					strList.add("序号" + getRowCellString(row, 0) + ":不存在的证件类型");
 					continue;
 				}
-				//证件号码
+				// 证件号码
 				String zjhm = getRowCellString(row, 5);
-				if(zjhm == null || zjhm.trim().isEmpty()) {
-					rowlist.add(row);	
-					strList.add("序号"
-							+ getRowCellString(row, 0) + ":证件号码为空");
+				if (zjhm == null || zjhm.trim().isEmpty()) {
+					rowlist.add(row);
+					strList.add("序号" + getRowCellString(row, 0) + ":证件号码为空");
 					continue;
 				}
-				if(ryjbxxEntity.getZjlx().getId() == 80102 && !zjhm.matches("^[1-9]{1}\\d{16}[0-9X]{1}$")) {
-					rowlist.add(row);	
-					strList.add("序号"
-							+ getRowCellString(row, 0) + ":身份证号格式不对");
+				if (ryjbxxEntity.getZjlx().getId() == 80102
+						&& !zjhm.matches("^[1-9]{1}\\d{16}[0-9X]{1}$")) {
+					rowlist.add(row);
+					strList.add("序号" + getRowCellString(row, 0) + ":身份证号格式不对");
 					continue;
 				}
 				ryjbxxEntity.setSfzh(zjhm);
 				// 港口经营人
-				List<JyrEntity> jyrlist = jyrService.findByName(getRowCellString(row, 6));
+				List<JyrEntity> jyrlist = jyrService
+						.findByName(getRowCellString(row, 6));
 				if (jyrlist != null && jyrlist.size() > 0) {
 					ryjbxxEntity.setSsjyr(jyrlist.get(0));
 				} else {
 					rowlist.add(row);
-					strList.add("序号"
-							+ getRowCellString(row, 0)
-							+ ":不存在的经营人");
+					strList.add("序号" + getRowCellString(row, 0) + ":不存在的经营人");
 					continue;
 				}
-				//人员类型
-				codelist = codeService.findByBz(getRowCellString( row, 7));
+				// 人员类型
+				codelist = codeService.findByBz(getRowCellString(row, 7));
 				if (codelist != null && codelist.size() > 0) {
 					ryjbxxEntity.setRylx(codelist.get(0));
 				} else {
 					rowlist.add(row);
-					strList.add("序号"
-							+getRowCellString(row, 0)+ ":不存在的人员类型");
+					strList.add("序号" + getRowCellString(row, 0) + ":不存在的人员类型");
 					continue;
-				}			
-				//职务
+				}
+				// 职务
 				ryjbxxEntity.setZwhzc(getRowCellString(row, 8));
-				//联系电话
+				// 联系电话
 				ryjbxxEntity.setLxdh(getRowCellString(row, 9));
-				//备注
+				// 备注
 				ryjbxxEntity.setBz(getRowCellString(row, 10));
-				//根据身份证号查询是否已经存在该人的数据
-				List<RyjbxxEntity> ryjbxxEntities =  service.findRyBySfzh(ryjbxxEntity.getSfzh());
-				if(ryjbxxEntities != null && ryjbxxEntities.size()>0) {
-					RyjbxxEntity ryjbxxEntity2 = ryjbxxEntities.get(0); 
+				// 根据身份证号查询是否已经存在该人的数据
+				List<RyjbxxEntity> ryjbxxEntities = service
+						.findRyBySfzh(ryjbxxEntity.getSfzh());
+				if (ryjbxxEntities != null && ryjbxxEntities.size() > 0) {
+					RyjbxxEntity ryjbxxEntity2 = ryjbxxEntities.get(0);
 					ryjbxxEntity.setId(ryjbxxEntity2.getId());
 					ryjbxxEntity.setRecordCode(ryjbxxEntity2.getRecordCode());
 					ryjbxxEntity.setAddDate(ryjbxxEntity2.getAddDate());
 					ryjbxxEntity.setAddUser(ryjbxxEntity2.getAddUser());
 					ryjbxxEntity.setUpdateDate(new Date());
 					ryjbxxEntity.setUpdateUser(Utils.getCurrentUser());
-				}else {
+				} else {
 					ryjbxxEntity.setAddDate(new Date());
 					ryjbxxEntity.setAddUser(Utils.getCurrentUser());
 					ryjbxxEntity.setRecordCode(getCurrentRoleCode(fid));
 				}
 				do {
 					RyjbxxZSEntity ryjbxxZSEntity = new RyjbxxZSEntity();
-					//证书名称
+					// 证书名称
 					String zsmc = getRowCellString(row, 11);
-					if(zsmc == null || zsmc.trim().isEmpty()) {
-						rowlist.add(row);	
-						strList.add("序号"
-								+ getRowCellString(row, 0) + ":证书名称为空");
+					if (zsmc == null || zsmc.trim().isEmpty()) {
+						rowlist.add(row);
+						strList.add("序号" + getRowCellString(row, 0) + ":证书名称为空");
 						continue;
 					}
 					ryjbxxZSEntity.setZsmc(zsmc);
-					//证书种类
+					// 证书种类
 					ryjbxxZSEntity.setZszl(getRowCellString(row, 12));
-					//证书编号
+					// 证书编号
 					String zsbh = getRowCellString(row, 13);
-					if(zsbh == null || zsbh.trim().isEmpty()) {
+					if (zsbh == null || zsbh.trim().isEmpty()) {
 						rowlist.add(row);
-						strList.add("序号"
-								+ getRowCellString(row, 0) + ":证书编号为空");
+						strList.add("序号" + getRowCellString(row, 0) + ":证书编号为空");
 						continue;
 					}
 					ryjbxxZSEntity.setZsbh(zsbh);
-					//有效期
+					// 有效期
 					String yxq = getRowCellString(row, 14);
-					if(yxq !=null && yxq.matches("\\d{4}-\\d{2}-\\d{2}"))
+					if (yxq != null && yxq.matches("\\d{4}-\\d{2}-\\d{2}"))
 						ryjbxxZSEntity.setYxq(sdf.parse(yxq));
 					ryjbxxZSEntity.setSzd(ryjbxxEntity.getSzd());
 					ryjbxxZSEntity.setAddDate(new Date());
 					ryjbxxZSEntity.setAddUser(Utils.getCurrentUser());
 					zsList.add(ryjbxxZSEntity);
-				} while(++i<=sheet.getLastRowNum() && (getRowCellString(row = sheet.getRow(i), 1) == null 
-						|| getRowCellString(row, 1).trim().isEmpty()));
+				} while (++i <= sheet.getLastRowNum()
+						&& (getRowCellString(row = sheet.getRow(i), 1) == null || getRowCellString(
+								row, 1).trim().isEmpty()));
 				i--;
-				ryjbxxEntity = service.save(ryjbxxEntity, zsList, new ArrayList<RyjbxxZSEntity>());
-				list.add(ryjbxxEntity);				
-			}catch (Exception e) {
+				ryjbxxEntity = service.save(ryjbxxEntity, zsList,
+						new ArrayList<RyjbxxZSEntity>());
+				list.add(ryjbxxEntity);
+			} catch (Exception e) {
 				e.printStackTrace();
 				rowlist.add(row);
 				continue;
@@ -571,21 +595,21 @@ public class RyjbxxController extends BaseController {
 		map.put("info", strList);
 		return map;
 	}
-	
-	public String  getRowCellString(HSSFRow row , int i ) {
-		if(row.getCell(i)!=null) {
+
+	public String getRowCellString(HSSFRow row, int i) {
+		if (row.getCell(i) != null) {
 			row.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
-	        return row.getCell(i).getRichStringCellValue().getString();
+			return row.getCell(i).getRichStringCellValue().getString();
 		}
 		return null;
 	}
-	
+
 	public HSSFWorkbook paraseExcel(byte[] bytes) throws IOException {
 		ByteArrayInputStream is = new ByteArrayInputStream(bytes);
 		HSSFWorkbook workbook = new HSSFWorkbook(is);
 		return workbook;
 	}
-	
+
 	private Long exportInfo(List<String> strlist) throws Exception, IOException {
 		StringBuffer sbf = new StringBuffer();
 		for (String str : strlist) {
@@ -603,7 +627,7 @@ public class RyjbxxController extends BaseController {
 		blob.setValue(sbf.toString().getBytes());
 		accessoryEntity.setContent(blob);
 		accessoryEntity.setName("errorInfo.txt");
-	    accessoryEntity.setSuffix("txt");	
+		accessoryEntity.setSuffix("txt");
 		return accessoryService.save(accessoryEntity).getId();
 	}
 }

+ 3 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/check/DcEntity.java

@@ -177,6 +177,9 @@ public class DcEntity extends BaseEntity<Long> implements Cloneable {
 	 * 延期整改原因
 	 */
 	private String  yqzgyy;
+	
+	/** 任务列表 */
+	private List<TaskInfoEntity> taskList = null;
 
 	public Long getZxjcid() {
 		return zxjcid;
@@ -494,9 +497,6 @@ public class DcEntity extends BaseEntity<Long> implements Cloneable {
 		this.original = original;
 	}
 
-	/** 任务列表 */
-	private List<TaskInfoEntity> taskList = null;
-
 	@OneToMany(mappedBy = "busId", fetch = FetchType.LAZY, targetEntity = TaskInfoEntity.class)
 	@Where(clause = "record_status <> " + BaseEntity.RECORD_STATE_DELETE
 			+ " and bus_key = '" + PROCESS_DEFINITION_KEY + "'")

+ 6 - 6
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/jyr/JyrEntity.java

@@ -70,9 +70,9 @@ public class JyrEntity extends BaseEntity<Long> implements Cloneable {
 	/** 工商营业执照编号 */
 	private String gsyyzzbh = null;
 	/** 投资总额 */
-	private Integer tzze;
+	private Double tzze;
 	/** 注册资本 */
-	private Integer zczb;
+	private Double zczb;
 	/** 港口危险货物作业附证编号 */
 	private String gkwxhwzyfzbh = null;
 	/** 港口设施保安符合证书编号 */
@@ -309,19 +309,19 @@ public class JyrEntity extends BaseEntity<Long> implements Cloneable {
 		this.gsyyzzbh = gsyyzzbh;
 	}
 
-	public Integer getTzze() {
+	public Double getTzze() {
 		return tzze;
 	}
 
-	public void setTzze(Integer tzze) {
+	public void setTzze(Double tzze) {
 		this.tzze = tzze;
 	}
 
-	public Integer getZczb() {
+	public Double getZczb() {
 		return zczb;
 	}
 
-	public void setZczb(Integer zczb) {
+	public void setZczb(Double zczb) {
 		this.zczb = zczb;
 	}
 

+ 0 - 2
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjgl/zdwxyfb/CgEntity.java

@@ -725,7 +725,6 @@ public class CgEntity extends BaseEntity<Long> implements Cloneable {
 	}
 	
 	@Transient
-	@XmlTransient
 	public CgztEntity getCgzt() {
 		return cgzt;
 	}
@@ -735,7 +734,6 @@ public class CgEntity extends BaseEntity<Long> implements Cloneable {
 	}
 
 	@Transient
-	@XmlTransient
 	public CgsyEntity getCgsy() {
 		return cgsy;
 	}

+ 0 - 9
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/check/DcServiceImpl.java

@@ -157,15 +157,6 @@ public class DcServiceImpl extends BaseWorkFlowServiceImpl<DcEntity, Long>
 		}
 	}
 
-	@Override
-	public DcEntity findOne(Long id) {
-		DcEntity dc = dcDao.findOne(id);
-		if (dc.getTaskList() != null && dc.getTaskList().size() > 0) {
-			dc.getTaskList().get(0);
-		}
-		return dc;
-	}
-
 	/**
 	 * 发送工作提醒
 	 * 

+ 225 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/common/accessory/FjWebService.java

@@ -0,0 +1,225 @@
+package com.jtgh.yjpt.webService.common.accessory;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.stereotype.Service;
+
+import com.jtgh.yjpt.client.common.accessory.AccessoryWebService;
+import com.jtgh.yjpt.common.Constants;
+import com.jtgh.yjpt.common.GlobalData;
+import com.jtgh.yjpt.common.Utils;
+import com.jtgh.yjpt.controller.common.AccessoryController;
+import com.jtgh.yjpt.dao.common.BlobDao;
+import com.jtgh.yjpt.entity.common.AccessoryEntity;
+import com.jtgh.yjpt.entity.common.BlobEntity;
+import com.jtgh.yjpt.entity.common.CodeEntity;
+import com.jtgh.yjpt.service.common.AccessoryService;
+
+/**
+ * 附件保存接口
+ * 
+ * @author chenkf
+ * 
+ */
+@Service
+@WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "fjService")
+@HandlerChain(file = "handle-chain.xml")
+public class FjWebService {
+	@Autowired
+	private AccessoryService accessoryService;
+	@Autowired
+	private BlobDao blobDao;	
+	@Autowired
+	private AccessoryController accessoryController;
+	@Autowired
+	private ThreadPoolTaskExecutor threadPool;
+	/***
+	 * 保存附件
+	 */
+	public AccessoryEntity save(AccessoryEntity entity) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
+		}
+		return accessoryService.save(entity);
+	}
+	
+	/***
+	 * 保存附件并且同步
+	 */
+	public AccessoryEntity saveAndTb(AccessoryEntity entity) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
+		}
+		entity=accessoryService.save(entity);
+		final Long tempid = entity.getId();
+		Thread thread = new Thread(new Runnable() {
+			@Override
+			public void run() {
+				// 数据同步
+				if (Constants.YES.equals(GlobalData.JAXWS_SYNC)) {
+					AccessoryEntity tbEntity= accessoryService.findOne(tempid);
+					if (!"0l".equals(tbEntity.getEntityId())) {
+						try {
+							AccessoryWebService webService = accessoryService
+									.getAccessoryWebService();
+							if (webService != null) {
+								webService.save(tbEntity);
+								tbEntity.setTbzt(Constants.YES);
+								accessoryService.save(tbEntity);
+							}
+						} catch (Exception e) {
+							e.printStackTrace();
+							tbEntity.setTbzt(Constants.NO);
+							accessoryService.save(tbEntity);
+						}
+					}
+				}
+			}
+		});
+		threadPool.execute(thread);	
+		return entity;
+	}
+	
+	/**
+	 * 删除附件
+	 * @param entities
+	 * @return
+	 */
+	public void delete(List<AccessoryEntity> entities){
+		try{
+			accessoryService.logicDelete(entities);
+		}catch(Exception e){
+			e.printStackTrace();
+		}
+	}
+	/**
+	 * 删除附件
+	 * @param entity
+	 */
+	public void delete(AccessoryEntity entity){
+		delete(Collections.singletonList(entity));
+	}
+	/**
+	 * 根据id删除
+	 * @param id
+	 */
+	public void deleteById(Long id) {
+			accessoryService.delete(id);	
+	}
+
+	/**
+	 * 删除
+	 * @param list
+	 */
+	public void deleteEntities(List<AccessoryEntity> list) {
+		for (AccessoryEntity accessoryEntity : list) {
+			deleteById(accessoryEntity.getId());
+		}
+	}
+	/****
+	 * 删除选中的附件,并且需要同步删除省级的附件
+	 */
+	public void deleteAndTb( List<AccessoryEntity> entities) {
+		accessoryController.deleteFjAndTbDelete(entities);
+	}
+
+	/**
+	 * 删除附件
+	 * @param entityId
+	 * @param sslx
+	 * @param lx
+	 */
+	public void delete(long entityId, long sslx, long lx) {
+		// 根据实体的id删除附件,实体的类型,实体的所属区域,实体的
+		accessoryService.deleteFj(entityId, sslx, lx);
+	}
+	
+	/**
+	 * 删除附件并同步
+	 * @param entityId
+	 * @param sslx
+	 * @param lx
+	 */
+	public void deleteFjAndTb(long entityId, long sslx, long lx){
+		accessoryController.deleteFj(entityId, sslx, lx);
+	}
+	
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public AccessoryEntity findOne(Long id) {
+		return accessoryService.findOne(id);
+	}
+
+	/**
+	 * 获取附件
+	 * @param entityId 所属对象id
+	 * @param sslx  所属对象类型
+	 * @param lx 附件类型
+	 * @return
+	 */
+	public List<AccessoryEntity> findByEntityIdAndEntityTypeAndType(
+			long entityId, long sslx, long lx) {
+		List<AccessoryEntity> list = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entityId, sslx, lx);
+		return list;
+	}
+
+	/**
+	 * 保存附件数据
+	 * @param wjm 文件名称
+	 * @param wjhzm 文件后缀名
+	 * @param bytes 文件内容
+	 * @param size 大小
+	 * @param ssid 所属对象id
+	 * @param sslx 所属对象类型
+	 * @param lx 文件类型
+	 * @return
+	 */
+	public AccessoryEntity saveData(String wjm, String wjhzm, byte[] bytes, int size,
+			Long ssid, Long sslx, Long lx) {
+		try {
+			BlobEntity blobEntity = new BlobEntity();
+			blobEntity.setValue(bytes);
+			blobEntity = blobDao.save(blobEntity);
+			AccessoryEntity accessoryEntity = new AccessoryEntity();
+			accessoryEntity.setName(wjm);
+			accessoryEntity.setSuffix(wjhzm);
+			accessoryEntity.setContent(blobEntity);
+			accessoryEntity.setLength(size);
+			accessoryEntity.setEntityId(ssid);
+			CodeEntity sslxEntity = new CodeEntity();
+			sslxEntity.setId(sslx);
+			if (lx == null) {
+
+			} else {
+				CodeEntity lxEntity = new CodeEntity();
+				lxEntity.setId(lx);
+				accessoryEntity.setType(lxEntity);
+			}
+			accessoryEntity.setEntityType(sslxEntity);
+			accessoryEntity = accessoryService.save(accessoryEntity);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+}

+ 20 - 9
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjgl/cg/CgxxglWebService.java

@@ -65,6 +65,7 @@ public class CgxxglWebService extends BaseController {
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
 		entity = cgService.save(entity);
+		//同步
 		cgService.savetb(entity, null, null);
 		return entity;
 	}
@@ -110,7 +111,7 @@ public class CgxxglWebService extends BaseController {
 	 * @return
 	 */
 	public List<CgEntity> findCgByParams(final Long szd,
-			final Long szgq,  final String gkjyr,final String cgmc){
+			final Long szgq,  final Long gkjyr,final String cgmc){
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		addNotEmptyModel(filterList, "szd.id", szd,
 					Operator.LIKE_R);
@@ -127,7 +128,7 @@ public class CgxxglWebService extends BaseController {
 				addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),
 						Operator.EQ);
 			} else {
-				// 行政人员根据权限过滤(危货列表菜单ID=26)
+				// 行政人员根据权限过滤(储罐列表菜单ID=26)
 				addRecordCodeFilter(19l, filterList);
 			}
 		}
@@ -148,12 +149,12 @@ public class CgxxglWebService extends BaseController {
 	 * @return
 	 */
 	public List<CgEntity> getCgPageListByParams(final Long szd,
-			final Long szgq,  final String gkjyr,final String cgmc,int n, int pageCount){
-		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+			final Long szgq,  final Long gkjyr,final String cgmc,int n, int pageCount){
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();	
 		addNotEmptyModel(filterList, "szd.id", szd,
-					Operator.LIKE_R);
-		addNotEmptyModel(filterList, "gq", szgq, Operator.EQ);
-		addNotEmptyModel(filterList, "dwmc", gkjyr, Operator.EQ);
+				Operator.LIKE_R);
+	addNotEmptyModel(filterList, "gq", szgq, Operator.EQ);
+	addNotEmptyModel(filterList, "dwmc", gkjyr, Operator.EQ);
 		addNotEmptyModel(filterList, "cgmc", cgmc, Operator.LIKE);
 		addNotEmptyModel(filterList, "recordStatus",
 				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
@@ -165,7 +166,7 @@ public class CgxxglWebService extends BaseController {
 				addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),
 						Operator.EQ);
 			} else {
-				// 行政人员根据权限过滤(危货列表菜单ID=26)
+				// 行政人员根据权限过滤(储罐列表菜单ID=26)		
 				addRecordCodeFilter(19l, filterList);
 			}
 		}
@@ -177,6 +178,11 @@ public class CgxxglWebService extends BaseController {
 		if(list==null||list.getTotalPages()<pageCount){
 			return  new ArrayList<CgEntity>();
 		}
+		for (CgEntity vo : list) {
+			// 检索储罐状态
+			vo.setCgzt(cgztService.findByCg(vo));
+			vo.setCgsy(cgsyService.findByCg(vo));
+		}
 		return list.getContent();
 	}
 	
@@ -338,7 +344,12 @@ public class CgxxglWebService extends BaseController {
 	 * @return
 	 */
 	public CgEntity findCgById(Long id){
-		return cgService.findOne(id);
+		CgEntity entity = cgService.findOne(id);
+		if(entity!=null){
+			entity.setCgsy(findCgsyByCg(entity));
+			entity.setCgzt(findCgztByCg(entity));
+		}		
+		return entity;
 	}	
 	
 }

+ 332 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/dc/JdjcWebService.java

@@ -0,0 +1,332 @@
+package com.jtgh.yjpt.webService.zcdc.dc;
+
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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 org.springframework.util.StringUtils;
+
+import com.jtgh.yjpt.common.Constants;
+import com.jtgh.yjpt.common.PredicateModel;
+import com.jtgh.yjpt.common.PredicateModel.Operator;
+import com.jtgh.yjpt.common.SinglePageRequest;
+import com.jtgh.yjpt.common.SpecificationCreater;
+import com.jtgh.yjpt.common.Utils;
+import com.jtgh.yjpt.common.WorkFlowParam;
+import com.jtgh.yjpt.controller.BaseController;
+import com.jtgh.yjpt.controller.check.DcController;
+import com.jtgh.yjpt.entity.BaseEntity;
+import com.jtgh.yjpt.entity.auth.UserEntity;
+import com.jtgh.yjpt.entity.check.DcEntity;
+import com.jtgh.yjpt.entity.common.AccessoryEntity;
+import com.jtgh.yjpt.service.check.DcService;
+import com.jtgh.yjpt.service.common.AccessoryService;
+import com.jtgh.yjpt.webService.WsResult;
+/**
+ * 督察WebService
+ * 
+ * @author chenkf
+ * 
+ */
+@Service
+@WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "jdjcService")
+@HandlerChain(file="handle-chain.xml")
+public class JdjcWebService extends BaseController {
+
+	@Autowired
+	private DcController dcController;
+	@Autowired
+	private DcService dcService;
+	@Autowired
+	private AccessoryService accessoryService;
+	
+	/**
+	 * 保存
+	 * @param entity
+	 * @return
+	 */
+	public DcEntity save(DcEntity entity) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			//行政人员
+			entity.setRecordCode("100100100100");
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
+		}
+		entity = dcService.save(entity);
+		return entity;
+	}
+
+	/**
+	 * 删除
+	 * @param entity
+	 * @return
+	 */
+	public WsResult delete(DcEntity entity) {
+		WsResult ws = new WsResult();
+		try {
+			dcService.logicDelete(entity.getId());
+			ws.setResultCode(WsResult.SUCCESS);
+		} catch (Exception e) {
+			e.printStackTrace();
+			ws.setResultCode(WsResult.FAILURE);
+		}
+		return ws;
+	}
+	
+	/**
+	 * 提交
+	 * @param entity
+	 * @param accessoryList附件
+	 * @return
+	 */
+	public DcEntity submitWithFj(DcEntity entity,List<AccessoryEntity> accessoryList){
+		boolean init = false;
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			//行政人员
+			entity.setRecordCode("100100100100");
+			init=true;
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
+		}
+		DcEntity dcEntity = dcService.save(entity);
+		if (null != accessoryList) {
+			for (AccessoryEntity acc : accessoryList) {
+				acc = accessoryService.findOne(acc.getId());
+				acc.setEntityId(dcEntity.getId());
+				accessoryService.save(acc);
+			}
+		}
+		AccessoryEntity acc = null;
+		if (init) {
+			if (null != entity.getZgjg()) {
+				acc = accessoryService.findOne(entity.getZgjg().getId());
+				if (null != acc) {
+					acc.setEntityId(entity.getId());
+					accessoryService.save(acc);
+				}
+			}
+		}
+		// ===============数据保存完后开始逻辑======
+		dcService.submit(dcEntity);// 市级提交发起流程
+		return dcEntity;
+	}
+	
+	/**
+	 * 提交
+	 * @param entity
+	 * @return
+	 */
+	public DcEntity submit(DcEntity entity){
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			//行政人员
+			entity.setRecordCode("100100100100");
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
+		}
+		DcEntity dcEntity = dcService.save(entity);
+		// ===============数据保存完后开始逻辑======
+		dcService.submit(dcEntity);// 市级提交发起流程
+		return dcEntity;
+	}
+	
+	/**
+	 * 经营人修改完了提交
+	 * @param entity
+	 * @param accessoryList
+	 * @return
+	 */
+	public DcEntity jyrSubmit(DcEntity entity,
+			List<AccessoryEntity> accessoryList) {
+		if (dcService.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser()
+				.getId().toString(), entity.getId().toString()) != null) {
+			dcService.claim(entity.getId().toString(), Utils.getCurrentUser()
+					.getId().toString());
+		}
+		if (null == entity.getId()) {
+			entity.setAddUser(Utils.getCurrentUser());
+			entity.setAddDate(new Date());
+			entity.setRecordCode("100100100100");
+		} else {
+			entity.setUpdateUser(Utils.getCurrentUser());
+			entity.setUpdateDate(new Date());
+		}
+		entity.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
+		DcEntity dcEntity = dcService.save(entity);
+		if (null != accessoryList) {
+			for (AccessoryEntity acc : accessoryList) {
+				acc = accessoryService.findOne(acc.getId());
+				acc.setEntityId(dcEntity.getId());
+				accessoryService.save(acc);
+			}
+		}
+		// ===============数据保存完后开始逻辑======
+		Map<String, Object> variables = new HashMap<String, Object>();
+		WorkFlowParam param = new WorkFlowParam();
+		param.put(WorkFlowParam.AUDIT_DATE, new Date());
+		param.put(WorkFlowParam.BUSINESS_KEY, dcEntity.getId());
+		// 判断是否进行延期整改
+		variables.put(WorkFlowParam.AUDIT_PASS, "2".equals(dcEntity.getMqzt()));
+		dcService.complete(param, variables);
+		return dcEntity;
+	}
+	
+	/**
+	 * 判断当前用户是否有审批权限 之判断
+	 * @param id
+	 * @return 0 表示未签收,代办理,1表示已签收待办理 ,""表示 无流程
+	 */
+	public String getTaskStateByid(Long id) {
+		DcEntity entity = dcService.findOne(id);
+		if (dcService.getTaskByUserAndBusKey(Utils.getWebServiceUser().getId()
+				.toString(), entity.getId().toString()) != null) {
+			return Constants.TASK_ASSIGN;
+		} else if (dcService.getCandidateTaskByUserAndBusKey(Utils
+				.getWebServiceUser().getId().toString(), entity.getId()
+				.toString()) != null) {
+			return Constants.TASK_CANDIDATE;
+		}
+		return "";
+	}
+	
+	/**
+	 * 审批
+	 * @param entity
+	 * @param accessoryList
+	 * @param shyj
+	 * @param shsj
+	 * @param flag
+	 * @param toWho
+	 * @return
+	 */
+	public DcEntity audit( DcEntity entity, String shyj, Date shsj,
+			boolean flag, String toWho){
+		entity = dcService.findOne(entity.getId());
+		List<AccessoryEntity> accessoryList = new ArrayList<AccessoryEntity>();
+		List<AccessoryEntity> acc1 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGCSFJ), 0l);
+		if(acc1!=null && acc1.size()>0){
+			accessoryList.addAll(acc1);
+		}
+		List<AccessoryEntity> acc2 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGYQFJ), 0l);
+		if(acc2!=null && acc2.size()>0){
+			accessoryList.addAll(acc2);
+		}
+		List<AccessoryEntity> acc3 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_ZPFJ), 0l);
+		if(acc2!=null && acc2.size()>0){
+			accessoryList.addAll(acc3);
+		}
+		List<AccessoryEntity> acc4 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
+		if(acc2!=null && acc2.size()>0){
+			accessoryList.addAll(acc4);
+		}
+		List<AccessoryEntity> acc5 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGJGFJ), 0l);
+		if(acc2!=null && acc2.size()>0){
+			accessoryList.addAll(acc5);
+		}
+		List<AccessoryEntity> acc6 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
+		if(acc2!=null && acc2.size()>0){
+			accessoryList.addAll(acc6);
+		}
+		dcController.audit(0l, entity, accessoryList, shyj, new Date(), flag, toWho);
+		entity = dcService.findOne(entity.getId());
+		return entity;
+	}
+	
+	/**
+	 * 分页查询
+	 * @param szd 所在地
+	 * @param szgq 所在港区
+	 * @param bdcdw 被督查单位
+	 * @param dcdw 督查单位
+	 * @param bdcdwfzr 被督查单位负责人
+	 * @param wxhwpm 整改状态
+	 * @param sbsj1 申报时间
+	 * @param sbsj2
+	 * @param n  条数
+	 * @param pageCount 页
+	 * @return
+	 */
+	public List<DcEntity> getDcPageListByParam(Long szd, Long szgq,
+			String bdcdw,String dcdw, String bdcdwfzr, String mqzt, String sbsj1,
+			String sbsj2,int n, int pageCount) {
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();	
+		// 只检索非删除状态记录
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		// 根据所在地过滤
+		addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE);
+		// 根据港区过滤
+		addNotEmptyModel(filterList, "szgq.id", szgq, Operator.EQ);
+		// 根据被督查单位 过滤
+		addNotEmptyModel(filterList, "bdcdw.gkjyr", bdcdw, Operator.LIKE);
+		//督查单位
+		addNotEmptyModel(filterList, "dcdw", dcdw, Operator.LIKE);
+		//整改状态
+		addNotEmptyModel(filterList, "mqzt", mqzt, Operator.EQ);
+		//过滤历史记	
+		addNotEmptyModel(filterList, "original", "original", Operator.NL);
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");
+		// 报告时间
+		try {
+			if (!StringUtils.isEmpty(sbsj1))
+				addNotEmptyModel(filterList, "sj",
+						Utils.getDateFirstTime(sdf.parse(sbsj1)), Operator.GTE);
+			if (!StringUtils.isEmpty(sbsj2))
+				addNotEmptyModel(filterList, "sj",
+						Utils.getDateLastTime(sdf.parse(sbsj2)), Operator.LTE);
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		if (Utils.getWebServiceUser() != null) {
+			UserEntity user = Utils.getWebServiceUser();
+			// 经营人只能查自己的
+			if (Constants.YES.equals(user.getSfjyr())
+					&& user.getJyrjcxx() != null) {
+				addNotEmptyModel(filterList, "bdcdw", user.getJyrjcxx(),
+						Operator.EQ);
+			} else {
+				// 行政人员根据权限过滤(督查列表菜单ID=42)
+				addRecordCodeFilter(42l, filterList);
+			}
+		}
+		Specification<DcEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
+				"sj");
+		Page<DcEntity> list = dcService.findAll(spec, page);
+		if(list==null||list.getTotalPages()<pageCount){
+			return  new ArrayList<DcEntity>();
+		}
+		return list.getContent();
+	}
+
+	/**
+	 * 获取单条信息
+	 * @param id
+	 * @return
+	 */
+	public DcEntity getById(Long id) {
+		return dcService.findOne(id);
+	}
+	
+}

+ 6 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

@@ -131,6 +131,9 @@ public class WhsqbpWebService extends BaseController {
 			SinglePageRequest page = new SinglePageRequest(pageCount, count,
 					"desc", "bgsj");
 			Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
+			if(list==null||list.getTotalPages()<pageCount){
+				return  new ArrayList<ZysqbpEntity>();
+			}
 			return list.getContent();
 			// List<ZysqbpEntity> list = zysqbpService.getZysqbpListByJyr(count,
 			// user.getJyrjcxx().getId());
@@ -192,11 +195,11 @@ public class WhsqbpWebService extends BaseController {
 			String bgsj2, String kgsj1, String kgsj2, String wgsj1,
 			String wgsj2, int n, int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
-		// 根据 申请单位 过滤
-		addNotEmptyModel(filterList, "zydw.gkjyr", gkjyr, Operator.LIKE);
 		// 只检索非删除状态记录
 		addNotEmptyModel(filterList, "recordStatus",
-				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+						BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		// 根据 申请单位 过滤
+		addNotEmptyModel(filterList, "zydw.gkjyr", gkjyr, Operator.LIKE);
 		// 根据所在地过滤
 		addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE);
 		// 根据港区过滤