Browse Source

git-svn-id: https://192.168.57.71/svn/jsgkj@650 931142cf-59ea-a443-aa0e-51397b428577

ld_liufl 8 years ago
parent
commit
6bb781a521

+ 74 - 16
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/zysqbp/ZysqbpController.java

@@ -32,6 +32,7 @@ import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
 import org.activiti.engine.ActivitiException;
 import org.activiti.engine.ActivitiException;
 import org.activiti.engine.task.Task;
 import org.activiti.engine.task.Task;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
@@ -133,6 +134,8 @@ import flex.messaging.io.amf.ASObject;
 @SuppressWarnings("unchecked")
 @SuppressWarnings("unchecked")
 @Log(menuCode = "004001", menuCodeJyr = "004001_c")
 @Log(menuCode = "004001", menuCodeJyr = "004001_c")
 public class ZysqbpController extends BaseController {
 public class ZysqbpController extends BaseController {
+	private final static Logger LOGGER = Logger
+			.getLogger(ZysqbpController.class);
 	@Autowired
 	@Autowired
 	private ThreadPoolTaskExecutor threadPool;
 	private ThreadPoolTaskExecutor threadPool;
 	@Autowired
 	@Autowired
@@ -236,6 +239,11 @@ public class ZysqbpController extends BaseController {
 			final Date bgsj2, final Date kgsj1, final Date kgsj2,
 			final Date bgsj2, final Date kgsj1, final Date kgsj2,
 			final Date wgsj1, final Date wgsj2, final String name,
 			final Date wgsj1, final Date wgsj2, final String name,
 			final String gkdw) {
 			final String gkdw) {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
+
 		BusinessContext bc = new BusinessContext();
 		BusinessContext bc = new BusinessContext();
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		try {
 		try {
@@ -319,6 +327,10 @@ public class ZysqbpController extends BaseController {
 				}
 				}
 			};
 			};
 			Page<ZysqbpEntity> pageList = zysqbpService.findAll(spec, pageable);
 			Page<ZysqbpEntity> pageList = zysqbpService.findAll(spec, pageable);
+			long cost = System.currentTimeMillis() - startTime;
+			// System.err.println(url + ",cost:"+cost);
+			LOGGER.info(url + "<SUCCESS> (findAll()) cost:" + cost);
+			//
 			List<Boolean> sfsbList = new ArrayList<Boolean>();
 			List<Boolean> sfsbList = new ArrayList<Boolean>();
 			for (ZysqbpEntity ba : pageList) {
 			for (ZysqbpEntity ba : pageList) {
 				sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw()
 				sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw()
@@ -378,10 +390,17 @@ public class ZysqbpController extends BaseController {
 			}
 			}
 			bc = createBusinessContext(pageList);
 			bc = createBusinessContext(pageList);
 			bc.setAttribute("sfsbList", sfsbList);
 			bc.setAttribute("sfsbList", sfsbList);
+			cost = System.currentTimeMillis() - startTime;
+			// System.err.println(url + ",cost:"+cost);
+			LOGGER.info(url + "<SUCCESS> cost:" + cost);
 			return bc;
 			return bc;
 		} catch (Exception e) {
 		} catch (Exception e) {
+			LOGGER.error("error occured,url:" + url);
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
+		long cost = System.currentTimeMillis() - startTime;
+		System.err.println(url + ",cost:" + cost);
+		LOGGER.info(url + "<ERROR> cost:" + cost);
 		return null;
 		return null;
 
 
 	}
 	}
@@ -569,6 +588,7 @@ public class ZysqbpController extends BaseController {
 			bc.setAttribute("ths", zysqbpService.count(spec2));
 			bc.setAttribute("ths", zysqbpService.count(spec2));
 			return bc;
 			return bc;
 		} catch (Exception e) {
 		} catch (Exception e) {
+
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
 
 
@@ -1010,6 +1030,10 @@ public class ZysqbpController extends BaseController {
 			ZysqbpEntity entity, String lcStatus, final Date bgsj1,
 			ZysqbpEntity entity, String lcStatus, final Date bgsj1,
 			final Date bgsj2, final Date kgsj1, final Date kgsj2,
 			final Date bgsj2, final Date kgsj1, final Date kgsj2,
 			final Date wgsj1, final Date wgsj2) {
 			final Date wgsj1, final Date wgsj2) {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		try {
 		try {
 			BusinessContext bc = new BusinessContext();
 			BusinessContext bc = new BusinessContext();
 			// zysqbpService.wxhwSqValid();
 			// zysqbpService.wxhwSqValid();
@@ -1040,6 +1064,9 @@ public class ZysqbpController extends BaseController {
 			Specification<ZysqbpEntity> spec = SpecificationCreater
 			Specification<ZysqbpEntity> spec = SpecificationCreater
 					.searchByPredicateModels(filterList);
 					.searchByPredicateModels(filterList);
 			Page<ZysqbpEntity> pageList = zysqbpService.findAll(spec, pageable);
 			Page<ZysqbpEntity> pageList = zysqbpService.findAll(spec, pageable);
+			long cost = System.currentTimeMillis() - startTime;
+			// System.err.println(url + ",cost:"+cost);
+			LOGGER.info(url + " <SUCCESS> (findAll()) cost:" + cost);
 			List<Boolean> sfsbList = new ArrayList<Boolean>();
 			List<Boolean> sfsbList = new ArrayList<Boolean>();
 			for (ZysqbpEntity ba : pageList) {
 			for (ZysqbpEntity ba : pageList) {
 				sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw()
 				sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw()
@@ -1047,10 +1074,16 @@ public class ZysqbpController extends BaseController {
 			}
 			}
 			bc = createBusinessContext(pageList);
 			bc = createBusinessContext(pageList);
 			bc.setAttribute("sfsbList", sfsbList);
 			bc.setAttribute("sfsbList", sfsbList);
+			cost = System.currentTimeMillis() - startTime;
+			LOGGER.info(url + "<SUCCESS>cost:" + cost);
 			return bc;
 			return bc;
 		} catch (Exception e) {
 		} catch (Exception e) {
+			LOGGER.error("error occured,url:" + url);
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
+		long cost = System.currentTimeMillis() - startTime;
+		System.err.println(url + ",cost:" + cost);
+		LOGGER.info(url + " <ERROR> cost:" + cost);
 		return null;
 		return null;
 	}
 	}
 
 
@@ -1142,33 +1175,23 @@ public class ZysqbpController extends BaseController {
 	}
 	}
 
 
 	public BusinessContext save(ZysqbpEntity vo, Long functionId, Long accId) {
 	public BusinessContext save(ZysqbpEntity vo, Long functionId, Long accId) {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		try {
 		try {
 			BusinessContext bc = createBusinessContext();
 			BusinessContext bc = createBusinessContext();
 			if (null == vo.getId() || vo.getId().equals(0l)) {
 			if (null == vo.getId() || vo.getId().equals(0l)) {
 				vo.setAddDate(new Date());
 				vo.setAddDate(new Date());
 				vo.setAddUser(Utils.getCurrentUser());
 				vo.setAddUser(Utils.getCurrentUser());
 				vo.setRecordCode(getCurrentRoleCode(functionId));
 				vo.setRecordCode(getCurrentRoleCode(functionId));
-				// SimpleDateFormat sdf = new SimpleDateFormat(
-				// "yyyy-MM-dd");
-				// StringBuffer bf=new StringBuffer();
-				// CodeEntity codeEntiy;
-				// if(Constants.DEPLOY_MODE_CITY.equals(GlobalData.DEPLOY_MODE)){
-				// codeEntiy=codeService.findOne(Long.parseLong(GlobalData.CITY_CODE));
-				// bf.append(codeEntiy.getByzd1());
-				// }
-				// String str = sdf.format(vo.getAddDate());
-				// bf.append(str);
-				// int count=zysqbpService.countTodaEntities();
-				// for (int i = 0; i < 4-(count+1+"").length(); i++) {
-				// bf.append("0");
-				// }
-				// bf.append(count+1+"");
-
 			} else {
 			} else {
 				vo.setUpdateDate(new Date());
 				vo.setUpdateDate(new Date());
 				vo.setUpdateUser(Utils.getCurrentUser());
 				vo.setUpdateUser(Utils.getCurrentUser());
 			}
 			}
 			vo = zysqbpService.saveEntity(vo);
 			vo = zysqbpService.saveEntity(vo);
+			long cost = System.currentTimeMillis() - startTime;
+			LOGGER.info(url + "<SUCCESS> (save ) cost:" + cost);
 			bc.setResult(vo);
 			bc.setResult(vo);
 			AccessoryEntity acc = accessoryService.findOne(accId);
 			AccessoryEntity acc = accessoryService.findOne(accId);
 			if (acc != null) {
 			if (acc != null) {
@@ -1176,14 +1199,24 @@ public class ZysqbpController extends BaseController {
 				accessoryService.save(acc);
 				accessoryService.save(acc);
 			}
 			}
 			bc.addMsg("save.success", "common", MsgLevel.INFO);
 			bc.addMsg("save.success", "common", MsgLevel.INFO);
+			cost = System.currentTimeMillis() - startTime;
+			LOGGER.info(url + "<SUCCESS> cost:" + cost);
 			return bc;
 			return bc;
 		} catch (Exception e) {
 		} catch (Exception e) {
+			LOGGER.error("error occured,url:" + url);
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
+		long cost = System.currentTimeMillis() - startTime;
+		System.err.println(url + ",cost:" + cost);
+		LOGGER.info(url + "<ERROR> cost:" + cost);
 		return null;
 		return null;
 	}
 	}
 
 
 	public BusinessContext save(ZysqbpEntity vo) {
 	public BusinessContext save(ZysqbpEntity vo) {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		BusinessContext bc = createBusinessContext();
 		BusinessContext bc = createBusinessContext();
 		vo = zysqbpService.saveKgwg(vo);
 		vo = zysqbpService.saveKgwg(vo);
 		// 同步到省级
 		// 同步到省级
@@ -1216,6 +1249,9 @@ public class ZysqbpController extends BaseController {
 		}
 		}
 		bc.setResult(vo);
 		bc.setResult(vo);
 		bc.addMsg("save.success", "common", MsgLevel.INFO);
 		bc.addMsg("save.success", "common", MsgLevel.INFO);
+		long cost = System.currentTimeMillis() - startTime;
+		// System.err.println(url + ",cost:"+cost);
+		LOGGER.info(url + "<SUCCESS> cost:" + cost);
 		return bc;
 		return bc;
 	}
 	}
 
 
@@ -1412,6 +1448,10 @@ public class ZysqbpController extends BaseController {
 	}
 	}
 
 
 	public BusinessContext submit(ZysqbpEntity vo, Long functionId, Long accId) {
 	public BusinessContext submit(ZysqbpEntity vo, Long functionId, Long accId) {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		BusinessContext bc = createBusinessContext();
 		BusinessContext bc = createBusinessContext();
 		int nsns = 0;
 		int nsns = 0;
 		Date fzDate = vo.getZyddqybh().getFzsq().getYxqkssj();
 		Date fzDate = vo.getZyddqybh().getFzsq().getYxqkssj();
@@ -1491,6 +1531,8 @@ public class ZysqbpController extends BaseController {
 		// vo = compareService.doCompare(vo.getId().toString());
 		// vo = compareService.doCompare(vo.getId().toString());
 		// }
 		// }
 		bc.setResult(vo);
 		bc.setResult(vo);
+		long cost = System.currentTimeMillis() - startTime;
+		LOGGER.info(url + "<SUCCESS>  (submit)  cost:" + cost);
 		AccessoryEntity acc = accessoryService.findOne(accId);
 		AccessoryEntity acc = accessoryService.findOne(accId);
 		if (acc != null) {
 		if (acc != null) {
 			acc.setEntityId(vo.getId());
 			acc.setEntityId(vo.getId());
@@ -1528,6 +1570,7 @@ public class ZysqbpController extends BaseController {
 						zysqbpService.save(vo);
 						zysqbpService.save(vo);
 					}
 					}
 				} catch (Exception e) {
 				} catch (Exception e) {
+					LOGGER.error("error occured,url:" + url +" (ZysqbpWebService.save) ");
 					e.printStackTrace();
 					e.printStackTrace();
 					vo.setTbzt(Constants.NO);
 					vo.setTbzt(Constants.NO);
 					zysqbpService.save(vo);
 					zysqbpService.save(vo);
@@ -1541,6 +1584,7 @@ public class ZysqbpController extends BaseController {
 							acc.setTbzt(Constants.YES);
 							acc.setTbzt(Constants.YES);
 							accessoryService.save(acc);
 							accessoryService.save(acc);
 						} catch (Exception e) {
 						} catch (Exception e) {
+							LOGGER.error("error occured,url:" + url +" (AccessoryWebService.save) ");
 							e.printStackTrace();
 							e.printStackTrace();
 							acc.setTbzt(Constants.NO);
 							acc.setTbzt(Constants.NO);
 							accessoryService.save(acc);
 							accessoryService.save(acc);
@@ -1599,6 +1643,8 @@ public class ZysqbpController extends BaseController {
 
 
 		}
 		}
 		bc.addMsg("save.success", "common", MsgLevel.INFO);
 		bc.addMsg("save.success", "common", MsgLevel.INFO);
+		cost = System.currentTimeMillis() - startTime - cost;
+		LOGGER.info(url + "<ERROR> ( tb )cost:" + cost);
 		return bc;
 		return bc;
 	}
 	}
 
 
@@ -1740,6 +1786,10 @@ public class ZysqbpController extends BaseController {
 	 */
 	 */
 	public void aduit(String shyj, Date shsj, boolean auditflag,
 	public void aduit(String shyj, Date shsj, boolean auditflag,
 			ZysqbpEntity entity) throws CloneNotSupportedException {
 			ZysqbpEntity entity) throws CloneNotSupportedException {
+		long startTime = System.currentTimeMillis();
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		if (zysqbpService
 		if (zysqbpService
 				.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId()
 				.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId()
 						.toString(), entity.getId().toString()) != null) {
 						.toString(), entity.getId().toString()) != null) {
@@ -1768,6 +1818,11 @@ public class ZysqbpController extends BaseController {
 				.getId().toString(), entity.getId().toString().toString(),
 				.getId().toString(), entity.getId().toString().toString(),
 				ZysqbpEntity.PROCESS_DEFINITION_KEY);
 				ZysqbpEntity.PROCESS_DEFINITION_KEY);
 		zysqbpService.audit(param, variables, task);
 		zysqbpService.audit(param, variables, task);
+
+		// 审批
+		long cost = System.currentTimeMillis() - startTime;
+		LOGGER.info(url + "<SUCCESS> (audit ) cost:" + cost);
+
 		// 查询任务表中否还存在状态值为3 的数据,不存在则修改实体的recordStatus
 		// 查询任务表中否还存在状态值为3 的数据,不存在则修改实体的recordStatus
 		List<TaskInfoEntity> list = taskService
 		List<TaskInfoEntity> list = taskService
 				.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(),
 				.findByBusIdAndBusKeyAndRecordStatus(entity.getId().toString(),
@@ -1857,6 +1912,9 @@ public class ZysqbpController extends BaseController {
 				threadPool.execute(thread);
 				threadPool.execute(thread);
 			}
 			}
 		}
 		}
+		// 审批
+		cost = System.currentTimeMillis() - startTime - cost;
+		LOGGER.info(url + "<SUCCESS>  (tb ) cost:" + cost);
 		// if (auditflag == false) {
 		// if (auditflag == false) {
 		// ZysqbpEntity entity1 = zysqbpService.findOne(entity.getId());
 		// ZysqbpEntity entity1 = zysqbpService.findOne(entity.getId());
 		// entity1.setRecordStatus(ZysqbpEntity.RECORD_STATE_REJECT);
 		// entity1.setRecordStatus(ZysqbpEntity.RECORD_STATE_REJECT);

+ 44 - 15
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/zysqbp/ZysqbpServiceImpl.java

@@ -20,6 +20,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 import org.activiti.engine.task.Task;
 import org.activiti.engine.task.Task;
+import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
@@ -63,7 +64,8 @@ import com.yjpt.util.DateUtil;
 @Service
 @Service
 public class ZysqbpServiceImpl extends
 public class ZysqbpServiceImpl extends
 		BaseWorkFlowServiceImpl<ZysqbpEntity, Long> implements ZysqbpService {
 		BaseWorkFlowServiceImpl<ZysqbpEntity, Long> implements ZysqbpService {
-
+	private final static Logger LOGGER = Logger
+			.getLogger(ZysqbpServiceImpl.class);
 	@Autowired
 	@Autowired
 	private ZysqbpDao zysqbpDao;
 	private ZysqbpDao zysqbpDao;
 	@Autowired
 	@Autowired
@@ -212,8 +214,10 @@ public class ZysqbpServiceImpl extends
 
 
 	@Override
 	@Override
 	public <S extends ZysqbpEntity> S submit(String currentRoleCode, S data) {
 	public <S extends ZysqbpEntity> S submit(String currentRoleCode, S data) {
+		String url = Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		String zyddString;
 		String zyddString;
-
 		if (data.getZyddqybh() != null)
 		if (data.getZyddqybh() != null)
 			zyddString = data.getZyddqybh().getQynbmc() != null ? data
 			zyddString = data.getZyddqybh().getQynbmc() != null ? data
 					.getZyddqybh().getQynbmc() : "";
 					.getZyddqybh().getQynbmc() : "";
@@ -244,9 +248,14 @@ public class ZysqbpServiceImpl extends
 			// }
 			// }
 			workService.complete(param, variables, task);
 			workService.complete(param, variables, task);
 		} else {
 		} else {
-			data.setBh(generateNoByNoRule(GlobalData.CITY_CODE));
-			data.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
-			data = this.save(data);
+			try{
+				data.setBh(generateNoByNoRule(GlobalData.CITY_CODE));
+				data.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
+				data = this.save(data);
+			}catch (Exception e){
+				LOGGER.equals(url + "<EORROR> 获取编号 generateNoByNoRule  ");
+				e.printStackTrace();
+			}
 			if (Constants.YES.equals(GlobalData.QLYG_SYNC)) {
 			if (Constants.YES.equals(GlobalData.QLYG_SYNC)) {
 				// 同步生成办件信息
 				// 同步生成办件信息
 				this.saveApply(data);
 				this.saveApply(data);
@@ -2222,18 +2231,38 @@ public class ZysqbpServiceImpl extends
 
 
 	@Override
 	@Override
 	public ZysqbpEntity saveKgwg(ZysqbpEntity entity) {
 	public ZysqbpEntity saveKgwg(ZysqbpEntity entity) {
+		long startTime = System.currentTimeMillis();
+		String url =  Thread.currentThread().getStackTrace()[2].getClassName()
+				+ "."
+				+ Thread.currentThread().getStackTrace()[2].getMethodName();
 		entity = this.save(entity);
 		entity = this.save(entity);
 		// 同步到省级
 		// 同步到省级
-//		if (Constants.YES.equals(GlobalData.JAXWS_SYNC)) {
-//			ZysqbpWebService webServce = getWebService();
-//			if (webServce != null) {
-//				try {
-//					webServce.save(entity);
-//				} catch (Exception e) {
-//					e.printStackTrace();
-//				}
-//			}
-//		}
+		if (Constants.YES.equals(GlobalData.JAXWS_SYNC)) {
+			ZysqbpWebService webServce = getWebService();
+			if (webServce != null) {
+				try {
+					webServce.save(entity);
+				} catch (Exception e) {
+					LOGGER.error("error occured,url:" + url + " (ZysqbpWebService.save) ");
+					e.printStackTrace();
+				}
+				long cost =  System.currentTimeMillis() - startTime;
+				System.err.println(url + ",cost:"+cost);
+				LOGGER.info(url + "<ERROR> cost:"+cost);
+			}
+		}
+		if (Constants.YES.equals(GlobalData.JAXWS_SYNC)) {
+			ZysqbpWebService webServce = getWebService();
+			if (webServce != null) {
+				try {
+					webServce.save(entity);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+		long cost =  System.currentTimeMillis() - startTime;
+		LOGGER.info(url + "<SUCCESS> cost:"+cost);
 		return entity;
 		return entity;
 	}
 	}