| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | package com.zcloud.service.xgf.impl; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | import com.zcloud.entity.Page; | 
					
						
							|  |  |  |  | import com.zcloud.entity.PageData; | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | import com.zcloud.mapper.datasource.system.DepartmentMapper; | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | import com.zcloud.mapper.datasource.system.UsersMapper; | 
					
						
							|  |  |  |  | import com.zcloud.mapper.datasource.xgf.*; | 
					
						
							|  |  |  |  | import com.zcloud.service.xgf.TrainingBatchService; | 
					
						
							|  |  |  |  | import com.zcloud.util.*; | 
					
						
							|  |  |  |  | import org.apache.commons.lang.StringUtils; | 
					
						
							|  |  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
					
						
							|  |  |  |  | import org.springframework.beans.factory.annotation.Value; | 
					
						
							|  |  |  |  | import org.springframework.stereotype.Service; | 
					
						
							|  |  |  |  | import org.springframework.transaction.annotation.Transactional; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | import javax.annotation.Resource; | 
					
						
							|  |  |  |  | import java.text.DecimalFormat; | 
					
						
							|  |  |  |  | import java.util.*; | 
					
						
							|  |  |  |  | import java.util.stream.Collectors; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /** | 
					
						
							|  |  |  |  |  * 说明:培训批次管理 | 
					
						
							|  |  |  |  |  * 作者:luoxiaobao | 
					
						
							|  |  |  |  |  * 时间:2023-05-08 | 
					
						
							|  |  |  |  |  * 官网:www.zcloudchina.com | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | @Service | 
					
						
							|  |  |  |  | @Transactional //开启事物
 | 
					
						
							|  |  |  |  | public class TrainingBatchServiceImpl implements TrainingBatchService { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private TrainingBatchMapper trainingbatchMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private TrainUsersMapper trainUsersMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private XgfUserMapper xgfUserMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private FlowMapper flowMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private FlowDetailMapper flowDetailMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private UsersMapper usersMapper; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Resource | 
					
						
							|  |  |  |  | 	private DepartmentMapper departmentMapper; | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**新增 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public void save(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		/* 保存主题信息 */ | 
					
						
							|  |  |  |  | 		String batch_id=UuidUtil.get32UUID(); | 
					
						
							|  |  |  |  | 		String train_area=pd.getString("TRAIN_AREA"); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		pd.put("TRAINING_BATCH_ID", batch_id);	//主键
 | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		pd.put("CREATOR", Jurisdiction.getUsername());	//添加人
 | 
					
						
							|  |  |  |  | 		pd.put("CREATTIME", DateUtil.date2Str(new Date()));	//添加时间
 | 
					
						
							|  |  |  |  | 		pd.put("OPERATOR", Jurisdiction.getUsername());	//修改人
 | 
					
						
							|  |  |  |  | 		pd.put("OPERATTIME", DateUtil.date2Str(new Date()));	//修改时间
 | 
					
						
							|  |  |  |  | 		pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  | 		pd.put("ISDELETE", 0);	//是否删除 1-是  0-否
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		Calendar calendar = Calendar.getInstance(); | 
					
						
							|  |  |  |  | 		DecimalFormat dft=new DecimalFormat("00"); | 
					
						
							|  |  |  |  | 		int year = calendar.get(Calendar.YEAR); | 
					
						
							|  |  |  |  | 		String month = dft.format(calendar.get(Calendar.MONTH) + 1); | 
					
						
							|  |  |  |  | 		pd.put("CREATDATE",year + "-" + month); | 
					
						
							|  |  |  |  | 		PageData cpd = trainingbatchMapper.getCode(pd);	//根据ID读取
 | 
					
						
							|  |  |  |  | 		String code = year + "-" + month + "-" +  dft.format((Integer.parseInt(cpd.get("code").toString())+1)); | 
					
						
							|  |  |  |  | 		pd.put("BATCH_NAME",code); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		/*翻译*/ | 
					
						
							|  |  |  |  | 		PageData condition = new PageData(); | 
					
						
							|  |  |  |  | 		condition.put("USER_ID",pd.get("SUPERVISION_USER_ID")); | 
					
						
							|  |  |  |  | 		PageData supUser = usersMapper.getUserInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("SUPERVISION_USER_NAME",supUser.get("NAME")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("DEPARTMENT_ID",pd.get("SUPERVISION")); | 
					
						
							|  |  |  |  | 		PageData supDepartment = departmentMapper.getInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("SUPERVISION_DEPARTMENT_NAME",supDepartment.get("NAME")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("USER_ID",pd.get("MANAGER_USER_ID")); | 
					
						
							|  |  |  |  | 		PageData manUser = usersMapper.getUserInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("MANAGER_USER_NAME",manUser.get("NAME")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("DEPARTMENT_ID",pd.get("MANAGER")); | 
					
						
							|  |  |  |  | 		PageData manDepartment = departmentMapper.getInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("MANAGER_DEPARTMENT_NAME",manDepartment.get("NAME")); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("USER_ID",pd.get("TERRITORIALITY_USER_ID")); | 
					
						
							|  |  |  |  | 		PageData terUser = usersMapper.getUserInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("TERRITORIALITY_USER_NAME",terUser.get("NAME")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("DEPARTMENT_ID",pd.get("TERRITORIALITY")); | 
					
						
							|  |  |  |  | 		PageData terDepartment = departmentMapper.getInfo(condition); | 
					
						
							|  |  |  |  | 		pd.put("TERRITORIALITY_DEPARTMENT_NAME",terDepartment.get("NAME")); | 
					
						
							|  |  |  |  | 		pd.put("IS_DELETE","0"); | 
					
						
							|  |  |  |  | 		pd.put("STEP_STATUS","0"); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		trainingbatchMapper.save(pd); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		String arrayDATA_ids[] = pd.getString("users").split(","); | 
					
						
							|  |  |  |  | 		Arrays.asList(arrayDATA_ids).forEach(id -> { | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			PageData user = new PageData(); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 			user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); | 
					
						
							|  |  |  |  | 			user.put("TRAINING_BATCH_ID", batch_id); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			user.put("USER_ID", id); | 
					
						
							|  |  |  |  | 			user.put("TRAIN_AREA", train_area); | 
					
						
							|  |  |  |  | 			user.put("STATUS", 0); | 
					
						
							|  |  |  |  | 			user.put("SUPERVISION_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("MANAGER_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("TERRITORIALITY_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("STEP_STATUS", "0"); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 			user.put("BELONG_TO_CORP",pd.get("BELONG_TO_CORP")); | 
					
						
							|  |  |  |  | 			user.put("BELONG_TO_CORP_NAME",pd.get("BELONG_TO_CORP_NAME")); | 
					
						
							|  |  |  |  | 			user.put("IS_DELETE", "0"); | 
					
						
							|  |  |  |  | 			user.put("RESULT_STATUS","1"); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			trainUsersMapper.save(user); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 			condition.clear(); | 
					
						
							|  |  |  |  | 			condition.put("XGF_USER_ID",id); | 
					
						
							|  |  |  |  | 			PageData userEntity = xgfUserMapper.findById(condition); | 
					
						
							|  |  |  |  | 			userEntity.put("STATUS","3"); | 
					
						
							|  |  |  |  | 			userEntity.put("STUDY_STATUS","9"); | 
					
						
							|  |  |  |  | 			xgfUserMapper.edit(userEntity); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		}); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		/* 保存审批流程信息 */ | 
					
						
							|  |  |  |  | 		PageData flow = new PageData(); | 
					
						
							|  |  |  |  | 		flow.put("FLOW_ID", Warden.get32UUID()); | 
					
						
							|  |  |  |  | 		flow.put("TYPE", "0"); | 
					
						
							|  |  |  |  | 		flow.put("CREATOR",Jurisdiction.getUSER_ID()); | 
					
						
							|  |  |  |  | 		flow.put("CREATOR_NAME",Jurisdiction.getName()); | 
					
						
							|  |  |  |  | 		flow.put("CREATOR_TIME", DateUtil.getTime()); | 
					
						
							|  |  |  |  | 		flow.put("VALID_FLAG", "1"); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		flow.put("FOREIGN_KEY",pd.getString("TRAINING_BATCH_ID")); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		flow.put("ISDELETE", "0"); | 
					
						
							|  |  |  |  | 		flowMapper.save(flow); | 
					
						
							|  |  |  |  | 		/* 保存审批流程明细信息 */ | 
					
						
							|  |  |  |  | 		PageData flowDetail = new PageData(); | 
					
						
							|  |  |  |  | 		flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); | 
					
						
							|  |  |  |  | 		flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); | 
					
						
							|  |  |  |  | 		flowDetail.put("STEP_FLAG", "1"); | 
					
						
							|  |  |  |  | 		flowDetail.put("SORT",0); | 
					
						
							|  |  |  |  | 		flowDetail.put("APPROVER_ID",Jurisdiction.getUSER_ID()); | 
					
						
							|  |  |  |  | 		flowDetail.put("APPROVER_NAME",Jurisdiction.getName()); | 
					
						
							|  |  |  |  | 		flowDetail.put("APPROVER_TIME", DateUtil.getTime()); | 
					
						
							|  |  |  |  | 		flowDetail.put("APPROVER_CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); | 
					
						
							|  |  |  |  | 		// TODO 未完成
 | 
					
						
							|  |  |  |  | 		flowDetail.put("APPROVER_CORPINFO_NAME",""); | 
					
						
							|  |  |  |  | 		flowDetail.put("PASS_FLAG", "1"); | 
					
						
							|  |  |  |  | 		flowDetail.put("END_FLAG", "0"); | 
					
						
							|  |  |  |  | 		flowDetail.put("ISDELETE", "0"); | 
					
						
							|  |  |  |  | 		flowDetail.put("PARENT_ID","0"); | 
					
						
							|  |  |  |  | 		flowDetailMapper.save(flowDetail); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**固定人员培训 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public void unflowTrain(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		PageData trainBatch = new PageData(); | 
					
						
							|  |  |  |  | 		String batch_id = UuidUtil.get32UUID(); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		trainBatch.put("TRAINING_BATCH_ID", batch_id);    //主键
 | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME"));    //添加人
 | 
					
						
							|  |  |  |  | 		trainBatch.put("CREATTIME", DateUtil.date2Str(new Date()));    //添加时间
 | 
					
						
							|  |  |  |  | 		trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME"));    //修改人
 | 
					
						
							|  |  |  |  | 		trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date()));    //修改时间
 | 
					
						
							|  |  |  |  | 		trainBatch.put("ISDELETE", 0);    //是否删除 1-是  0-否
 | 
					
						
							|  |  |  |  | 		trainBatch.put("TYPE", 1); | 
					
						
							|  |  |  |  | 		trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); | 
					
						
							|  |  |  |  | 		trainBatch.put("AUDIT_STATUS", 0); | 
					
						
							|  |  |  |  | 		trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); | 
					
						
							|  |  |  |  | 		trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		Calendar calendar = Calendar.getInstance(); | 
					
						
							|  |  |  |  | 		DecimalFormat dft = new DecimalFormat("00"); | 
					
						
							|  |  |  |  | 		int year = calendar.get(Calendar.YEAR); | 
					
						
							|  |  |  |  | 		String month = dft.format(calendar.get(Calendar.MONTH) + 1); | 
					
						
							|  |  |  |  | 		trainBatch.put("CREATDATE", year + "-" + month); | 
					
						
							|  |  |  |  | 		PageData cpd = trainingbatchMapper.getCode(trainBatch);    //根据ID读取
 | 
					
						
							|  |  |  |  | 		String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); | 
					
						
							|  |  |  |  | 		trainBatch.put("BATCH_NAME", code); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		trainingbatchMapper.save(trainBatch); | 
					
						
							|  |  |  |  | 		trainBatch.put("AUDIT_STATUS", "2"); | 
					
						
							|  |  |  |  | 		this.audit(trainBatch); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		String arrayDATA_IDS[] = pd.getString("users").split(","); | 
					
						
							|  |  |  |  | 		Arrays.asList(arrayDATA_IDS).forEach(id -> { | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			PageData user = new PageData(); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 			user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); | 
					
						
							|  |  |  |  | 			user.put("TRAINING_BATCH_ID", batch_id); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			user.put("USER_ID", id); | 
					
						
							|  |  |  |  | 			user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); | 
					
						
							|  |  |  |  | 			user.put("STATUS", 1); | 
					
						
							|  |  |  |  | 			user.put("START_DATE", DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			user.put("SUPERVISION_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("MANAGER_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("TERRITORIALITY_STATE", 9); | 
					
						
							|  |  |  |  | 			user.put("STEP_STATUS", "0"); | 
					
						
							|  |  |  |  | 			trainUsersMapper.save(user); | 
					
						
							|  |  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		xgfUserMapper.bantchUpdateStatus(1,arrayDATA_IDS); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**删除 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public void delete(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		trainingbatchMapper.delete(pd); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**修改 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public void edit(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		trainingbatchMapper.edit(pd); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	public void audit(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1){ | 
					
						
							|  |  |  |  | 			pd.put("STATUS",0); | 
					
						
							|  |  |  |  | 			pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			xgfUserMapper.updateStatusByFlowTrain(pd); | 
					
						
							|  |  |  |  | 			trainingbatchMapper.audit(pd); | 
					
						
							|  |  |  |  | 		}else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2){ | 
					
						
							|  |  |  |  | 			pd.put("STATUS",1); | 
					
						
							|  |  |  |  | 			pd.put("START_DATE",DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			xgfUserMapper.updateStatusByFlowTrain(pd); | 
					
						
							|  |  |  |  | 			trainUsersMapper.updateStatusByFlowTrain(pd); | 
					
						
							|  |  |  |  | 			trainingbatchMapper.audit(pd); | 
					
						
							|  |  |  |  | 		}else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3){ | 
					
						
							|  |  |  |  | 			pd.put("STATUS",2); | 
					
						
							|  |  |  |  | 			pd.put("END_DATE",DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			pd.put("VERIFY_TIME",DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			xgfUserMapper.updateStatusByFlowTrain(pd); | 
					
						
							|  |  |  |  | 			trainUsersMapper.updateStatusByFlowTrain(pd); | 
					
						
							|  |  |  |  | 			trainingbatchMapper.audit(pd); | 
					
						
							|  |  |  |  | 		}else{ | 
					
						
							|  |  |  |  | 			pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); | 
					
						
							|  |  |  |  | 			trainingbatchMapper.audit(pd); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**列表 | 
					
						
							|  |  |  |  | 	 * @param page | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public List<PageData> list(Page page)throws Exception{ | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.datalistPage(page); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**列表(全部) | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public List<PageData> listAll(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.listAll(pd); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**通过id获取数据 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public PageData findById(PageData pd)throws Exception{ | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.findById(pd); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/**批量删除 | 
					
						
							|  |  |  |  | 	 * @param ArrayDATA_IDS | 
					
						
							|  |  |  |  | 	 * @throws Exception | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | 
					
						
							|  |  |  |  | 		trainingbatchMapper.deleteAll(ArrayDATA_IDS); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	/** | 
					
						
							|  |  |  |  | 	 * 获取编号 | 
					
						
							|  |  |  |  | 	 * @param pd | 
					
						
							|  |  |  |  | 	 * @return | 
					
						
							|  |  |  |  | 	 */ | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public PageData getCode(PageData pd) throws Exception{ | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.getCode(pd); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	public List<PageData> batchUserlistPage(Page page)throws Exception{ | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.batchUserlistPage(page); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public List<PageData> passUserlistPage(Page page) throws Exception { | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.passUserlistPage(page); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public void graduation(PageData condition) { | 
					
						
							|  |  |  |  | 		trainingbatchMapper.graduation(condition); | 
					
						
							|  |  |  |  | 		xgfUserMapper.graduation(condition); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public void openClass(PageData info) { | 
					
						
							|  |  |  |  | 		List<PageData> list = Warden.getList(info.getString("list")); | 
					
						
							|  |  |  |  | 		PageData condition = new PageData(); | 
					
						
							|  |  |  |  | 			condition.put("STATUS",info.getString("userStatus")); | 
					
						
							|  |  |  |  | 			condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); | 
					
						
							|  |  |  |  | 			xgfUserMapper.graduation(condition); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 			condition.clear(); | 
					
						
							|  |  |  |  | 			condition.put("STATUS",info.getString("detailsStatus")); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 			condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 			trainUsersMapper.graduation(condition); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public void openStudentClass(PageData info) { | 
					
						
							|  |  |  |  | //		List<PageData> list = Warden.getList(info.getString("list"));
 | 
					
						
							|  |  |  |  | 		PageData condition = new PageData(); | 
					
						
							|  |  |  |  | 		condition.put("STATUS",info.getString("userStatus")); | 
					
						
							|  |  |  |  | 		condition.put("USER_ID", info.getString("USER_ID")); | 
					
						
							|  |  |  |  | 		xgfUserMapper.graduationstudent(condition); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		condition.clear(); | 
					
						
							|  |  |  |  | 		condition.put("STATUS",info.getString("detailsStatus")); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		trainUsersMapper.graduationstudent(condition); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public void updateClassMessage(PageData info) { | 
					
						
							|  |  |  |  | 		List<PageData> list = Warden.getList(info.getString("list")); | 
					
						
							|  |  |  |  | 		PageData condition = new PageData(); | 
					
						
							| 
									
										
										
										
											2023-12-20 14:49:01 +08:00
										 |  |  |  | 		condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | 		if (StringUtils.isNotEmpty(info.getString("START_DATE"))){ | 
					
						
							|  |  |  |  | 			condition.put("START_DATE",DateUtil.getTime()); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		if (StringUtils.isNotEmpty(info.getString("END_DATE"))){ | 
					
						
							|  |  |  |  | 			condition.put("END_DATE",DateUtil.getTime()); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		trainUsersMapper.updateDate(condition); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public void saveFlow(PageData request) throws Exception { | 
					
						
							|  |  |  |  | 		/* 保存审批流程明细信息 */ | 
					
						
							|  |  |  |  | 		PageData condition = new PageData(); | 
					
						
							|  |  |  |  | 		condition.put("FLOW_ID", request.getString("FLOW_ID")); | 
					
						
							|  |  |  |  | 		condition.put("STEP_FLAG", "1"); | 
					
						
							|  |  |  |  | 		PageData flow = flowDetailMapper.selectOne(condition); | 
					
						
							|  |  |  |  | 		flow.put("STEP_FLAG", "0"); | 
					
						
							|  |  |  |  | 		flowDetailMapper.edit(flow); | 
					
						
							|  |  |  |  | 		PageData next_flow = new PageData(); | 
					
						
							|  |  |  |  | 		next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); | 
					
						
							|  |  |  |  | 		next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); | 
					
						
							|  |  |  |  | 		next_flow.put("STEP_FLAG", "1"); | 
					
						
							|  |  |  |  | 		next_flow.put("SORT",(Integer)flow.get("SORT")+1); | 
					
						
							|  |  |  |  | 		next_flow.put("APPROVER_ID",request.get("APPROVER_ID")); | 
					
						
							|  |  |  |  | 		next_flow.put("APPROVER_NAME",request.get("APPROVER_NAME")); | 
					
						
							|  |  |  |  | 		next_flow.put("APPROVER_TIME", DateUtil.getTime()); | 
					
						
							|  |  |  |  | 		next_flow.put("APPROVER_CORPINFO_ID",request.get("APPROVER_CORPINFO_ID")); | 
					
						
							|  |  |  |  | 		next_flow.put("APPROVER_CORPINFO_NAME",request.get("APPROVER_CORPINFO_NAME")); | 
					
						
							|  |  |  |  | 		next_flow.put("PASS_FLAG", "1"); | 
					
						
							|  |  |  |  | 		next_flow.put("END_FLAG", "0"); | 
					
						
							|  |  |  |  | 		next_flow.put("ISDELETE", "0"); | 
					
						
							|  |  |  |  | 		next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID")); | 
					
						
							|  |  |  |  | 		flowDetailMapper.save(next_flow); | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2023-12-21 13:58:57 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 	@Override | 
					
						
							|  |  |  |  | 	public List<PageData> findByUserId(PageData condition) throws Exception { | 
					
						
							|  |  |  |  | 		return trainingbatchMapper.findByUserId(condition); | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2023-12-18 20:24:02 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 |