Pārlūkot izejas kodu

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

ld_liufl 9 gadi atpakaļ
vecāks
revīzija
ee28180a99

+ 5 - 4
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/Check/ZijianzichaLayout.mxml

@@ -232,10 +232,11 @@
 				<ui:DataGridColumn width="100" dataField="wzgyy" showDataTips="true" dataTipField="wzgyy"
 								   headerText="{resourceManager.getString('check','zc.wzgyy')}"/>
 				-->
-				<ui:DataGridColumn width="70" dataField="txr" showDataTips="true" dataTipField="txr"
-								   headerText="填写人"/>
-				<ui:DataGridColumn width="100" dataField="txsj" dateFormatString="{TypeBase.DT_FMT_1}"
-								   headerText="{resourceManager.getString('check','zc.txsj')}"/>
+				<ui:DataGridColumn width="70" dataField="txr" dataTipField="txr" headerText="填写人"
+								   showDataTips="true"/>
+				<ui:DataGridColumn width="100" dataField="jcsj"
+										   dateFormatString="{TypeBase.DT_FMT_1}"
+										   headerText="{resourceManager.getString('check','jdjcgl.jcrq')}"/>
 				<!--ui:DataGridColumn width="100" dataField="mqztName" 
 								   headerText="{resourceManager.getString('check','mqzt')}"/-->
 				<ui:DataGridColumn width="100" dataField="szdName"

+ 1 - 1
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/jyrxxgl/ryqk/RyjbxxView.mxml

@@ -117,7 +117,7 @@
 									<s:Image id="tx" width="75" height="100" fillMode="scale"
 											 scaleMode="stretch"
 											 source="@Embed('resource/images/portrait.png')"/>
-									<s:Image id="qrcode"  width="100" height="100"/>
+									<s:Image id="qrcode"  width="100" height="100" fillMode="scale"/>
 								</s:HGroup>
 							</s:VGroup>				
 						</s:HGroup>

+ 1 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zysqbp/ZysqbpEdit.mxml

@@ -177,6 +177,7 @@
 				zysqbp.zysjq=zysjq.dateTime;
 				zysqbp.zysjz=zysjz.dateTime;
 				zysqbp.inorout = jcg.textValue as String;
+				zysqbp.lhxz = lhxz.text;
 				zysqbp.aqffcs = tsyqhsm.text;
 				zysqbp.cm=cm.text;
 				zysqbp.zywtr=zywtr.text;

+ 2 - 1
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zysqbp/ZysqbpLayout.mxml

@@ -89,7 +89,8 @@
 			
 			public function reloadGq(e:Event):void
 			{
-				query_gq.reload(query_gk.selectedVO);			
+				query_gq.reload(query_gk.selectedVO);		
+				query_gkdw2.reload(query_gk.selectedVO as CodeVo);
 			}
 			private function labelFun(item:Object, column:GridColumn):String
 			{

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/check/DcController.java

@@ -847,6 +847,8 @@ public class DcController extends BaseController {
 						for (AccessoryEntity accessoryEntity : accessoryList) {
 							try {
 								accessoryWebService.save(accessoryEntity);
+								accessoryEntity.setTbzt(Constants.YES);
+								accessoryService.save(accessoryEntity);
 							} catch (Exception e) {
 								e.printStackTrace();
 								accessoryEntity.setTbzt(Constants.NO);

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

@@ -776,7 +776,7 @@ public class RyjbxxController extends BaseController {
 				//联系电话
 				g.drawString(data.getLxdh()==null?"":data.getLxdh(), 75, 265);						
 				//二维码
-				InputStream buffin2 = new ByteArrayInputStream(Utils.getQrcodeImage(100, 100, Constants.ALL_QRCODE
+				InputStream buffin2 = new ByteArrayInputStream(Utils.getQrcodeImage(75, 75, Constants.ALL_QRCODE
 						+ Constants.QRCODE_RYJBXX+id));
 				Image qrImg=ImageIO.read(buffin2);
 				g.drawImage(qrImg.getScaledInstance(75, 75,

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

@@ -4286,7 +4286,7 @@ public class ZysqbpController extends BaseController {
 			entity2.setrNum(wxhwpmEntity.getId());
 			memService.save(entity2);
 		} else {
-			memService.updateMem(wxhwpmEntity.getLhxz(), new Date(), memList2
+			memService.updateMem(wxhwpmEntity.getAqffcs(), new Date(), memList2
 					.get(0).getId());
 		}
 		return createBusinessContext();

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

@@ -48,6 +48,15 @@ public class FjWebService {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
 		} else {
+			AccessoryEntity vo = accessoryService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
@@ -62,6 +71,16 @@ public class FjWebService {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
 		} else {
+			AccessoryEntity vo = accessoryService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
+			
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}

+ 1 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/jyr/JyrWebService.java

@@ -187,7 +187,7 @@ public class JyrWebService extends BaseController{
 				addNotEmptyModel(filterList, "szgq.id", szgq, Operator.EQ);
 			}
 			if(gkjyr != null && !gkjyr.equals("")){
-				addNotEmptyModel(filterList, "gkjyr",gkjyr, Operator.EQ);
+				addNotEmptyModel(filterList, "gkjyr",gkjyr, Operator.LIKE);
 						}
 			if(sfwhqy != null && !sfwhqy.equals("")){
 				addNotEmptyModel(filterList, "sfwhqy", sfwhqy, Operator.EQ);

+ 83 - 60
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjgl/cg/CgxxglWebService.java

@@ -14,9 +14,9 @@ import org.springframework.stereotype.Service;
 
 import com.jtgh.yjpt.client.yjgl.cg.CgWebService;
 import com.jtgh.yjpt.common.Constants;
+import com.jtgh.yjpt.common.GlobalData;
 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;
@@ -32,6 +32,7 @@ import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgsyService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
 import com.jtgh.yjpt.webService.WsResult;
+
 /**
  * 储罐接口WebService
  * 
@@ -40,7 +41,7 @@ import com.jtgh.yjpt.webService.WsResult;
  */
 @Service
 @WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "cgxxglService")
-@HandlerChain(file="handle-chain.xml")
+@HandlerChain(file = "handle-chain.xml")
 public class CgxxglWebService extends BaseController {
 
 	@Autowired
@@ -54,6 +55,7 @@ public class CgxxglWebService extends BaseController {
 
 	/**
 	 * 储罐保存
+	 * 
 	 * @param entity
 	 * @return
 	 */
@@ -63,17 +65,28 @@ public class CgxxglWebService extends BaseController {
 			entity.setAddUser(Utils.getWebServiceUser());
 			entity.setRecordCode("90");
 		} else {
+			CgEntity vo = cgService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
+		entity.setTbzt(Constants.NO);
 		entity = cgService.save(entity);
-		//同步
+		// 同步
 		cgService.savetb(entity, null, null);
 		return entity;
 	}
-	
+
 	/**
 	 * 删除
+	 * 
 	 * @param entity
 	 * @return
 	 */
@@ -84,7 +97,8 @@ public class CgxxglWebService extends BaseController {
 			zbhjjbqkService.logicDelete(zbhjjbqkService.findBySscg(entity));
 			ws.setResultCode(WsResult.SUCCESS);
 			if (Constants.YES.equals(GlobalData.JAXWS_SYNC)
-					&& GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
+					&& GlobalData.DEPLOY_MODE
+							.equals(Constants.DEPLOY_MODE_CITY)) {
 				CgWebService webService = cgService.getWebService();
 				if (null != webService) {
 					webService.delete(entity);
@@ -100,34 +114,35 @@ public class CgxxglWebService extends BaseController {
 		}
 		return ws;
 	}
-	
+
 	/**
 	 * 根据企业和名称查询
+	 * 
 	 * @param jyr
 	 * @param name
 	 * @return
 	 */
-	public CgEntity findByJyrAndName(JyrEntity jyr ,String name){
-		List<CgEntity> list = cgService.findByJyrAndName(jyr,name);
-		if(list!=null&&list.size()>0){
+	public CgEntity findByJyrAndName(JyrEntity jyr, String name) {
+		List<CgEntity> list = cgService.findByJyrAndName(jyr, name);
+		if (list != null && list.size() > 0) {
 			return list.get(0);
 		}
 		return null;
 	}
-	
+
 	/**
 	 * 查询储罐信息
+	 * 
 	 * @param szd
 	 * @param szgq
 	 * @param gkjyr
 	 * @param cgmc
 	 * @return
 	 */
-	public List<CgEntity> findCgByParams(final Long szd,
-			final Long szgq,  final Long gkjyr,final String cgmc){
+	public List<CgEntity> findCgByParams(final Long szd, final Long szgq,
+			final Long gkjyr, final String cgmc) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
-		addNotEmptyModel(filterList, "szd.id", szd,
-					Operator.LIKE_R);
+		addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
 		addNotEmptyModel(filterList, "gq", szgq, Operator.EQ);
 		addNotEmptyModel(filterList, "dwmc", gkjyr, Operator.EQ);
 		addNotEmptyModel(filterList, "cgmc", cgmc, Operator.LIKE);
@@ -147,12 +162,13 @@ public class CgxxglWebService extends BaseController {
 		}
 		Specification<CgEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
-		List<CgEntity> list= cgService.findAll(spec);
+		List<CgEntity> list = cgService.findAll(spec);
 		return list;
 	}
-	
+
 	/**
 	 * 分页查询储罐信息
+	 * 
 	 * @param szd
 	 * @param szgq
 	 * @param gkjyr
@@ -162,12 +178,12 @@ public class CgxxglWebService extends BaseController {
 	 * @return
 	 */
 	public List<CgEntity> getCgPageListByParams(final Long szd,
-			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);
+			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);
 		addNotEmptyModel(filterList, "cgmc", cgmc, Operator.LIKE);
 		addNotEmptyModel(filterList, "recordStatus",
 				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
@@ -179,7 +195,7 @@ public class CgxxglWebService extends BaseController {
 				addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),
 						Operator.EQ);
 			} else {
-				// 行政人员根据权限过滤(储罐列表菜单ID=26)		
+				// 行政人员根据权限过滤(储罐列表菜单ID=19)
 				addRecordCodeFilter(19l, filterList);
 			}
 		}
@@ -187,9 +203,9 @@ public class CgxxglWebService extends BaseController {
 				.searchByPredicateModels(filterList);
 		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
 				"id");
-		Page<CgEntity> list= cgService.findAll(spec,page);
-		if(list==null||list.getTotalPages()<pageCount){
-			return  new ArrayList<CgEntity>();
+		Page<CgEntity> list = cgService.findAll(spec, page);
+		if (list == null || list.getTotalPages() < pageCount) {
+			return new ArrayList<CgEntity>();
 		}
 		for (CgEntity vo : list) {
 			// 检索储罐状态
@@ -198,15 +214,14 @@ public class CgxxglWebService extends BaseController {
 		}
 		return list.getContent();
 	}
-	
-	
+
 	/**
 	 * 保存储罐状态
+	 * 
 	 * @param entity
 	 * @return
 	 */
-	public CgztEntity saveCgzt(CgztEntity entity)
-	{
+	public CgztEntity saveCgzt(CgztEntity entity) {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
@@ -216,9 +231,9 @@ public class CgxxglWebService extends BaseController {
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
 		entity.setZt("1");
-		if(entity.getCg()!=null){
+		if (entity.getCg() != null) {
 			CgsyEntity cgsy = cgsyService.findByCg(entity.getCg());
-			if(cgsy!=null){
+			if (cgsy != null) {
 				if (null != cgsy.getZdwd()
 						&& !"".equals(cgsy.getZdwd().trim())
 						&& null != entity.getWd()
@@ -247,7 +262,7 @@ public class CgxxglWebService extends BaseController {
 						&& !"".equals(cgsy.getZxyl().trim())
 						&& null != entity.getYl()
 						&& !"".equals(cgsy.getZxyl().trim())
-						&& Double.parseDouble(entity.getYl()) <Double
+						&& Double.parseDouble(entity.getYl()) < Double
 								.parseDouble(cgsy.getZxyl())) {
 					entity.setZt("2");
 				}
@@ -272,52 +287,57 @@ public class CgxxglWebService extends BaseController {
 		entity = cgztService.save(entity);
 		return entity;
 	}
-	
-	
+
 	/**
-	 * 获取储罐 
+	 * 获取储罐
+	 * 
 	 * @param entity
 	 * @param hz
 	 * @param tbsj1
 	 * @param tbsj2
 	 * @return
 	 */
-	public List<CgztEntity> findCgztByParams(CgEntity entity,String hz,Date tbsj1,Date tbsj2){
+	public List<CgztEntity> findCgztByParams(CgEntity entity, String hz,
+			Date tbsj1, Date tbsj2) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
-		//所属储罐
+		// 所属储罐
 		addNotEmptyModel(filterList, "cg", entity.getId(), Operator.EQ);
-		//货种
+		// 货种
 		addNotEmptyModel(filterList, "hz", hz, Operator.LIKE);
-		//填报时间
-		if(tbsj1!=null){
-			addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1), Operator.GTE);
+		// 填报时间
+		if (tbsj1 != null) {
+			addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1),
+					Operator.GTE);
 		}
-		if(tbsj2!=null){
-			addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2), Operator.LTE);
+		if (tbsj2 != null) {
+			addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2),
+					Operator.LTE);
 		}
 		addNotEmptyModel(filterList, "recordStatus",
 				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
 		Specification<CgztEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
-		List<CgztEntity> list= cgztService.findAll(spec);
-		return  list;
+		List<CgztEntity> list = cgztService.findAll(spec);
+		return list;
 	}
-	
+
 	/**
 	 * 获取最新状态
+	 * 
 	 * @param cg
 	 * @return
 	 */
-	public CgztEntity findCgztByCg(CgEntity cg){
+	public CgztEntity findCgztByCg(CgEntity cg) {
 		return cgztService.findByCg(cg);
 	}
-	
+
 	/**
 	 * 保存储罐适用范围
+	 * 
 	 * @param entity
 	 * @return
 	 */
-	public  CgsyEntity saveCgsy(CgsyEntity entity){
+	public CgsyEntity saveCgsy(CgsyEntity entity) {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
@@ -329,40 +349,43 @@ public class CgxxglWebService extends BaseController {
 		entity = cgsyService.save(entity);
 		return entity;
 	}
-	
+
 	/**
 	 * 获取储罐的适用范围
+	 * 
 	 * @param cg
 	 * @return
 	 */
-	public CgsyEntity findCgsyByCg(CgEntity cg){
-		return  cgsyService.findByCg(cg);
+	public CgsyEntity findCgsyByCg(CgEntity cg) {
+		return cgsyService.findByCg(cg);
 	}
 
 	/**
 	 * 储罐保存
+	 * 
 	 * @param entity
 	 * @return
 	 */
-	public CgEntity saveCg(CgEntity entity,CgsyEntity cgsy) {
+	public CgEntity saveCg(CgEntity entity, CgsyEntity cgsy) {
 		entity = save(entity);
 		cgsy.setCg(entity);
 		saveCgsy(cgsy);
 		return entity;
 	}
-	
+
 	/**
 	 * 获取储罐详细信息
+	 * 
 	 * @param id
 	 * @return
 	 */
-	public CgEntity findCgById(Long id){
+	public CgEntity findCgById(Long id) {
 		CgEntity entity = cgService.findOne(id);
-		if(entity!=null){
+		if (entity != null) {
 			entity.setCgsy(findCgsyByCg(entity));
 			entity.setCgzt(findCgztByCg(entity));
-		}		
+		}
 		return entity;
-	}	
-	
+	}
+
 }

+ 1 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjzyxxgl/YjzyxxglWebService.java

@@ -248,7 +248,7 @@ public class YjzyxxglWebService extends BaseController {
 			// 经营人只能查自己的
 			if (Constants.YES.equals(user.getSfjyr())
 					&& user.getJyrjcxx() != null) {
-				addNotEmptyModel(filterList, "ssjyr", user.getJyrjcxx(),
+				addNotEmptyModel(filterList, "qymc", user.getJyrjcxx(),
 						Operator.EQ);
 			} else {
 				// 行政人员根据权限过滤(应急队伍列表菜单ID=12)

+ 28 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/dc/JdjcWebService.java

@@ -64,6 +64,15 @@ public class JdjcWebService extends BaseController {
 			//行政人员
 			entity.setRecordCode("100100100100");
 		} else {
+			DcEntity vo = dcService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
@@ -103,6 +112,15 @@ public class JdjcWebService extends BaseController {
 			entity.setRecordCode("100100100100");
 			init=true;
 		} else {
+			DcEntity vo = dcService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
@@ -141,6 +159,15 @@ public class JdjcWebService extends BaseController {
 			//行政人员
 			entity.setRecordCode("100100100100");
 		} else {
+			DcEntity vo = dcService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
@@ -338,5 +365,5 @@ public class JdjcWebService extends BaseController {
 	public DcEntity getById(Long id) {
 		return dcService.findOne(id);
 	}
-	
+
 }

+ 237 - 66
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/zc/ZczbWebService.java

@@ -11,8 +11,10 @@ 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.common.accessory.AccessoryWebService;
 import com.jtgh.yjpt.client.zcdc.zc.ZcWebService;
 import com.jtgh.yjpt.client.zcdc.zcyh.ZcyhWebService;
 import com.jtgh.yjpt.common.Constants;
@@ -25,11 +27,14 @@ import com.jtgh.yjpt.common.Utils;
 import com.jtgh.yjpt.controller.BaseController;
 import com.jtgh.yjpt.controller.check.ZcController;
 import com.jtgh.yjpt.controller.common.AccessoryController;
+import com.jtgh.yjpt.dao.common.BlobDao;
 import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.auth.UserEntity;
 import com.jtgh.yjpt.entity.check.ZcEntity;
 import com.jtgh.yjpt.entity.check.ZcyhEntity;
 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.check.ZcService;
 import com.jtgh.yjpt.service.check.ZcyhService;
 import com.jtgh.yjpt.service.common.AccessoryService;
@@ -55,7 +60,10 @@ public class ZczbWebService extends BaseController {
 	private ZcController zcController;
 	@Autowired
 	private AccessoryController accessoryController;
-
+	@Autowired
+	private BlobDao blobDao;
+	@Autowired
+	private ThreadPoolTaskExecutor threadPool;
 	/**
 	 * 保存
 	 * 
@@ -69,11 +77,68 @@ public class ZczbWebService extends BaseController {
 			// 行政人员
 			entity.setRecordCode("90");
 		} else {
+			ZcEntity vo = zcService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());			
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
-		}
+		}	
 		entity.setTbzt(Constants.NO);
 		entity = zcService.save(entity);
+		final Long tempid=entity.getId();
+		Thread thread = new Thread(new Runnable() {
+			@Override
+			public void run() {
+				// 同步
+				ZcEntity tbEntity = zcService.findOne(tempid);		
+				if (Constants.YES.equals(GlobalData.JAXWS_SYNC)
+						&& GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
+
+					try {								
+						ZcWebService webService = zcService.getWebService();
+						if (webService != null) {
+							webService.save(tbEntity);
+							tbEntity.setTbzt(Constants.YES);
+							zcService.save(tbEntity);
+						} else {
+							tbEntity.setTbzt(Constants.NO);
+							zcService.save(tbEntity);
+						}
+					} catch (Exception e) {
+						e.printStackTrace();
+						tbEntity.setTbzt(Constants.NO);
+						zcService.save(tbEntity);
+					}
+					List<ZcyhEntity> yhList = zcyhService.findBySszc(tbEntity);
+					ZcyhWebService zcyhWebService = zcyhService.getWebService();
+					if (null != zcyhWebService) {
+						for (ZcyhEntity zcyhEntity : yhList) {
+							try {
+								zcyhWebService.save(zcyhEntity);
+								zcyhEntity.setTbzt(Constants.YES);
+								zcyhService.save(zcyhEntity);
+							} catch (Exception e) {
+								e.printStackTrace();
+								zcyhEntity.setTbzt(Constants.NO);
+								zcyhService.save(zcyhEntity);
+							}
+						}
+					} else {
+						for (ZcyhEntity zcyhEntity : yhList) {
+							zcyhEntity.setTbzt(Constants.NO);
+							zcyhService.save(zcyhEntity);
+						}
+					}
+				}			
+			}			
+		});
+		threadPool.execute(thread);
 		return entity;
 	}
 
@@ -85,98 +150,205 @@ public class ZczbWebService extends BaseController {
 	 * @param delList
 	 * @return
 	 */
+	@SuppressWarnings("unchecked")
 	public ZcEntity saveEntity(ZcEntity entity, List<ZcyhEntity> addList,
-			List<ZcyhEntity> delList) {
-		boolean first = false;
+			final List<ZcyhEntity> delList) {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
 			// 行政人员
 			entity.setRecordCode("90");
-			first = true;
 		} else {
+			ZcEntity vo = zcService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());	
 			entity.setUpdateUser(Utils.getCurrentUser());
 			entity.setUpdateDate(new Date());
 		}
+		entity.setTbzt(Constants.NO);
 		ZcEntity zcEntity = zcService.save(entity);// 先保存实体
 		List<ZcyhEntity> tbAddList = new ArrayList<ZcyhEntity>();// 临时存放
 		for (ZcyhEntity zcyhEntity : addList) {// for循环需要添加的自查隐患子表
 			zcyhEntity.setSszc(zcEntity);// 设置自查隐患属于的主表记录
+			List<byte[]> yhzpList = zcyhEntity.getYhzp();
+			List<byte[]> zghzpList = zcyhEntity.getZghzp();
 			zcyhEntity = zcyhService.save(zcyhEntity);
+			if (yhzpList != null) {
+				for (byte[] yhzp : yhzpList) {
+					AccessoryEntity accEntity1 = new AccessoryEntity();
+					BlobEntity blobEntity1 = new BlobEntity();
+					blobEntity1.setValue(yhzp);
+					blobEntity1.setAddDate(new Date());
+					blobEntity1.setAddUser(Utils.getCurrentUser());
+					blobEntity1 = blobDao.save(blobEntity1);
+					accEntity1.setAddDate(new Date());
+					accEntity1.setAddUser(Utils.getCurrentUser());
+					accEntity1.setName("隐患整改照片");
+					accEntity1.setSuffix("jpg");
+					accEntity1.setContent(blobEntity1);
+					accEntity1.setLength(yhzp.length);
+					accEntity1.setEntityId(zcyhEntity.getId());
+					CodeEntity sslxEntity = new CodeEntity();
+					sslxEntity.setId(Long.parseLong(Constants.FJSSLX_YHZP));
+					accEntity1.setEntityType(sslxEntity);
+					accEntity1.setTbzt(Constants.NO);
+					accessoryService.save(accEntity1);
+				}
+			}
+			if (zghzpList != null) {
+				for (byte[] zghzp : zghzpList) {
+					AccessoryEntity accEntity2 = new AccessoryEntity();
+					BlobEntity blobEntity2 = new BlobEntity();
+					blobEntity2.setValue(zghzp);
+					blobEntity2.setAddDate(new Date());
+					blobEntity2.setAddUser(Utils.getCurrentUser());
+					blobEntity2 = blobDao.save(blobEntity2);
+					accEntity2.setAddDate(new Date());
+					accEntity2.setAddUser(Utils.getCurrentUser());
+					accEntity2.setName("隐患整改后照片");
+					accEntity2.setSuffix("jpg");
+					accEntity2.setContent(blobEntity2);
+					accEntity2.setLength(zghzp.length);
+					accEntity2.setEntityId(zcyhEntity.getId());
+					CodeEntity sslxEntity = new CodeEntity();
+					sslxEntity.setId(Long.parseLong(Constants.FJSSLX_ZGHZP));
+					accEntity2.setEntityType(sslxEntity);
+					accEntity2.setTbzt(Constants.NO);
+					accessoryService.save(accEntity2);
+				}
+			}
 			tbAddList.add(zcyhEntity);
-			if (first == true) {// 如果是第一次新增
-				if (null != zcyhEntity.getZgcs()) {// 但是整改措施不为空
-					for (AccessoryEntity zcyhEntity2 : zcyhEntity.getZgcs()) {
-						AccessoryEntity zgcs = accessoryService
-								.findOne(zcyhEntity2.getId());
-						if (null != zgcs) {
-							zgcs.setEntityId(zcyhEntity.getId());
-							accessoryService.save(zgcs);
-						}
+			if (null != zcyhEntity.getZgcs()) {// 但是整改措施不为空
+				for (AccessoryEntity zcyhEntity2 : zcyhEntity.getZgcs()) {
+					AccessoryEntity zgcs=null;
+					if(zcyhEntity2.getId()!=null|| !zcyhEntity2.getId().equals(0l)){
+						zgcs = accessoryService.findOne(zcyhEntity2
+								.getId());
+					}	
+					if (null != zgcs) {
+						zgcs.setEntityId(zcyhEntity.getId());
+						zgcs.setTbzt(Constants.NO);
+						accessoryService.save(zgcs);
 					}
 				}
-				if (null != zcyhEntity.getZgjg()) {
-					AccessoryEntity zgjg = accessoryService.findOne(zcyhEntity
+			}
+			if (null != zcyhEntity.getZgjg()) {
+				AccessoryEntity zgjg=null;
+				if(zcyhEntity.getZgjg().getId()!=null|| !zcyhEntity.getZgjg().getId().equals(0l)){
+					zgjg = accessoryService.findOne(zcyhEntity
 							.getZgjg().getId());
-					if (null != zgjg) {
-						zgjg.setEntityId(zcyhEntity.getId());
-						accessoryService.save(zgjg);
-					}
+				}			 
+				if (null != zgjg) {
+					zgjg.setEntityId(zcyhEntity.getId());
+					zgjg.setTbzt(Constants.NO);
+					accessoryService.save(zgjg);
 				}
 			}
 		}
 		zcyhService.logicDelete(delList);
-		// 同步
-		if (Constants.YES.equals(GlobalData.JAXWS_SYNC)
-				&& GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
-			try {
-				ZcWebService webService = zcService.getWebService();
-				if (webService != null) {
-					webService.save(zcEntity);
-					zcEntity.setTbzt(Constants.YES);
-					zcService.save(zcEntity);
-				} else {
-					zcEntity.setTbzt(Constants.NO);
-					zcService.save(zcEntity);
-				}
-			} catch (Exception e) {
-				e.printStackTrace();
-				zcEntity.setTbzt(Constants.NO);
-				zcService.save(zcEntity);
-			}
-			List<ZcyhEntity> yhList = zcyhService.findBySszc(zcEntity);
-
-			ZcyhWebService zcyhWebService = zcyhService.getWebService();
-			if (null != zcyhWebService) {
-				for (ZcyhEntity delEntity : delList) {
+		final Long tempid = zcEntity.getId();
+		Thread thread = new Thread(new Runnable() {
+			@Override
+			public void run() {
+				ZcEntity tbEntity = zcService.findOne(tempid);
+				// 同步
+				if (Constants.YES.equals(GlobalData.JAXWS_SYNC)
+						&& GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
 					try {
-						zcyhWebService.delete(delEntity);
-						delEntity.setTbzt(Constants.YES);
-						delEntity
-								.setRecordStatus(BaseEntity.RECORD_STATE_DELETE);
-						zcyhService.save(delEntity);
+						ZcWebService webService = zcService.getWebService();
+						if (webService != null) {
+							webService.save(tbEntity);
+							tbEntity.setTbzt(Constants.YES);
+							zcService.save(tbEntity);
+						} else {
+							tbEntity.setTbzt(Constants.NO);
+							zcService.save(tbEntity);
+						}
 					} catch (Exception e) {
 						e.printStackTrace();
+						tbEntity.setTbzt(Constants.NO);
+						zcService.save(tbEntity);
 					}
-				}
-				for (ZcyhEntity zcyhEntity : yhList) {
-					try {
-						zcyhWebService.save(zcyhEntity);
-						zcyhEntity.setTbzt(Constants.YES);
-						zcyhService.save(zcyhEntity);
-					} catch (Exception e) {
-						e.printStackTrace();
-						zcyhEntity.setTbzt(Constants.NO);
-						zcyhService.save(zcyhEntity);
+					List<ZcyhEntity> yhList = zcyhService.findBySszc(tbEntity);
+
+					ZcyhWebService zcyhWebService = zcyhService.getWebService();
+					if (null != zcyhWebService) {
+						for (ZcyhEntity delEntity : delList) {
+							try {
+								zcyhWebService.delete(delEntity);
+								delEntity.setTbzt(Constants.YES);
+								delEntity
+										.setRecordStatus(BaseEntity.RECORD_STATE_DELETE);
+								zcyhService.save(delEntity);
+							} catch (Exception e) {
+								e.printStackTrace();
+							}
+						}
+						for (ZcyhEntity zcyhEntity : yhList) {
+							try {
+								zcyhWebService.save(zcyhEntity);
+								zcyhEntity.setTbzt(Constants.YES);
+								zcyhService.save(zcyhEntity);
+							} catch (Exception e) {
+								e.printStackTrace();
+								zcyhEntity.setTbzt(Constants.NO);
+								zcyhService.save(zcyhEntity);
+							}
+						}
+					} else {
+						for (ZcyhEntity zcyhEntity : yhList) {
+							zcyhEntity.setTbzt(Constants.NO);
+							zcyhService.save(zcyhEntity);
+						}
+					}
+					AccessoryWebService accessoryWebService = accessoryService
+							.getAccessoryWebService(tbEntity.getSzd().getId());		
+					if (null != accessoryWebService) {
+						List<AccessoryEntity> accList = new ArrayList<AccessoryEntity>();
+						for (ZcyhEntity zcyhEntity : yhList) {
+							accList.addAll((List<AccessoryEntity>) accessoryController
+									.listById(zcyhEntity.getId(),
+											Long.parseLong(Constants.FJSSLX_YHZP))
+									.getAttribute("records"));
+							accList.addAll((List<AccessoryEntity>) accessoryController
+									.listById(zcyhEntity.getId(),
+											Long.parseLong(Constants.FJSSLX_ZGHZP))
+									.getAttribute("records"));
+							accList.addAll((List<AccessoryEntity>) accessoryController
+									.listById(zcyhEntity.getId(),
+											Long.parseLong(Constants.FJSSLX_ZGCSFJ))
+									.getAttribute("records"));
+							accList.addAll((List<AccessoryEntity>) accessoryController
+									.listById(zcyhEntity.getId(),
+											Long.parseLong(Constants.FJSSLX_ZGJGFJ))
+									.getAttribute("records"));
+						}
+						if(accList!=null){
+							for(AccessoryEntity acc:accList){
+								if(acc.getTbzt().equals(Constants.NO)){
+									try {
+										accessoryWebService.save(acc);
+										acc.setTbzt(Constants.YES);
+										accessoryService.save(acc);
+									} catch (Exception e) {
+										e.printStackTrace();
+										acc.setTbzt(Constants.NO);
+										accessoryService.save(acc);
+									}	
+								}							
+							}
+						}
 					}
-				}
-			} else {
-				for (ZcyhEntity zcyhEntity : yhList) {
-					zcyhEntity.setTbzt(Constants.NO);
-					zcyhService.save(zcyhEntity);
 				}
 			}
-		}
+		});
+		threadPool.execute(thread);		
 		return zcEntity;
 	}
 
@@ -223,8 +395,7 @@ public class ZczbWebService extends BaseController {
 			final Long szgq, final Long qymc, final String aqfzr, Date jcsjK,
 			Date jcsjZ, int n, int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
-		addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
-		jcsjK = Utils.getDateLastTime(jcsjK);
+		jcsjK = Utils.getDateFirstTime(jcsjK);
 		jcsjZ = Utils.getDateLastTime(jcsjZ);
 		if (null != szd) {
 			addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);

+ 57 - 10
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

@@ -54,6 +54,7 @@ import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzblhhzService;
 import com.jtgh.yjpt.service.zysqbp.ZysqbgService;
 import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
 import com.jtgh.yjpt.service.zysqbp.ZysqqxService;
+import com.jtgh.yjpt.webService.WsResult;
 
 /**
  * 危货作业申请WebService
@@ -374,17 +375,27 @@ public class WhsqbpWebService extends BaseController {
 	/**
 	 * 保存信息
 	 */
-	public ZysqbpEntity save(ZysqbpEntity sqbp) {
-		if (null == sqbp.getId() || sqbp.getId().equals(0l)) {
-			sqbp.setAddDate(new Date());
-			sqbp.setAddUser(Utils.getWebServiceUser());
-			sqbp.setRecordCode("90");
-			sqbp.setKgzt(Constants.NO);
+	public ZysqbpEntity save(ZysqbpEntity entity) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			entity.setRecordCode("90");
+			entity.setKgzt(Constants.NO);
+			entity.setWgzt(Constants.NO);
 		} else {
-			sqbp.setUpdateDate(new Date());
-			sqbp.setUpdateUser(Utils.getWebServiceUser());
+			ZysqbpEntity vo = zysqbpService.findOne(entity.getId());
+			entity.setAddDate(vo.getAddDate());
+			entity.setAddUser(vo.getAddUser());
+			entity.setRecordCode(vo.getRecordCode());
+			entity.setRecordStatus(vo.getRecordStatus());
+			entity.setSftb(vo.getSftb());
+			entity.setTbzt(vo.getTbzt());
+			entity.setQylb(vo.getQylb());
+			entity.setTbdyid(vo.getTbdyid());
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
-		return zysqbpService.save(sqbp);
+		return zysqbpService.save(entity);
 	}
 
 	/**
@@ -405,10 +416,34 @@ public class WhsqbpWebService extends BaseController {
 			entity.setXg(sqbp.getXg());
 			entity.setWgzt(sqbp.getWgzt());
 			entity.setWgsj(sqbp.getWgsj());
-			sqbp= zysqbpService.kgwgSave(sqbp);
+			sqbp= zysqbpService.kgwgSave(entity);
 		}
 		return sqbp;		
 	}
+	
+	
+	/**
+	 * 删除
+	 * @param entity
+	 * @return
+	 */
+	public WsResult delete(ZysqbpEntity entity) {
+		WsResult ws = new WsResult();
+		entity=zysqbpService.findOne(entity.getId());
+		if(entity.getRecordStatus()==BaseEntity.RECORD_STATE_VALID){
+			try {
+				zysqbpService.logicDelete(Collections.singletonList(entity));
+				ws.setResultCode(WsResult.SUCCESS);
+			} catch (Exception e) {
+				e.printStackTrace();
+				ws.setResultCode(WsResult.FAILURE);
+			}
+		} else {
+			ws.setResultCode(WsResult.WARNING);
+		}	
+		return ws;
+	}
+	
 
 	/**
 	 * 提交信息 return 0:提交成功 1:您选择的作业场所的附证未进行年审,请先保存本条数据,并进行相应的附证年审!
@@ -423,9 +458,21 @@ public class WhsqbpWebService extends BaseController {
 			sqbp.setAddUser(Utils.getWebServiceUser());
 			sqbp.setRecordCode("90");
 			sqbp.setKgzt(Constants.NO);//确保开 工状态有数据
+			sqbp.setWgzt(Constants.NO);
 		} else {
+			ZysqbpEntity vo = zysqbpService.findOne(sqbp.getId());
+			sqbp.setAddDate(vo.getAddDate());
+			sqbp.setAddUser(vo.getAddUser());
+			sqbp.setRecordCode(vo.getRecordCode());
+			sqbp.setRecordStatus(vo.getRecordStatus());
+			sqbp.setSftb(vo.getSftb());
+			sqbp.setTbzt(vo.getTbzt());
+			sqbp.setQylb(vo.getQylb());
+			sqbp.setTbdyid(vo.getTbdyid());
 			sqbp.setUpdateDate(new Date());
 			sqbp.setUpdateUser(Utils.getWebServiceUser());
+			sqbp.setKgzt(Constants.NO);//确保开 工状态有数据
+			sqbp.setWgzt(Constants.NO);
 		}
 		if (sqbp.getZyddqybh() != null) {
 			GkwxhwzyfzblFzEntity zyddqybh = new GkwxhwzyfzblFzEntity();

BIN
gkaq/yjpt-java/trunk/resources/iReport/jyr/ryjcxx-pdf.jasper


+ 1 - 1
gkaq/yjpt-java/trunk/resources/iReport/jyr/ryjcxx-pdf.jrxml

@@ -77,7 +77,7 @@
 			</textField>
 			<frame>
 				<reportElement mode="Opaque" x="0" y="50" width="250" height="125" backcolor="#21A5B6" uuid="f45b84b2-29f2-43e4-93d0-86e1b1f26771"/>
-				<image scaleImage="RealSize" isLazy="true">
+				<image scaleImage="Clip" isLazy="true">
 					<reportElement isPrintRepeatedValues="false" x="0" y="0" width="100" height="125" uuid="efb32dd4-d1cd-48a8-9dc2-769a178fff0c"/>
 					<imageExpression><![CDATA[$P{zp}==null?$P{portrait}:new java.io.ByteArrayInputStream($P{zp})]]></imageExpression>
 				</image>