Browse Source

人员公告

git-svn-id: https://192.168.57.71/svn/lyggkj@86 1a6f6e3a-4066-fe46-b609-79c204482ece
ld_liufl 9 years ago
parent
commit
0b1317ec7f

+ 2 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/jyrxxgl/RyjbxxController.java

@@ -356,7 +356,8 @@ public class RyjbxxController extends BaseController {
 		addNotEmptyModel(filterList, "entityId", id, PredicateModel.Operator.EQ);
 		Specification<AccessoryEntity> accSpec = SpecificationCreater
 				.searchByPredicateModels(filterList);
-		List<AccessoryEntity> accList = accessoryService.findAll(accSpec);
+		Sort s = new Sort(Direction.DESC, "id");
+		List<AccessoryEntity> accList = accessoryService.findAll(accSpec,s);
 		byte[] acc = null;
 		if (accList != null && accList.size() > 0) {
 			acc = accList.get(0).getContent().getValue();

+ 0 - 2
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/jyrxxgl/RyjbxxEntity.java

@@ -9,7 +9,6 @@ import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 import javax.persistence.Transient;
-import javax.xml.bind.annotation.XmlTransient;
 
 import org.springframework.flex.remoting.RemotingExclude;
 
@@ -314,7 +313,6 @@ public class RyjbxxEntity extends BaseEntity<Long> {
 	}
 
 	@Transient
-	@XmlTransient
 	public AccessoryEntity getZp() {
 		return zp;
 	}

+ 6 - 4
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/jyrxxgl/RyjbxxServiceImpl.java

@@ -151,10 +151,12 @@ public class RyjbxxServiceImpl extends BaseService<RyjbxxEntity, Long>
 				saveFileList.add(file);
 			}
 		}
-		AccessoryEntity file2 = accessoryDao.findOne(accId);
-		if(file2!=null){
-			file2.setEntityId(ryjbxx.getId());
-			saveFileList.add(file2);
+		if(accId!=null && !accId.equals(0l)){
+			AccessoryEntity file2 = accessoryDao.findOne(accId);
+			if(file2!=null){
+				file2.setEntityId(ryjbxx.getId());
+				saveFileList.add(file2);
+			}	
 		}	
 		saveFileList = accessoryDao.save(saveFileList);
 		// 同步到省级

+ 16 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/gg/GgWebService.java

@@ -151,11 +151,11 @@ public class GgWebService extends BaseController {
 		}
 		for (GgEntity gg : pageList) {
 			List<PredicateModel> filterList2 = new ArrayList<PredicateModel>();
-			addNotEmptyModel(filterList, "entityType.id",
+			addNotEmptyModel(filterList2, "entityType.id",
 					Constants.FJSSLX_T_YJPT_GG, Operator.EQ);
-			addNotEmptyModel(filterList, "recordStatus",
+			addNotEmptyModel(filterList2, "recordStatus",
 					BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
-			addNotEmptyModel(filterList, "entityId", gg.getId(),
+			addNotEmptyModel(filterList2, "entityId", gg.getId(),
 					PredicateModel.Operator.EQ);
 			Specification<AccessoryEntity> accSpec = SpecificationCreater
 					.searchByPredicateModels(filterList2);
@@ -174,6 +174,19 @@ public class GgWebService extends BaseController {
      */
     public GgEntity findById(Long id){
     	GgEntity entity = service.findById(id);
+    	List<PredicateModel> filterList= new ArrayList<PredicateModel>();
+		addNotEmptyModel(filterList, "entityType.id",
+				Constants.FJSSLX_T_YJPT_GG, 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;
     }
     

+ 18 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/jyr/JyrxxglWebService.java

@@ -9,6 +9,8 @@ import javax.jws.WebService;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 
@@ -21,6 +23,7 @@ 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.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.jyr.BwEntity;
 import com.jtgh.yjpt.entity.jyr.JyrEntity;
 import com.jtgh.yjpt.entity.jyrxxgl.JyrckxxEntity;
@@ -223,6 +226,21 @@ public class JyrxxglWebService extends BaseController {
 				if (zsEntities.size() > 0) {
 					ryjbxxEntity.setFirstZs(zsEntities.get(0));
 				}
+				List<PredicateModel> filterList2 = new ArrayList<PredicateModel>();
+				addNotEmptyModel(filterList2, "entityType.id", Constants.FJSSLX_RYJBXX,
+						Operator.EQ);
+				addNotEmptyModel(filterList2, "recordStatus",
+						BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+				addNotEmptyModel(filterList2, "entityId",ryjbxxEntity.getId(), PredicateModel.Operator.EQ);
+				Specification<AccessoryEntity> accSpec = SpecificationCreater
+						.searchByPredicateModels(filterList2);
+				Sort s = new Sort(Direction.DESC, "id");
+				List<AccessoryEntity> accList = accessoryService.findAll(accSpec,s);
+				if (accList != null && accList.size() > 0) {
+					AccessoryEntity acc = new AccessoryEntity();
+					acc.setId(accList.get(0).getId());
+					ryjbxxEntity.setZp(acc);
+				}
 			}
 			return pageList.getContent();
 		} catch (Exception e) {