YcslGxrService.java 2.35 KB
/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ycsl.service;

import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.ycsl.entity.YcslGxr;
import com.thinkgem.jeesite.modules.ycsl.entity.YcslJbxx;
import com.thinkgem.jeesite.modules.reg.web.httprest.httpRestService.HttpactivityService;
import com.thinkgem.jeesite.modules.ycsl.dao.YcslGxrDao;

/**
 * 一窗受理-关系人Service
 * @author lzj
 * @version 2020-12-24
 */
@Service
@Transactional(readOnly = true)
public class YcslGxrService extends CrudService<YcslGxrDao, YcslGxr> {
	 @Lazy
	@Autowired
	private YcslJbxxService ycslJbxxService;
	@Autowired
	private HttpactivityService httpactivityService;

	public YcslGxr get(String id) {
		return super.get(id);
	}
	
	public List<YcslGxr> findList(YcslGxr ycslGxr) {
		return super.findList(ycslGxr);
	}
	
	public List<YcslGxr> findList_1(YcslGxr ycslGxr1) {
		return super.findList_1(ycslGxr1);
	}
	
	public Page<YcslGxr> findPage(Page<YcslGxr> page, YcslGxr ycslGxr) {
		return super.findPage(page, ycslGxr);
	}
	
	@Transactional(readOnly = false)
	public void save(YcslGxr ycslGxr) {
		super.save(ycslGxr);
	}
	
	@Transactional(readOnly = false)
	public void delete(YcslGxr ycslGxr) {
		super.delete(ycslGxr);
	}

	@Transactional(readOnly = false)
	public void deleteByproid(String proid) {
		dao.deleteByproid(proid);
		
	}

	@Transactional(readOnly = false)
	public void saveGxr(YcslGxr ycslGxr) {
		YcslJbxx jbxx = ycslJbxxService.get(ycslGxr.getProid());
		Map map = Maps.newHashMap();
		if(StringUtils.isNotBlank(jbxx.getZt())) {
			map = ycslJbxxService.getMap(jbxx);
			try {
				Map json = httpactivityService.postRequest(map,"updateSL");
				jbxx.setZt("true");
				ycslJbxxService.save(jbxx);
			} catch (Exception e) {
				jbxx.setZt("false");
				ycslJbxxService.save(jbxx);
				e.printStackTrace();
			}
		}
		save(ycslGxr);
	}

	
}