Преглед на файлове

feat: 主题党日信息增加出席人员

zhangying преди 2 седмици
родител
ревизия
723763dc65

+ 6 - 5
src/main/java/com/ghsc/partybuild/controller/PartyTwoController.java

@@ -393,16 +393,17 @@ public class PartyTwoController {
 
     @ResponseBody
     @RequestMapping("/getZtdrxx")
-    public RequsetData<DjZtdrxx> getZtdrxx(@RequestParam("id") String id, @RequestParam("dzzdm") String dzzdm, @RequestParam("dzzmc") String dzzmc) {
-        RequsetData<DjZtdrxx> res = new RequsetData<>();
+    public RequsetData<DjZtdrxxVo> getZtdrxx(@RequestParam("id") String id, @RequestParam("dzzdm") String dzzdm, @RequestParam("dzzmc") String dzzmc) {
+        RequsetData<DjZtdrxxVo> res = new RequsetData<>();
 
-        DjZtdrxx model = partyTwoService.getZtdrxx(id);
+        DjZtdrxxVo model = partyTwoService.getZtdrxx(id);
         if (model == null) {
             UUID uuid = UUID.randomUUID();
-            model = new DjZtdrxx();
+            model = new DjZtdrxxVo();
             model.setId(uuid.toString());
             model.setDzzdm(dzzdm);
             model.setDzzmc(dzzmc);
+            model.setPersonnellist(new ArrayList<>());
         }
         res.setItem(model);
         return res;
@@ -410,7 +411,7 @@ public class PartyTwoController {
 
     @ResponseBody
     @RequestMapping("/saveZtdrxx")
-    public RequsetData<String> saveZtdrxx(@RequestBody DjZtdrxx model) {
+    public RequsetData<String> saveZtdrxx(@RequestBody DjZtdrxxVo model) {
 
         RequsetData<String> res = partyTwoService.saveZtdrxx(model);
 

+ 5 - 5
src/main/java/com/ghsc/partybuild/controller/app/AppPartyTwoExtController.java

@@ -64,13 +64,13 @@ public class AppPartyTwoExtController {
 
     @ResponseBody
     @RequestMapping("/getZtdrxx")
-    public RequsetData<DjZtdrxx> getZtdrxx(@RequestParam("id") String id, @RequestParam("dzzdm") String dzzdm, @RequestParam("dzzmc") String dzzmc) {
-        RequsetData<DjZtdrxx> res = new RequsetData<>();
+    public RequsetData<DjZtdrxxVo> getZtdrxx(@RequestParam("id") String id, @RequestParam("dzzdm") String dzzdm, @RequestParam("dzzmc") String dzzmc) {
+        RequsetData<DjZtdrxxVo> res = new RequsetData<>();
 
-        DjZtdrxx model = partyTwoService.getZtdrxx(id);
+        DjZtdrxxVo model = partyTwoService.getZtdrxx(id);
         if (model == null) {
             UUID uuid = UUID.randomUUID();
-            model = new DjZtdrxx();
+            model = new DjZtdrxxVo();
             model.setId(uuid.toString());
             model.setDzzdm(dzzdm);
             model.setDzzmc(dzzmc);
@@ -88,7 +88,7 @@ public class AppPartyTwoExtController {
         String message = "";
 
         try {
-            DjZtdrxx dataModel = mapper.readValue(mapper.writeValueAsString(reqMap.get("dataModel")).toString(), DjZtdrxx.class);
+            DjZtdrxxVo dataModel = mapper.readValue(mapper.writeValueAsString(reqMap.get("dataModel")).toString(), DjZtdrxxVo.class);
             res = partyTwoService.saveZtdrxx(dataModel);
         } catch (JsonProcessingException e) {
             e.printStackTrace();

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

@@ -35,7 +35,7 @@ public interface PartyTwoCQuery {
     List<DjZtdrxxVo> selectZtdrxxList(@Param("dzzdm") String dzzdm, @Param("dzzmc") String dzzmc, @Param("title") String title,
                                       @Param("location") String location,
                                       @Param("subjectType") Integer subjectType, @Param("beginTime") String beginTime,
-                                      @Param("endTime") String endTime, @Param("zzfbType") Integer zzfbType);
+                                      @Param("endTime") String endTime, @Param("zzfbType") Integer zzfbType, @Param("ztdrxxID") String ztdrxxID);
 
     List<DjZzsrVo> selectZzsrList(@Param("dzzdm") String dzzdm, @Param("dzzmc") String dzzmc, @Param("title") String title,
                                   @Param("location") String location,

+ 2 - 2
src/main/java/com/ghsc/partybuild/service/PartyTwoService.java

@@ -39,9 +39,9 @@ public interface PartyTwoService {
 
     List<Map<String, Object>> importDnghbf(List<Map<String, Object>> dnghbflist) throws Exception;
 
-    DjZtdrxx getZtdrxx(String id);
+    DjZtdrxxVo getZtdrxx(String id);
 
-    RequsetData<String> saveZtdrxx(DjZtdrxx model);
+    RequsetData<String> saveZtdrxx(DjZtdrxxVo model);
 
     int delZtdrxx(String id);
 

+ 57 - 5
src/main/java/com/ghsc/partybuild/service/impl/PartyTwoServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ghsc.partybuild.service.impl;
 
+import com.ghsc.partybuild.vo.partyLife.PartyLifeMeetingVo;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ghsc.partybuild.controller.jsonmodel.RequsetData;
@@ -87,6 +88,12 @@ public class PartyTwoServiceImpl implements PartyTwoService {
     @Autowired
     private com.ghsc.partybuild.util.StringUtils stringUtils;
 
+    @Autowired
+    private PfPartylifemeetingPersonnelMapper pfPartylifemeetingPersonnelMapper;
+
+    @Autowired
+    private PartyLifeMeetingCQuery partyLifeMeetingCQuery;
+
     @Override
     public DjDnpxxx getDnpxxx(String id) {
         return dnpxxxMapper.selectByPrimaryKey(id);
@@ -412,18 +419,54 @@ public class PartyTwoServiceImpl implements PartyTwoService {
     }
 
     @Override
-    public RequsetData<String> saveZtdrxx(DjZtdrxx model) {
+    public RequsetData<String> saveZtdrxx(DjZtdrxxVo data) {
         RequsetData<String> res = new RequsetData<String>();
         int result;
+
+        DjZtdrxx model = ztdrxxMapper.selectByPrimaryKey(data.getId());
+        boolean isSave = model == null;
+        if (model == null) {
+            model = new DjZtdrxx();
+            model.setId(data.getId());
+        }
+
         //同步数据
         model.setOperatestate("A");
         model.setOperatetime(new Date());
         model.setSyncstate("N");
-        if (ztdrxxMapper.selectByPrimaryKey(model.getId()) == null) {
+        // 从Vo类中同步字段
+        model.setDzzdm(data.getDzzdm());
+        model.setDzzmc(data.getDzzmc());
+        model.setTitle(data.getTitle());
+        model.setActivitytime(data.getActivitytime());
+        model.setLocation(data.getLocation());
+        model.setSubjecttype(data.getSubjecttype());
+        model.setSubjectcontent(data.getSubjectcontent());
+
+        if (isSave) {
             result = ztdrxxMapper.insert(model);
         } else {
             result = ztdrxxMapper.updateByPrimaryKeyWithBLOBs(model);
         }
+
+        //出席人员
+        PfPartylifemeetingPersonnelExample perExp = new PfPartylifemeetingPersonnelExample();
+        perExp.or().andPartylifemeetingidEqualTo(data.getId());
+        pfPartylifemeetingPersonnelMapper.deleteByExample(perExp);
+        if(data.getPersonnellist().size() > 0){
+            data.getPersonnellist().forEach(item -> {
+                PfPartylifemeetingPersonnel perModel = new PfPartylifemeetingPersonnel();
+                perModel.setId(UUID.randomUUID().toString());
+                perModel.setRybm(item.getRybm());
+                perModel.setPartylifemeetingid(data.getId());
+                perModel.setIsabsenteeism(item.getIsabsenteeism());
+                perModel.setAbsenteeismcause(item.getAbsenteeismcause());
+                perModel.setCreatetime(new Date());
+
+                pfPartylifemeetingPersonnelMapper.insert(perModel);
+            });
+        }
+
         if (result > 0) {
             res.setSuccess(true);
             res.setMsg("提交成功!");
@@ -442,15 +485,24 @@ public class PartyTwoServiceImpl implements PartyTwoService {
     @Override
     public PageInfo<DjZtdrxxVo> getZtdrxxList(int page, int rows, String dzzdm, String dzzmc, String title, Integer subjectType, String location, String beginTime, String endTime, Integer zzfbType) {
         PageHelper.startPage(page, rows);
-        List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(dzzdm, dzzmc, title, location, subjectType, beginTime, endTime, zzfbType);
+        List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(dzzdm, dzzmc, title, location, subjectType, beginTime, endTime, zzfbType, null);
 
         PageInfo<DjZtdrxxVo> result = new PageInfo(list);
         return result;
     }
 
     @Override
-    public DjZtdrxx getZtdrxx(String id) {
-        return ztdrxxMapper.selectByPrimaryKey(id);
+    public DjZtdrxxVo getZtdrxx(String id) {
+        if (stringUtils.IsNullOrEmpty(id))
+            return null;
+
+        List<DjZtdrxxVo> list = partyTwoCquery.selectZtdrxxList(null, null, null, null, null, null, null, null, null);
+        DjZtdrxxVo data = list.size() > 0 ? list.get(0) : null;
+        if(data != null){
+            // 查询出席人员列表
+            data.setPersonnellist(partyLifeMeetingCQuery.selectMeetingPersonnelList(data.getId()));
+        }
+        return data;
     }
 
     @Override

+ 7 - 1
src/main/java/com/ghsc/partybuild/vo/DjZtdrxxVo.java

@@ -1,9 +1,11 @@
 package com.ghsc.partybuild.vo;
 
+import com.ghsc.partybuild.vo.partyLife.PartyLifeMeetingPersonnelVo;
 import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class DjZtdrxxVo {
@@ -19,7 +21,7 @@ public class DjZtdrxxVo {
 
     private String location;
 
-    private BigDecimal subjecttype;
+    private Integer subjecttype;
 
     private String createuserid;
 
@@ -46,4 +48,8 @@ public class DjZtdrxxVo {
     private String fileurl;
 
     private String dwmc;
+
+    private Integer absentcount;//缺勤人数
+    private Integer attendance;//出席人员数量
+    public List<PartyLifeMeetingPersonnelVo> personnellist;
 }

+ 3 - 3
src/main/resources/static/app/main/partyTwoExt/dnpxxx/list.html

@@ -134,15 +134,15 @@
                     </div>
                     <div class="search-btn" style="margin-right: 20px;">
                         <div style="float: right">
-                            <button class="btn  btn-default1"
-                                    ng-click="export()">导出
-                            </button>
                             <button class="btn btn-default1" role-permission-code="dnpxxx.btn.btnAdd"
                                     ng-click="add()">新增
                             </button>
                             <button class="btn btn-default1" ng-if="selectparams.pxlx==1"
                                     ng-click="import()">导入
                             </button>
+                            <button class="btn  btn-default1"
+                                    ng-click="export()">导出
+                            </button>
                         </div>
                     </div>
                 </div>

+ 56 - 0
src/main/resources/static/app/main/partyTwoExt/ztdrxx/edit.html

@@ -81,6 +81,62 @@
                     </tr>
                 </table>
             </div>
+            <div class="dj-formtable">
+                <div class="table-responsive list-table-panel">
+                    <div class="list-table-title">
+                        <div class="table-title">
+                            出席人员列表({{dataModel.personnellist.length}}人)
+                        </div>
+                        <div class="table-tool">
+                            <button type="button" class="btn btn-primary dropdown-toggle"
+                                    data-dataoptions="selectUserlist" title="新增"
+                                    ng-click="selectUser()"
+                                    bsselectdata-pro>
+                                新增
+                            </button>
+                        </div>
+                    </div>
+                    <div class="outoflow" style="max-height: 300px;">
+                        <table class="table table-bordered table-striped table-hover js-basic-example dataTable text-nowrap">
+                            <thead>
+                            <tr>
+                                <th>序号</th>
+                                <th>姓名</th>
+                                <th>是否缺勤</th>
+                                <th>缺勤原因</th>
+                                <th>操作</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            <tr ng-repeat="it in dataModel.personnellist">
+                                <td scope="row">{{$index+1}}</td>
+                                <td>{{it.xm}}</td>
+                                <td>
+                                    <input type="checkbox" id="{{pageId}}_checkbox_{{$index+1}}"
+                                           class="filled-in chk-col-red" ng-checked="it.isabsenteeism==1"
+                                           ng-click="it.isabsenteeism==1?it.isabsenteeism=0:it.isabsenteeism=1"/>
+                                    <label class="checkbox_lable" style="height: 10px;"
+                                           for="{{pageId}}_checkbox_{{$index+1}}">{{it.isabsenteeism == 1 ? "是" : "否"}}</label>
+                                </td>
+                                <td>
+                                            <textarea name="absenteeismcause" ng-model="it.absenteeismcause"
+                                                      class="form-control" rows="3"></textarea>
+                                </td>
+                                <td class="text-center">
+                                    <button class="btn td-btn bg-pink waves-effect"
+                                            ng-click="deleteUser($index)" title="删除">
+                                        删除
+                                    </button>
+                                </td>
+                            </tr>
+                            <tr ng-if="dataModel.personnellist.length<=0">
+                                <td colspan="7" style="text-align:center">暂无数据</td>
+                            </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+            </div>
             <div class="form_foot" >
                 <button type="button" class="btn btn-default" ng-click="pagechange();">取消</button>
                 <button type="submit"

+ 68 - 0
src/main/resources/static/app/main/partyTwoExt/ztdrxx/edit.js

@@ -59,6 +59,74 @@
             }
         }, true);
 
+        // 弹窗选择出席人员
+        $scope.selectUserlist = {
+            url: "../../api/partyUser/getPartyUserList",
+            title: '人员选择',
+            isMulti: true,
+            selectData: {xm: '姓名', szdzb: '所在组织架构'},
+            columns: {XM: '姓名', XBMC: '性别', JG: '籍贯', DZZMC: '所在组织架构'},
+            selectLabelKey: 'XM',
+            selectValuekey: 'RYJBXXBS',
+            selectedValueData: '',
+            selectedLabeData: '',
+            selectedJData: [],
+            selectParams: {
+                dzzdm: $scope.dataModel.partycode,
+                removeUsers: '',
+                //szdzbdm: $scope.dataModel.shyktype == 2 ? $scope.dataModel.partycode : '',
+                ryzt: '2,3' //预备党员,正式党员
+            }
+        };
+        $scope.$watch('selectUserlist.selectedValueData', function (newVal) {
+            if (newVal != '' && newVal != undefined) {
+                $http({
+                    method: 'get',
+                    url: '../../api/partyUser/getPartyUserList',
+                    params: {
+                        userIds: newVal,
+                        pageindex: 1,
+                        pagesize: 10000
+                    }
+                }).then(function (result) {
+                    $loading.hide();
+                    result.data.item.list.forEach(item => {
+                        item.SIGNINSTATUS = 2;
+                    });
+                    let data = [];
+                    result.data.item.list.forEach(x=>{
+                        data.push({rybm: x.RYBM, ryjbxxbs: x.RYJBXXBS, xm: x.XM, isabsenteeism: 0, absenteeismcause: ''});
+                    })
+                    $scope.dataModel.personnellist = $scope.dataModel.personnellist.concat(data);
+
+                    $scope.selectUserlist.selectedValueData = "";
+                    $scope.selectUserlist.selectedLabeData = "";
+                }, function (resp) {
+                    $loading.hide();
+                    $scope.showMsg('错误', '服务器错误');
+                });
+            }
+        });
+        $scope.$watch('dataModel.personnellist', function (newVal) {
+            if($scope.dataModel.personnellist){
+                $scope.setRemoveUser();
+            }
+        }, true);
+
+        $scope.setRemoveUser = function () {
+            $scope.selectUserlist.selectParams.removeUsers = "";
+            angular.forEach($scope.dataModel.personnellist, function (val, index) {
+                $scope.selectUserlist.selectParams.removeUsers += val.ryjbxxbs + ','
+            });
+        };
+
+        //人员操作
+        $scope.deleteUser = function (index) {
+            if (confirm("请确认是否需要移除参会人员!")) {
+                $scope.dataModel.personnellist.splice(index, 1);
+            }
+        };
+
         $scope.loadData = function () {
             $http.get("../../api/partyTowExt/getZtdrxx", {
                 params: {

+ 32 - 0
src/main/resources/static/app/main/partyTwoExt/ztdrxx/view.html

@@ -47,6 +47,38 @@
                     </tr>
                 </table>
             </div>
+            <div class="dj-formtable">
+                <div class="table-responsive list-table-panel">
+                    <div class="list-table-title">
+                        <div class="table-title">
+                            出席人员列表({{dataModel.personnellist.length}}人)
+                        </div>
+                    </div>
+                    <div class="outoflow" style="max-height: 300px;">
+                        <table class="table table-bordered table-striped table-hover js-basic-example dataTable text-nowrap">
+                            <thead>
+                            <tr>
+                                <th>序号</th>
+                                <th>姓名</th>
+                                <th>是否缺勤</th>
+                                <th>缺勤原因</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            <tr ng-repeat="it in dataModel.personnellist">
+                                <td scope="row">{{$index+1}}</td>
+                                <td>{{it.xm}}</td>
+                                <td>{{it.isabsenteeismname}}</td>
+                                <td style="min-width: 150px !important;word-wrap: break-word;word-break: break-all;white-space: normal;">{{it.absenteeismcause}}</td>
+                            </tr>
+                            <tr ng-if="userList.length<=0">
+                                <td colspan="7" style="text-align:center">暂无数据</td>
+                            </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+            </div>
             <div class="form_foot">
                 <button type="button" class="btn btn-default" ng-click="pagechange();">关闭</button>
             </div>