|  | @ -988,13 +988,37 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public MixEnvelop doctorDescreaseIntegrate(String ruleId,String patientId,String doctorId,String hospital,String hospitalName,Integer integrate,String reason,String type) throws Exception {
 | 
	
		
			
				|  |  |        MixEnvelop envelop = new MixEnvelop<>();
 | 
	
		
			
				|  |  |        envelop.setObj(true);
 | 
	
		
			
				|  |  |        TaskDO taskDO =  taskDao.selectByTaskRuleId(ruleId);
 | 
	
		
			
				|  |  |        String sql = "select * from wlyy_health_bank_account where status = 1 and patient_id = '"+patientId+"'";
 | 
	
		
			
				|  |  |        List<AccountDO> accountDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(AccountDO.class));
 | 
	
		
			
				|  |  |        AccountDO accountDO = accountDOs.get(0);
 | 
	
		
			
				|  |  |     public MixEnvelop doctorDescreaseIntegrate(String ruleId,String patientId,String doctorId,String hospital,String hospitalName,Integer integrate,String reason,String type,String name,String idcard) throws Exception {
 | 
	
		
			
				|  |  |         MixEnvelop envelop = new MixEnvelop<>();
 | 
	
		
			
				|  |  |         envelop.setObj(true);
 | 
	
		
			
				|  |  |         TaskDO taskDO =  taskDao.selectByTaskRuleId(ruleId);
 | 
	
		
			
				|  |  |         String sql = "select * from wlyy_health_bank_account where status = 1 and patient_id = '"+patientId+"'";
 | 
	
		
			
				|  |  |         List<AccountDO> accountDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(AccountDO.class));
 | 
	
		
			
				|  |  |         AccountDO accountDO = null;
 | 
	
		
			
				|  |  |         if("add".equals(type)&&(accountDOs==null||accountDOs.size()==0)){
 | 
	
		
			
				|  |  |             //新建账户
 | 
	
		
			
				|  |  |             accountDO = new AccountDO();
 | 
	
		
			
				|  |  |             accountDO.setTotal(0);
 | 
	
		
			
				|  |  |             accountDO.setId(getCode());
 | 
	
		
			
				|  |  |             accountDO.setPatientId(patientId);
 | 
	
		
			
				|  |  |             accountDO.setAccountName(name);
 | 
	
		
			
				|  |  |             accountDO.setHospital(hospital);
 | 
	
		
			
				|  |  |             accountDO.setHospitalName(hospitalName);
 | 
	
		
			
				|  |  |             if(idcard.length()>=4){// 判断是否长度大于等于4
 | 
	
		
			
				|  |  |                 String cardNumber=idcard.substring(idcard.length()- 4,idcard.length());//截取两个数字之间的部分
 | 
	
		
			
				|  |  |                 int random = (int)((Math.random()*9+1)*100000);
 | 
	
		
			
				|  |  |                 accountDO.setCardNumber(cardNumber+Integer.toString(random));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             accountDO.setPassword("123456");
 | 
	
		
			
				|  |  |             accountDO.setSaasId("dev");
 | 
	
		
			
				|  |  |             accountDO.setStatus(1);
 | 
	
		
			
				|  |  |             accountDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |             accountDO.setUpdateTime(new Date());
 | 
	
		
			
				|  |  |             accountDO = accountDao.save(accountDO);
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             accountDO = accountDOs.get(0);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |        if (taskDO == null){
 | 
	
		
			
				|  |  |            TaskRuleDO taskRuleDO =  taskRuleDao.findByCode(ruleId);
 | 
	
		
			
				|  |  |            TaskDO  taskDO1 = new TaskDO();
 |