Pārlūkot izejas kodu

干部培训记录管理

lizeyu 7 mēneši atpakaļ
vecāks
revīzija
ebdd73effc

+ 1 - 1
src/main/java/com/ghsc/partybuild/mapper/PartyUserCQuery.java

@@ -56,7 +56,7 @@ public interface PartyUserCQuery {
             , @Param("zzfbType") Integer zzfbType,
                                                       @Param("mz") String mz, @Param("dnzw") String dnzw, @Param("xl") String xl, @Param("age_begin") Integer age_begin, @Param("age_end") Integer age_end,
                                                       @Param("sfsldry") Integer sfsldry, @Param("zwmc") String zwmc, @Param("sfzg") Integer sfzg,
-                                                      @Param("jczzfl") String jczzfl, @Param("islead") Boolean islead, @Param("partyGroupId") String partyGroupId, @Param("mobile") String mobile,@Param("isStudent")Integer isStudent,@Param("leaderTeamUserType") Integer leaderTeamUserType);
+                                                      @Param("jczzfl") String jczzfl, @Param("islead") Boolean islead, @Param("partyGroupId") String partyGroupId, @Param("mobile") String mobile, @Param("sfzh") String sfzh,@Param("isStudent")Integer isStudent,@Param("leaderTeamUserType") Integer leaderTeamUserType);
 
     /**
      * 所有党员信息

+ 8 - 0
src/main/java/com/ghsc/partybuild/service/PartyUserService.java

@@ -66,6 +66,14 @@ public interface PartyUserService {
      */
     HashMap<String, Object> getPartyUserInfoByRybm(String rybm);
 
+    /**
+     * 党员信息(预备党员、正式党员)
+     * @param name
+     * @param sfzh
+     * @return
+     */
+    HashMap<String, Object> getPartyUserInfoByNameAndSfzh(String name, String sfzh);
+
     /**
      * 党员信息(包含入党申请人)
      * @param rybm

+ 1 - 1
src/main/java/com/ghsc/partybuild/service/PxTrainingRecordService.java

@@ -17,5 +17,5 @@ public interface PxTrainingRecordService {
 
     int delete(List<String> leaderTeamIdList);
 
-    List<PxTrainingRecordVo> importPxTrainingRecord(List<PxTrainingRecordVo> dataList, String userId);
+    List<PxTrainingRecordVo> importPxTrainingRecord(List<PxTrainingRecordVo> dataList, String userId) throws Exception;
 }

+ 16 - 2
src/main/java/com/ghsc/partybuild/service/impl/PartyUserServiceImpl.java

@@ -88,7 +88,7 @@ public class PartyUserServiceImpl implements PartyUserService {
 
         PageHelper.startPage(pageNum, pageSize);
 
-        List<HashMap<String, Object>> list = partyUserCquery.selectPartyUserList(dzzdm, rybm, xb, xm, zzlb, zwjb, sqrdrq_begin, sqrdrq_end, szdzb, szdxz, userIdList, ryztList, removeUserList, szdzbdm, removeUsersOfRybmList, rybmList, zzfbType, mz, dnzw, xl, age_begin, age_end, sfsldry, zwmc, sfzg, jczzfl, null, partyGroupId, mobile,isStudent,leaderTeamUserType);
+        List<HashMap<String, Object>> list = partyUserCquery.selectPartyUserList(dzzdm, rybm, xb, xm, zzlb, zwjb, sqrdrq_begin, sqrdrq_end, szdzb, szdxz, userIdList, ryztList, removeUserList, szdzbdm, removeUsersOfRybmList, rybmList, zzfbType, mz, dnzw, xl, age_begin, age_end, sfsldry, zwmc, sfzg, jczzfl, null, partyGroupId, mobile, null,isStudent,leaderTeamUserType);
 
         list.forEach(it -> {
             it.put("isAdmin", isAdmin);
@@ -129,7 +129,21 @@ public class PartyUserServiceImpl implements PartyUserService {
         if (!stringUtils.IsNullOrEmpty(rybm)) {
             PageHelper.startPage(1, 1);
             List<HashMap<String, Object>> list = partyUserCquery.selectPartyUserList(null, rybm, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
-                    null, null, null, null, null, null, null, null, null, true, null, null,null,null);
+                    null, null, null, null, null, null, null, null, null, true, null, null,null,null,null);
+            if (list.size() > 0) {
+                result = list.get(0);
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public HashMap<String, Object> getPartyUserInfoByNameAndSfzh(String name, String sfzh) {
+        HashMap<String, Object> result = new HashMap<>();
+        if (!stringUtils.IsNullOrEmpty(name) && !stringUtils.IsNullOrEmpty(sfzh)) {
+            PageHelper.startPage(1, 1);
+            List<HashMap<String, Object>> list = partyUserCquery.selectPartyUserList(null, null, null, name, null, null, null, null, null, null, null, null, null, null, null, null, null,
+                    null, null, null, null, null, null, null, null, null, true, null, null,sfzh,null,null);
             if (list.size() > 0) {
                 result = list.get(0);
             }

+ 98 - 121
src/main/java/com/ghsc/partybuild/service/impl/train/PxTrainingRecordServiceImpl.java

@@ -4,6 +4,7 @@ import com.ghsc.partybuild.mapper.PxTrainingRecordCQuery;
 import com.ghsc.partybuild.mapper.PxTrainingRecordMapper;
 import com.ghsc.partybuild.model.*;
 import com.ghsc.partybuild.service.DictionaryService;
+import com.ghsc.partybuild.service.PartyUserService;
 import com.ghsc.partybuild.service.PxTrainingRecordService;
 import com.ghsc.partybuild.util.DateUtils;
 import com.ghsc.partybuild.util.StringUtils;
@@ -14,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service("PxTrainingRecordService")
 public class PxTrainingRecordServiceImpl implements PxTrainingRecordService {
@@ -25,6 +27,8 @@ public class PxTrainingRecordServiceImpl implements PxTrainingRecordService {
     @Autowired
     private DictionaryService dictionaryService;
     @Autowired
+    private PartyUserService partyUserService;
+    @Autowired
     private StringUtils stringUtils;
     @Autowired
     private DateUtils dateUtils;
@@ -125,127 +129,100 @@ public class PxTrainingRecordServiceImpl implements PxTrainingRecordService {
         return pxTrainingRecordMapper.deleteByExample(exp);
     }
 
-    @Override
-    public List<PxTrainingRecordVo> importPxTrainingRecord(List<PxTrainingRecordVo> dataList, String userId) {
-        return null;
-    }
 
-//
-//    public List<LeaderTeamVo> importLeaderTeam(int leaderTeamType, List<LeaderTeamVo> dataList, String userID) throws Exception {
-//        if (dataList.size() <= 0) {
-//            throw new Exception("请添加导入数据");
-//        }
-//        List<LeaderTeamVo> errorList = new ArrayList<>();
-//        List<LwLeaderteam> resultList = new ArrayList<>();
-//
-//        List<String> nameList = dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.getName())).map(it -> it.getName().trim()).collect(Collectors.toList());
-//
-//        List<CfDictionary> qualificationTypeList =  dictionaryService.getDictionaryListByDicTypeKey("QualificationType");
-//        List<CfDictionary> professionalTypeList =  dictionaryService.getDictionaryListByDicTypeKey("ProfessionalType");
-//        List<CfDictionary> educationTypeList =  dictionaryService.getDictionaryListByDicTypeKey("EducationType");
-//        List<CfDictionary> dicSexList =  dictionaryService.getDictionaryListByDicTypeKey("dic_sex");
-//        List<HashMap<String, Object>> nationList = partyDicService.getNationList();
-//
-//        List<LwLeaderteam> dbLwLeaderteamList = getLeaderteamList(nameList, leaderTeamType);
-//
-//        if (nameList.stream().distinct().count() != nameList.size()) {
-//            throw new Exception("导入数据存在相同姓名,请修改后重新导入!");
-//        }
-//
-//        for (int i = 0; i < dataList.size(); i++) {
-//            LeaderTeamVo item = dataList.get(i);
-//
-//            LwLeaderteam lwLeaderteam = dbLwLeaderteamList.stream().filter(it -> it.getName().equals(item.getName())).findFirst().orElse(new LwLeaderteam());
-//
-//            String errorInfo = "";
-//            Date birthDate = dateUtils.strToDateExt(item.getBirthdatestr());
-//            Date joinDate = dateUtils.strToDateExt(item.getJoindatestr());
-//            Date workDate = dateUtils.strToDateExt(item.getWorkdatestr());
-//            Date engageDate = dateUtils.strToDateExt(item.getEngagedatestr());
-//            Date nowPositionDate = dateUtils.strToDateExt(item.getNowpositiondatestr());
-//            Date samePositionDate = dateUtils.strToDateExt(item.getSamepositiondatestr());
-//
-//            item.setSex(dictionaryService.getDickeyByName(item.getSexname(), dicSexList));
-//            item.setEducationtype(dictionaryService.getDickeyByName(item.getEducationname(), educationTypeList));
-//            item.setQualificationtype(dictionaryService.getDickeyByName(item.getQualificationname(), qualificationTypeList));
-//            item.setProfessionaltype(dictionaryService.getDickeyByName(item.getProfessionalname(), professionalTypeList));
-//            if(!stringUtils.IsNullOrEmpty(item.getBirthplacename())){
-//                HashMap<String, Object> nationMap = nationList.stream().filter(x->stringUtils.valueOf(x.get("HZMC")).equals(item.getBirthplacename())).findFirst().orElse(null);
-//                item.setBirthplace(nationMap != null ? stringUtils.valueOf(nationMap.get("BM")) : "");
-//            }
-//
-//            if (stringUtils.IsNullOrEmpty(item.getName()))
-//                errorInfo += "请填写姓名!";
-//            if (stringUtils.IsNullOrEmpty(item.getDepartmentname()))
-//                errorInfo += "请填写机构!";
-//            if (stringUtils.IsNullOrEmpty(item.getPosition()))
-//                errorInfo += "请填写部门职务!";
-//            if(item.getSex() == null)
-//                errorInfo += "请根据单元格下拉选项选择性别!";
-//            if(item.getBirthplace() == null)
-//                errorInfo += "请根据单元格下拉选项选择民族!";
-//            if (stringUtils.IsNullOrEmpty(item.getNativeplace()))
-//                errorInfo += "请填写籍贯!";
-//            if (!stringUtils.IsNullOrEmpty(item.getBirthdatestr()) && birthDate == null)
-//                errorInfo += "出生年月格式错误!";
-//            if (!stringUtils.IsNullOrEmpty(item.getWorkdatestr()) && workDate == null)
-//                errorInfo += "参加工作时间格式错误!";
-//            if(item.getEducationtype() == null)
-//                errorInfo += "请根据单元格下拉选项选择学历!";
-//            if (stringUtils.IsNullOrEmpty(item.getParty()))
-//                errorInfo += "请填写党派!";
-//            if (!stringUtils.IsNullOrEmpty(item.getJoindatestr()) && joinDate == null)
-//                errorInfo += "加入时间格式错误!";
-//            if(item.getQualificationtype() == null)
-//                errorInfo += "请根据单元格下拉选项选择学位!";
-//            if (stringUtils.IsNullOrEmpty(item.getGraduationschoolmajor()))
-//                errorInfo += "请填写专业!";
-//            if (!stringUtils.IsNullOrEmpty(item.getNowpositiondatestr()) && nowPositionDate == null)
-//                errorInfo += "任行政现职时间格式错误!";
-//
-//            if (stringUtils.IsNullOrEmpty(errorInfo)) {
-//                lwLeaderteam.setName(item.getName());
-//                lwLeaderteam.setDepartmentname(item.getDepartmentname());
-//                lwLeaderteam.setPosition(item.getPosition());
-//                lwLeaderteam.setSex(item.getSex());
-//                lwLeaderteam.setBirthplace(item.getBirthplace());
-//                lwLeaderteam.setNativeplace(item.getNativeplace());
-//                lwLeaderteam.setBirthdate(birthDate);
-//                lwLeaderteam.setWorkdate(workDate);
-//                lwLeaderteam.setEducationtype(item.getEducationtype());
-//                lwLeaderteam.setParty(item.getParty());
-//                lwLeaderteam.setJoindate(joinDate);
-//                lwLeaderteam.setQualificationtype(item.getQualificationtype());
-//                lwLeaderteam.setGraduationschoolmajor(item.getGraduationschoolmajor());
-//                lwLeaderteam.setProfessionaltype(item.getProfessionaltype());
-//                lwLeaderteam.setEngagedate(engageDate);
-//                lwLeaderteam.setNowpositiondate(nowPositionDate);
-//                lwLeaderteam.setSamepositiondate(samePositionDate);
-//                lwLeaderteam.setWorkexperience(item.getWorkexperience());
-//                resultList.add(lwLeaderteam);
-//            } else {
-//                item.setErrorInfo("第" + (i + 1) + "行," + errorInfo);
-//                errorList.add(item);
-//            }
-//        }
-//
-//        if (errorList.size() <= 0) {
-//            resultList.forEach(item -> {
-//                if (dbLwLeaderteamList.stream().filter(it -> it.getName().equals(item.getName())).count() == 0) {
-//                    item.setLeaderteamid(UUID.randomUUID().toString());
-//                    item.setLeaderteamtype(leaderTeamType);
-//                    item.setCreateuserid(userID);
-//                    item.setCreatetime(new Date());
-//                    leaderteamMapper.insert(item);
-//                } else {
-//                    item.setUpdateuserid(userID);
-//                    item.setUpdatetime(new Date());
-//                    leaderteamMapper.updateByPrimaryKeyWithBLOBs(item);
-//                }
-//            });
-//        }
-//
-//        return errorList;
-//    }
+    public List<PxTrainingRecordVo> importPxTrainingRecord(List<PxTrainingRecordVo> dataList, String userID) throws Exception {
+
+            if (dataList.size() <= 0) {
+                throw new Exception("请添加导入数据");
+            }
+
+            List<String> nameList = dataList.stream().filter(it -> !stringUtils.IsNullOrEmpty(it.getName())).map(it -> it.getName().trim()).collect(Collectors.toList());
+
+            List<PxTrainingRecord> resultList = new ArrayList<>();
+        List<PxTrainingRecordVo> errorList = new ArrayList<>();
+            List<CfDictionary> pxdxlxTypeList =  dictionaryService.getDictionaryListByDicTypeKey("pxdxlxType");
+            List<CfDictionary> pxxsTypeList =  dictionaryService.getDictionaryListByDicTypeKey("pxxsType");
+            List<CfDictionary> dicSexList =  dictionaryService.getDictionaryListByDicTypeKey("dic_sex");
+
+            if (nameList.stream().distinct().count() != nameList.size()) {
+                throw new Exception("导入数据存在相同姓名,请修改后重新导入!");
+            }
+
+            for (int i = 0; i < dataList.size(); i++) {
+                PxTrainingRecordVo item = dataList.get(i);
+                PxTrainingRecord model = new PxTrainingRecord();
+
+                String errorInfo = "";
+                item.setXxkssj(dateUtils.strToDateExt(item.getXxkssjstr()));
+                item.setXxjssj(dateUtils.strToDateExt(item.getXxjssjstr()));
+                item.setGender(dictionaryService.getDickeyByName(item.getGendername(), dicSexList));
+                item.setPxdxlx(dictionaryService.getDickeyByName(item.getPxdxlxtypename(), pxdxlxTypeList));
+                item.setPxxs(dictionaryService.getDickeyByName(item.getPxxstypename(), pxxsTypeList));
+
+                if (item.getPxdxlx() == null)
+                    errorInfo += "请根据单元格下拉选项选择培训对象类型!";
+                if (stringUtils.IsNullOrEmpty(item.getName()))
+                    errorInfo += "请填写姓名!";
+                if (item.getGender() == null)
+                    errorInfo += "请根据单元格下拉选项选择性别!";
+                if (stringUtils.IsNullOrEmpty(item.getSfzh()))
+                    errorInfo += "请填身份证号!";
+                if (stringUtils.IsNullOrEmpty(item.getGzbm()))
+                    errorInfo += "请填写工作部门!";
+                if (stringUtils.IsNullOrEmpty(item.getZw()))
+                    errorInfo += "请填写职务!";
+                if (stringUtils.IsNullOrEmpty(item.getPxxmmc()))
+                    errorInfo += "请填写培训项目名称!";
+                if(item.getPxxs() == null)
+                    errorInfo += "请根据单元格下拉选项选择培训形式!";
+                if(item.getXss() == null)
+                    errorInfo += "请填写学时数!";
+                if (!stringUtils.IsNullOrEmpty(item.getXxkssjstr()) && item.getXxkssj() == null)
+                    errorInfo += "学习开始时间格式错误!";
+                if (!stringUtils.IsNullOrEmpty(item.getXxjssjstr()) && item.getXxjssj() == null)
+                    errorInfo += "学习结束时间格式错误!";
+
+                if (stringUtils.IsNullOrEmpty(errorInfo)) {
+                    HashMap<String, Object> userInfo = partyUserService.getPartyUserInfoByNameAndSfzh(item.getName(), item.getSfzh());
+                    if(userInfo.size()>0){
+                        item.setRybm(stringUtils.valueOf(userInfo.get("RYBM")));
+//                        item.setZw(stringUtils.valueOf(userInfo.get("ZWMC")));
+//                        String genderStr = stringUtils.valueOf(userInfo.get("XB"));
+//                        item.setGender(genderStr.length() > 0 ? Integer.parseInt(genderStr) : 0);
+                    }
+                    model.setPxdxlx(item.getPxdxlx());
+                    model.setName(item.getName());
+                    model.setGender(item.getGender());
+                    model.setSfzh(item.getSfzh());
+                    model.setGzbm(item.getGzbm());
+                    model.setZw(item.getZw());
+                    model.setPxxmmc(item.getPxxmmc());
+                    model.setPxxs(item.getPxxs());
+                    model.setXss(item.getXss());
+                    model.setXxkssj(item.getXxkssj());
+                    model.setXxjssj(item.getXxjssj());
+                    model.setKhqk(item.getKhqk());
+                    model.setSsjgmc(item.getSsjgmc());
+                    model.setXxdd(item.getXxdd());
+                    model.setXxnr(item.getXxnr());
+                    model.setRemark(item.getRemark());
+                    resultList.add(model);
+                } else {
+                    item.setErrorInfo("第" + (i + 1) + "行," + errorInfo);
+                    errorList.add(item);
+                }
+            }
+
+            if (errorList.size() <= 0) {
+                resultList.forEach(item -> {
+                    item.setId(UUID.randomUUID().toString());
+                    item.setCreateUserid(userID);
+                    item.setCreateTime(new Date());
+                    pxTrainingRecordMapper.insert(item);
+                });
+            }
+
+            return errorList;
+    }
 
 }

+ 3 - 0
src/main/java/com/ghsc/partybuild/vo/trian/PxTrainingRecordVo.java

@@ -10,4 +10,7 @@ public class PxTrainingRecordVo extends PxTrainingRecord {
     public String gendername;
     public String pxdxlxtypename;
     public String pxxstypename;
+    public String xxkssjstr;
+    public String xxjssjstr;
+    public String errorInfo;
 }

+ 3 - 0
src/main/resources/mapping/PartyUserCQuery.xml

@@ -144,6 +144,9 @@
         <if test="mobile != null and mobile != ''">
             and userinfo.USERNAME like concat('%',#{mobile},'%')
         </if>
+        <if test="sfzh != null and sfzh != ''">
+            and us.sfzh like concat('%',#{sfzh},'%')
+        </if>
         <if test="isStudent != null and isStudent==1">
             and usfb.isStudent = #{isStudent}
         </if>

+ 1 - 1
src/main/resources/mapping/PxTrainingRecordCQuery.xml

@@ -30,7 +30,7 @@
     </resultMap>
     <select id="selectPxTrainingRecordList" resultMap="BaseResultMap">
         select ptr.id, ptr.rybm, ptr.name, ptr.pxdxlx, ptr.gender, ptr.sfzh, ptr.gzbm, ptr.zw, ptr.pxxmmc,
-                ptr.pxxs, ptr.xxkssj, ptr.xxjssj, ptr.cxts, ptr.xss, ptr.khqk, ptr.ssjgmc, ptr.xxdd, ptr.xxnr,
+                ptr.pxxs, ptr.xxkssj, ptr.xxjssj, DATEDIFF(ptr.xxjssj, ptr.xxkssj) as cxts, ptr.xss, ptr.khqk, ptr.ssjgmc, ptr.xxdd, ptr.xxnr,
                 ptr.remark, ptr.create_time, ptr.create_userid, ptr.update_time, ptr.update_userid,
                 zz.dzzmc, zz.dzzdm
         from px_training_record ptr

+ 17 - 17
src/main/resources/static/app/main/controllers.js

@@ -493,23 +493,23 @@
         return reslut;
     }]).directive('activateSelect', ['$timeout', function ($timeout) {
 
-        var activateFun = function (scope, $element) {
-            var _this = $element;
-
-            /* if ($.fn.selectpicker) {
-                 $('select:not(.ms)').selectpicker();
-             }*/
-
-
-            $.each($element.find("select"), function (i, node) {
-
-                scope.$watch(function () {
-                    return node.childNodes.length;
-                }, function (newVal, oldVal) {
-                    $(node).selectpicker('refresh');
-                });
-            });
-        };
+        // var activateFun = function (scope, $element) {
+        //     var _this = $element;
+        //
+        //     /* if ($.fn.selectpicker) {
+        //          $('select:not(.ms)').selectpicker();
+        //      }*/
+        //
+        //
+        //     $.each($element.find("select"), function (i, node) {
+        //
+        //         scope.$watch(function () {
+        //             return node.childNodes.length;
+        //         }, function (newVal, oldVal) {
+        //             $(node).selectpicker('refresh');
+        //         });
+        //     });
+        // };
 
         var directiveObject = {
             restrict: 'AC',

+ 1 - 1
src/main/resources/static/app/main/leaderwork/leaderteam/edit.html

@@ -34,7 +34,7 @@
                             </tr>
                             <tr>
                                 <th>性别<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.sex.position.$invalid &&  this.editForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.editForm.sex.$invalid &&  this.editForm.$submitted}">
                                     <select class="form-control show-tick" ng-model="dataModel.sex"
                                             ng-options="type.dickey as type.dicvalue for type in sexList"
                                             class="form-control" ng-required="true" name="sex">

+ 57 - 69
src/main/resources/static/app/main/train/trainingRecord/edit.html

@@ -2,148 +2,136 @@
 <div class="dj-card">
     <div class="dj-body" activate-input activate-select>
         <div class="card">
-            <form class="form-horizontal" role="form" id="trainingRecordEditForm"
-                      name="trainingRecordEditForm" ng-submit="save(trainingRecordEditForm.$valid)" novalidate>
+            <form class="form-horizontal" role="form" id="trainingRecordForm"
+                      name="trainingRecordForm" ng-submit="save(trainingRecordForm.$valid)" novalidate>
                     <div class="dj-formtable">
                         <table class="dj-table dj-table3">
                             <tr>
-<!--                                <th>培训对象类型<span style="color: red">*</span></th>-->
-<!--                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.pxdxlx.$invalid &&  this.trainingRecordEditForm.$submitted}">-->
-<!--                                    <select class="form-control show-tick" ng-model="dataModel.pxdxlx"-->
-<!--                                            ng-options="type.dickey as type.dicvalue for type in pxdxlxTypeList"-->
-<!--                                            class="form-control" ng-required="true" name="pxdxlx">-->
-<!--                                        <option value="" selected>&#45;&#45;请选择&#45;&#45;</option>-->
-<!--                                    </select>-->
-<!--                                    <span ng-show="this.trainingRecordEditForm.pxdxlx.$invalid &&  this.trainingRecordEditForm.$submitted"-->
-<!--                                          class="error">必填.</span>-->
-<!--                                </td>-->
+                                <th>培训对象类型<span style="color: red">*</span></th>
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.pxdxlx.$invalid &&  this.trainingRecordForm.$submitted}">
+                                    <select class="form-control show-tick" ng-model="dataModel.pxdxlx"
+                                            ng-options="type.dickey as type.dicvalue for type in pxdxlxTypeList"
+                                            class="form-control" ng-required="true" name="pxdxlx">
+                                        <option value="" selected>--请选择--</option>
+                                    </select>
+                                    <span ng-show="this.trainingRecordForm.pxdxlx.$invalid &&  this.trainingRecordForm.$submitted"
+                                          class="error">必填.</span>
+                                </td>
                                 <th>姓名<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.name.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.name.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <div class="input-group input-group-search">
                                         <input name="name" type="text" ng-model="dataModel.name"
                                                class="form-control" ng-required="true" ng-disabled="nameDisabled"/>
-                                        <span class="input-group-addon" data-dataoptions="selectUserlist" title="选择成员" bsselectdata-pro ng-click="nameDisabled=true">
+                                        <span class="input-group-addon" data-dataoptions="selectUserlist" title="选择成员" bsselectdata-pro>
                                             <i class="material-icons small">search</i>
                                         </span>
-                                        <span class="input-group-addon" ng-click="nameDisabled=false;dataModel.name='';dataModel.rybm='';$event.stopPropagation();">
+                                        <span class="input-group-addon" ng-click="clearName();$event.stopPropagation();">
                                             <i class="material-icons small">clear</i>
                                         </span>
                                     </div>
-                                    <span ng-show="this.trainingRecordEditForm.name.$invalid &&  this.trainingRecordEditForm.$submitted" class="error">必填.</span>
+                                    <span ng-show="this.trainingRecordForm.name.$invalid &&  this.trainingRecordForm.$submitted" class="error">必填.</span>
                                 </td>
                                 <th>性别<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.gender.$invalid &&  this.trainingRecordEditForm.$submitted}">
-                                    <select class="form-control show-tick" ng-model="dataModel.gender"
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.gender.$invalid &&  this.trainingRecordForm.$submitted}">
+                                    <select class="form-control show-tick" id="trainingRecordFormGender" ng-model="dataModel.gender"
                                             ng-options="type.dickey as type.dicvalue for type in sexList"
-                                            class="form-control" ng-required="true" name="gender">
+                                            class="form-control" name="gender">
                                         <option value="" selected>--请选择--</option>
                                     </select>
-                                    <span ng-show="this.trainingRecordEditForm.gender.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.gender.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                             </tr>
                             <tr>
                                 <th>身份证号<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.sfzh.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.sfzh.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input type="text" class="form-control" name="sfzh"
                                            autocomplete="off" autoclose="true" maxlength="18"
                                            ng-model="dataModel.sfzh" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.sfzh.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.sfzh.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                                 <th>工作部门<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.gzbm.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.gzbm.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input type="text" class="form-control" name="gzbm"
                                            autocomplete="off" autoclose="true"
                                            ng-model="dataModel.gzbm" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.gzbm.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.gzbm.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                                 <th>职务<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.zw.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.zw.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input type="text" class="form-control" name="zw"
                                            autocomplete="off" autoclose="true"
                                            ng-model="dataModel.zw" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.zw.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.zw.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                             </tr>
                             <tr>
                                 <th>培训项目名称<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.pxxmmc.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.pxxmmc.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input type="text" class="form-control" name="pxxmmc"
                                            autocomplete="off" autoclose="true"
                                            ng-model="dataModel.pxxmmc" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.pxxmmc.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.pxxmmc.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
-<!--                                <th>培训形式<span style="color: red">*</span></th>-->
-<!--                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.pxxs.$invalid &&  this.trainingRecordEditForm.$submitted}">-->
-<!--                                    <select class="form-control show-tick" ng-model="dataModel.pxxs"-->
-<!--                                            ng-options="type.dickey as type.dicvalue for type in pxxsTypeList"-->
-<!--                                            class="form-control" ng-required="true" name="pxxs">-->
-<!--                                        <option value="" selected>&#45;&#45;请选择&#45;&#45;</option>-->
-<!--                                    </select>-->
-<!--                                    <span ng-show="this.trainingRecordEditForm.pxxs.$invalid &&  this.trainingRecordEditForm.$submitted"-->
-<!--                                          class="error">必填.</span>-->
-<!--                                </td>-->
-                                <th>参训天数<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.cxts.$invalid &&  this.trainingRecordEditForm.$submitted}">
-                                    <input type="number" class="form-control" name="cxts"
+                                <th>培训形式<span style="color: red">*</span></th>
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.pxxs.$invalid &&  this.trainingRecordForm.$submitted}">
+                                    <select class="form-control show-tick" ng-model="dataModel.pxxs"
+                                            ng-options="type.dickey as type.dicvalue for type in pxxsTypeList"
+                                            class="form-control" ng-required="true" name="pxxs">
+                                        <option value="" selected>--请选择--</option>
+                                    </select>
+                                    <span ng-show="this.trainingRecordForm.pxxs.$invalid &&  this.trainingRecordForm.$submitted"
+                                          class="error">必填.</span>
+                                </td>
+                                <th>学时数<span style="color: red">*</span></th>
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.xss.$invalid &&  this.trainingRecordForm.$submitted}">
+                                    <input type="number" class="form-control" name="xss"
                                            autocomplete="off" autoclose="true" min="0" step="1"
-                                           ng-model="dataModel.cxts" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.cxts.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                           ng-model="dataModel.xss" ng-required="true"/>
+                                    <span ng-show="this.trainingRecordForm.xss.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                             </tr>
                             <tr>
                                 <th>学习开始时间<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.xxkssj.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.xxkssj.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input name="xxkssj" class="form-control"
                                            autocomplete="off"
                                            autoclose="true" ng-required="true"
                                            data-date-format="yyyy-MM-dd" data-date-type="date"
                                            ng-model="dataModel.xxkssj"
                                            placeholder="" bs-datepicker/>
-                                    <span ng-show="this.trainingRecordEditForm.xxkssj.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.xxkssj.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
                                 <th>学习结束时间<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.xxjssj.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <td ng-class="{ 'has-error' : this.trainingRecordForm.xxjssj.$invalid &&  this.trainingRecordForm.$submitted}">
                                     <input name="xxjssj" class="form-control"
-                                           autocomplete="off"
+                                           autocomplete="off" data-min-date="{{dataModel.xxkssj}}"
                                            autoclose="true" ng-required="true"
                                            data-date-format="yyyy-MM-dd" data-date-type="date"
                                            ng-model="dataModel.xxjssj"
                                            placeholder="" bs-datepicker/>
-                                    <span ng-show="this.trainingRecordEditForm.xxjssj.$invalid &&  this.trainingRecordEditForm.$submitted"
-                                          class="error">必填.</span>
-                                </td>
-                                <th>学时数<span style="color: red">*</span></th>
-                                <td ng-class="{ 'has-error' : this.trainingRecordEditForm.xss.$invalid &&  this.trainingRecordEditForm.$submitted}">
-                                    <input type="number" class="form-control" name="xss"
-                                           autocomplete="off" autoclose="true" min="0" step="1"
-                                           ng-model="dataModel.xss" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.xss.$invalid &&  this.trainingRecordEditForm.$submitted"
+                                    <span ng-show="this.trainingRecordForm.xxjssj.$invalid &&  this.trainingRecordForm.$submitted"
                                           class="error">必填.</span>
                                 </td>
+                                <th>参训天数<span style="color: red">*</span></th>
+                                <td>{{interval()}}</td>
                             </tr>
                             <tr>
-                                <th>考核情况<span style="color: red">*</span></th>
-                                <td colspan="2" ng-class="{ 'has-error' : this.trainingRecordEditForm.khqk.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <th>考核情况</th>
+                                <td colspan="2">
                                     <input type="text" class="form-control" name="khqk"
-                                           autocomplete="off" autoclose="true"
-                                           ng-model="dataModel.khqk" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.khqk.$invalid &&  this.trainingRecordEditForm.$submitted"
-                                          class="error">必填.</span>
+                                           autocomplete="off" autoclose="true" ng-model="dataModel.khqk"/>
                                 </td>
-                                <th>实施机构名称<span style="color: red">*</span></th>
-                                <td colspan="2" ng-class="{ 'has-error' : this.trainingRecordEditForm.ssjgmc.$invalid &&  this.trainingRecordEditForm.$submitted}">
+                                <th>实施机构名称</th>
+                                <td colspan="2">
                                     <input type="text" class="form-control" name="ssjgmc"
-                                           autocomplete="off" autoclose="true"
-                                           ng-model="dataModel.ssjgmc" ng-required="true"/>
-                                    <span ng-show="this.trainingRecordEditForm.ssjgmc.$invalid &&  this.trainingRecordEditForm.$submitted"
-                                          class="error">必填.</span>
+                                           autocomplete="off" autoclose="true" ng-model="dataModel.ssjgmc"/>
                                 </td>
                             </tr>
                             <tr>
@@ -168,7 +156,7 @@
                     </div>
                     <div class="form_foot">
                         <button type="button" class="btn btn-default" ng-click="pagechange()">取消</button>
-                        <button type="submit" class="btn btn-primary" form="trainingRecordEditForm">保存</button>
+                        <button type="submit" class="btn btn-primary" form="trainingRecordForm">保存</button>
                     </div>
                 </form>
         </div>

+ 26 - 9
src/main/resources/static/app/main/train/trainingRecord/edit.js

@@ -5,7 +5,7 @@
         $scope.sexList = [];
         $scope.pxxsTypeList = [];
         $scope.pxdxlxTypeList = [];
-        $scope.nameDisabled = false;//
+        $scope.nameDisabled = true;//默认禁用姓名文本框
 
         $scope.selectUserlist = {
             url: '../../api/partyUser/getPartyUserList',
@@ -23,15 +23,12 @@
                 removeUserRybm: ''
             },
             onSelect: function (value, item) {
-                // $scope.dataModel.sfzh = item.SFZH ? item.SFZH : '';
-                // $scope.dataModel.gender = item.XB ? parseInt(item.XB) : '';
-                // $scope.dataModel.name = item.XM;
-                // $scope.dataModel.rybm = item.RYBM;
-                // $scope.dataModel.zw = item.ZWMC ? item.ZWMC : '';
+                $scope.dataModel.sfzh = item.SFZH ? item.SFZH : '';
+                $scope.dataModel.gender = item.XB ? parseInt(item.XB) : '';
                 $scope.dataModel.name = item.XM;
-                $scope.dataModel.gender = 1;
-                            console.log(item);
-                            console.log($scope.dataModel);
+                $scope.dataModel.rybm = item.RYBM;
+                $scope.dataModel.zw = item.ZWMC ? item.ZWMC : '';
+                $scope.nameDisabled = true;
             }
         };
         // $scope.$watch('selectUserlist.selectedValueData', function (newVal) {
@@ -62,6 +59,23 @@
         //     }
         // });
 
+        $scope.clearName = function () {
+            $scope.nameDisabled = false;
+            $scope.dataModel.name = '';
+            $scope.dataModel.rybm = '';
+            $scope.dataModel.sfzh = '';
+            $scope.dataModel.gender = '';
+            $scope.dataModel.name = '';
+            $scope.dataModel.rybm = '';
+            $scope.dataModel.zw = '';
+        }
+
+        $scope.interval =function () {
+            if($scope.dataModel.xxjssj && $scope.dataModel.xxkssj){
+                return moment($scope.dataModel.xxjssj).diff($scope.dataModel.xxkssj,'day');
+            }
+        }
+
         $scope.getData = function () {
             $http
             ({
@@ -71,6 +85,9 @@
                 }
             }).then(function (result) {
                 $scope.dataModel = result.data.item;
+                if(!$scope.dataModel.name){
+                    $scope.nameDisabled = false;
+                }
                 $scope.getSexList();
                 $scope.getPxxsTypeList();
                 $scope.getPxdxlxTypeList();

+ 19 - 21
src/main/resources/static/app/main/train/trainingRecord/list.js

@@ -80,30 +80,28 @@
         $scope.excelConfig = {
             filetype: 1,
             columns: {
+                '培训对象类型': 'pxdxlxtypename',
                 '姓名': 'name',
-                '机构': 'departmentname',
-                '部门职务': 'position',
-                '性别': 'sexname',
-                '民族': 'birthplacename',
-                '籍贯': 'nativeplace',
-                '出生年月': 'birthdatestr',
-                '参加工作时间': 'workdatestr',
-                '学历': 'educationname',
-                '党派': 'party',
-                '加入时间': 'joindatestr',
-                '学位': 'qualificationname',
-                '专业': 'graduationschoolmajor',
-                '专业技术职务': 'professionalname',
-                '专业技术职务聘任时间': 'engagedatestr',
-                '任行政现职时间': 'nowpositiondatestr',
-                '任行政同职级时间': 'samepositiondatestr',
-                '相关管理工作经历': 'workexperience'
+                '性别': 'gendername',
+                '身份证号': 'sfzh',
+                '工作部门': 'gzbm',
+                '职务': 'zw',
+                '培训项目名称': 'pxxmmc',
+                '培训形式': 'pxxstypename',
+                '学时数': 'xss',
+                '学习开始时间': 'xxkssjstr',
+                '学习结束时间': 'xxjssjstr',
+                '考核情况': 'khqk',
+                '实施机构名称': 'ssjgmc',
+                '学习地点': 'xxdd',
+                '学习内容': 'xxnr',
+                '备注': 'remark'
             },
             errorcolumns: {
-                'departmentname': '机构',
-                'position': '职务',
+                'pxdxlxtypename': '培训对象类型',
                 'name': '姓名',
-                'party': '党派',
+                'name': '工作部门',
+                'gzbm': '培训项目名称',
                 'errorInfo': '错误信息'
             },
             readonly: false,
@@ -145,7 +143,7 @@
             if (id)
                 ids.push(id);
             else
-                ids = $scope.dataList.filter(it => it.rowChecked == true).map(it => it.leaderteamid);
+                ids = $scope.dataList.filter(it => it.rowChecked == true).map(it => it.id);
 
             if (ids.length == 0) {
                 $scope.showMsg('消息', "请选择需要删除的数据");

BIN
src/main/resources/static/doc/template/干部培训记录导入模板.xlsx