| | |
| | | return model; |
| | | } |
| | | //4.10作业抽查管理(编辑记录)(user_battmaint_check表修改时User_battmaint_check_process表就新增一条记录) |
| | | public ServiceModel updatePro(User_battmaint_check obj1,List<User_battmaint_check_process> obj2) { |
| | | public ServiceModel updatePro(User_battmaint_check ucheck,List<User_battmaint_check_process> list) { |
| | | ServiceModel model = new ServiceModel(); |
| | | //TODO perry待查 |
| | | boolean bl = true; |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | User_battmaint_check ucheck = (User_battmaint_check) obj1; |
| | | List<User_battmaint_check_process> list = (List<User_battmaint_check_process>) obj2; |
| | | ArrayList<String> str_sql = new ArrayList<String>();//存放所有的sql语句 |
| | | // ArrayList<String> str_sql = new ArrayList<String>();//存放所有的sql语句 |
| | | //修改User_battmaint_check表 |
| | | if (!(mapper.updatePro(ucheck) > 0)) { |
| | | bl = false; |
| | |
| | | String[] copy_names; |
| | | System.out.println(" list.size = " + list.size()); |
| | | for(int i=0;i<list.size();i++){ |
| | | System.out.println("list.get("+i+") = " + list.get(i)); |
| | | BattInf binf=new BattInf(); |
| | | //电池组组数 |
| | | binf.setStationName(list.get(i).getMcheck().getRemark()); |
| | |
| | | //责任人/创建人/指派人/抄送人 |
| | | usr_id=list.get(i).getMcheck().getUsr_id(); |
| | | uinf.setuId(usr_id); |
| | | usr_name=((User_inf)userInfMapper.serchUname(uinf).get(0)).getuName(); |
| | | // System.out.println("usr_id = " + usr_id); |
| | | List<User_inf> listuser_inf = userInfMapper.serchUname(uinf); |
| | | if (listuser_inf.size() > 0) { |
| | | usr_name = listuser_inf.get(0).getuName(); |
| | | } |
| | | binf.setStationName6(usr_name); |
| | | |
| | | master_id=list.get(i).getMcheck().getMaster_id(); |
| | | uinf.setuId(master_id); |
| | | master_name=((User_inf)userInfMapper.serchUname(uinf).get(0)).getuName(); |
| | | List<User_inf> user_infs = userInfMapper.serchUname(uinf); |
| | | if (user_infs.size() > 0) { |
| | | master_name = user_infs.get(0).getuName(); |
| | | } |
| | | binf.setStationName7(master_name); |
| | | |
| | | appoint_uid=list.get(i).getMcheck().getAppoint_uid(); |
| | | uinf.setuId(appoint_uid); |
| | | appoint_name=((User_inf)userInfMapper.serchUname(uinf).get(0)).getuName(); |
| | | List<User_inf> user_infs1 = userInfMapper.serchUname(uinf); |
| | | if (user_infs1.size() > 0) { |
| | | appoint_name = user_infs1.get(0).getuName(); |
| | | } |
| | | binf.setStationName8(appoint_name); |
| | | //System.out.println(usr_name+" "+master_name+" "+appoint_name); |
| | | copy_ids=list.get(i).getMcheck().getCopy_uids(); |
| | | System.out.println("copy_ids = " + copy_ids); //1001,1002,1003,1004,1008 |
| | | copy_names=copy_ids.split(","); |
| | | for(int j=0;j<copy_names.length;j++){ |
| | | copy_id=Integer.parseInt(copy_names[j]); |
| | | uinf.setuId(copy_id); |
| | | copy_name+=","; |
| | | copy_name+=userInfMapper.serchUname(uinf).get(0).getuName(); |
| | | // List<User_inf> listu = userInfMapper.serchUname(uinf); |
| | | // System.out.println("listu = " + listu); |
| | | // User_inf user_inf = listu.get(0); |
| | | // copy_name+= user_inf.getuName(); |
| | | if (copy_names.length>0) { |
| | | System.out.println("copy_names = " + copy_names.toString()); |
| | | for (int j = 0; j < copy_names.length; j++) { |
| | | String copy_name1 = copy_names[j]; |
| | | if (copy_name1.length() > 0) { |
| | | copy_id = Integer.parseInt(copy_name1); |
| | | uinf.setuId(copy_id); |
| | | } |
| | | copy_name += ","; |
| | | List<User_inf> user_infs2 = userInfMapper.serchUname(uinf); |
| | | if (user_infs2.size() > 0) { |
| | | copy_name += user_infs2.get(0).getuName(); |
| | | } |
| | | } |
| | | } |
| | | binf.setStationName9(copy_name.substring(1, copy_name.length())); |
| | | //System.out.println(binf.getStationName9()); |