Bladeren bron

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

zhangjq 1 jaar geleden
bovenliggende
commit
f12f37471a

+ 4 - 0
client/src/api/oa/staffRecords/index.ts

@@ -14,3 +14,7 @@ export const getRecordsPage = (params) => {
 export const editRecordsDetail = (params) => {
   return request.post({ url: '/adm/staff-records/update', data: params })
 }
+//生成员工工号
+export const generateStaffNum = () => {
+  return request.post({ url: '/adm/staff-records/generateNum' })
+}

+ 15 - 12
client/src/views/OaSystem/components/RatioInput/index.vue

@@ -23,24 +23,18 @@ const _props = defineProps({
     default: 0
   }
 })
-watch(
-  () => _props.modelValue,
-  (n, o) => {
-    computedRatioNumC(n)
-  }
-)
 const _emit = defineEmits<{ (e: 'update:modelValue', v: number): void }>()
-const ratioNum1 = ref<any>()
-const ratioNum2 = ref<any>()
+const ratioNum1 = ref<any>(0)
+const ratioNum2 = ref<any>(0)
 const shareRatioIndex = ref<string>('')
 const shareRatioMap = reactive<any>({
   '1': [58, 42],
   '2': [62.5, 37.5],
-  '3': []
+  '3': [0, 0]
 })
 const setRatioNumC = (): void => {
-  shareRatioMap['c'][0] = parseFloat(ratioNum1.value)
-  shareRatioMap['c'][1] = parseFloat(ratioNum2.value)
+  shareRatioMap['3'][0] = parseFloat(ratioNum1.value)
+  shareRatioMap['3'][1] = parseFloat(ratioNum2.value)
 }
 const computedRatioNumC = (v): void => {
   const num2 = v * 100
@@ -61,7 +55,7 @@ const computedRatioNumC = (v): void => {
 }
 const ratioChangeHandle = (): void => {
   const index: string = shareRatioIndex.value
-  if (index == 'c') {
+  if (index == '3') {
     const ratio: number = shareRatioMap[index][1] / 100
     _emit('update:modelValue', ratio)
   }
@@ -82,6 +76,15 @@ const radioChange = (): void => {
   const ratio: number = shareRatioMap[index][1] / 100
   _emit('update:modelValue', ratio)
 }
+watch(
+  () => _props.modelValue,
+  (n, o) => {
+    computedRatioNumC(n)
+  },
+  {
+    immediate: true
+  }
+)
 </script>
 
 <style scoped lang="scss">

+ 20 - 3
client/src/views/OaSystem/personnelManagement/ygdaPage/index.ts

@@ -50,7 +50,18 @@ export const formConfigList = [
       },
       {
         name: 'drzw',
-        title: '在岗职位'
+        title: '在岗职位',
+        type: 'select',
+        options: [
+          {
+            value: '1',
+            label: 'JAVA工程师'
+          },
+          {
+            value: '2',
+            label: '前端工程师'
+          }
+        ]
       },
       {
         name: 'nation',
@@ -58,7 +69,8 @@ export const formConfigList = [
       },
       {
         name: 'loginName',
-        title: '员工工号'
+        title: '员工工号',
+        type: 'button'
       },
       {
         name: 'deptName',
@@ -195,9 +207,14 @@ export const formConfigList = [
       },
       {
         name: 'htdqs',
-        title: '合同时间',
+        title: '合同到期时间',
         type: 'time'
       }
+      // {
+      //   name: 'htdqs',
+      //   title: '合同时间',
+      //   type: 'timerange'
+      // }
     ]
   },
   {

+ 32 - 1
client/src/views/OaSystem/personnelManagement/ygdaPage/staffDetail.vue

@@ -2,7 +2,7 @@
 defineOptions({ name: 'StaffDetail' })
 
 import { useQuery, useMutation } from '@tanstack/vue-query'
-import { getRecordsDetail, editRecordsDetail } from '@/api/oa/staffRecords'
+import { getRecordsDetail, editRecordsDetail, generateStaffNum } from '@/api/oa/staffRecords'
 import { formConfigList } from './index'
 import { ElRow, FormInstance } from 'element-plus'
 import TechCertificate from './TechCertificate.vue'
@@ -47,6 +47,22 @@ const { mutate: addUserMutate } = useMutation({
   }
 })
 
+/**生成工号 */
+const { mutate: generateStaffNumber } = useMutation({
+  mutationFn: async () => {
+    return await generateStaffNum()
+  },
+  onSuccess(res) {
+    formData.value['loginName'] = res
+  },
+  onError() {
+    ElMessage({
+      message: '工号生成失败!',
+      type: 'error'
+    })
+  }
+})
+
 /**表单保存 */
 const submitForm = (formEl: FormInstance | undefined) => {
   if (!formEl) return
@@ -114,6 +130,16 @@ const isEdit = computed(() => {
                     v-model="formData[child?.name]"
                     placeholder=""
                   />
+                  <div v-if="child?.type === 'button'" class="generate-num">
+                    <el-input v-model="formData[child?.name]" placeholder="" />
+                    <ElButton
+                      v-if="isEdit"
+                      type="primary"
+                      style="width: 70px; height: 30px; margin-left: 10px"
+                      @click="generateStaffNumber()"
+                      >生成工号</ElButton
+                    >
+                  </div>
                 </el-form-item>
               </li>
               <li></li>
@@ -254,4 +280,9 @@ const isEdit = computed(() => {
     }
   }
 }
+
+.generate-num {
+  display: flex;
+  width: 100%;
+}
 </style>

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/AddSubProject.vue

@@ -46,7 +46,7 @@ setTimeout(() => {
   projectChildForm.value.shareRatio = 0.62
 }, 2000)
 const submitProjectChild = () => {
-  projectChildForm.value['xmbh'] = projectNo
+  projectChildForm.value.xmbh = projectNo
   const sendData = {
     pid: unref(projectId),
     ...projectChildForm.value

+ 1 - 2
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/index.vue

@@ -143,7 +143,7 @@
                 <td>
                   <el-input
                     class="form-item-disable-style"
-                    v-model="projectDetail['ygje']"
+                    v-model="projectDetail['estimateAmount']"
                     :disabled="!editor"
                   />
                 </td>
@@ -303,7 +303,6 @@ const { mutate: save } = useMutation(saveProject, {
     ElMessage({ message: '保存项目成功', type: 'success' })
   }
 })
-
 defineExpose({
   saveProjectHandle,
   saveProjectStateHandler,

+ 77 - 0
zjugis-business/src/main/java/com/zjugis/business/controller/OutsourceApplyController.java

@@ -0,0 +1,77 @@
+package com.zjugis.business.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zjugis.business.bean.dto.OutsourceApplyDto;
+import com.zjugis.business.bean.entity.OutsourceApply;
+import com.zjugis.business.service.OutsourceApplyService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * (OUTSOURCE_APPLY)表控制层
+ *
+ * @author ljy
+ * @since 2024-03-12 18:51:36
+ */
+@RestController
+public class OutsourceApplyController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private OutsourceApplyService outsourceApplyService;
+
+    @GetMapping("/outsourceApply/page")
+    public CommonResult<Page<OutsourceApply>> page(@RequestBody OutsourceApplyDto outsourceApplyDto) {
+        return CommonResult.success(outsourceApplyService.page(outsourceApplyDto));
+    }
+
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("/outsourceApply")
+    public CommonResult<OutsourceApply> queryById(@RequestParam("id") String id) {
+        return CommonResult.success(outsourceApplyService.queryById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param outsourceApply 实体
+     * @return 新增结果
+     */
+    @PostMapping("/outsourceApply")
+    public CommonResult<String> create(@RequestBody OutsourceApply outsourceApply) {
+        return CommonResult.success(outsourceApplyService.insert(outsourceApply));
+    }
+
+    /**
+     * 编辑数据
+     *
+     * @param outsourceApply 实体
+     * @return 编辑结果
+     */
+    @PutMapping("/outsourceApply")
+    public CommonResult update(@RequestBody OutsourceApply outsourceApply) {
+        return CommonResult.success(outsourceApplyService.update(outsourceApply));
+    }
+
+    /**
+     * 删除数据
+     *
+     * @return 删除是否成功
+     */
+    @DeleteMapping("/outsourceApply")
+    public CommonResult<Integer> deleteByIds(@RequestBody List<String> idList) {
+        return CommonResult.success(outsourceApplyService.deleteByIdList(idList));
+    }
+
+}
+

+ 57 - 0
zjugis-business/src/main/java/com/zjugis/business/service/OutsourceApplyService.java

@@ -0,0 +1,57 @@
+package com.zjugis.business.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zjugis.business.bean.dto.OutsourceApplyDto;
+import com.zjugis.business.bean.entity.OutsourceApply;
+
+import java.util.List;
+
+/**
+ * (OUTSOURCE_APPLY)表服务接口
+ *
+ * @author ljy
+ * @since 2024-03-12 18:51:40
+ */
+public interface OutsourceApplyService {
+
+    Page<OutsourceApply> page(OutsourceApplyDto outsourceApplyDto);
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OutsourceApply queryById(String id);
+
+    OutsourceApply selectByInstanceId(String id);
+
+    /**
+     * 新增数据
+     *
+     * @param outsourceApply 实例对象
+     * @return 实例对象
+     */
+    String insert(OutsourceApply outsourceApply);
+
+    /**
+     * 修改数据
+     *
+     * @param outsourceApply 实例对象
+     * @return 实例对象
+     */
+    int update(OutsourceApply outsourceApply);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    int deleteById(String id);
+
+    int deleteByIdList(List<String> ids);
+
+    String process(String projectId);
+}
+

+ 130 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/OutsourceApplyServiceImpl.java

@@ -0,0 +1,130 @@
+package com.zjugis.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zjugis.business.bean.dto.OutsourceApplyDto;
+import com.zjugis.business.bean.entity.OutsourceApply;
+import com.zjugis.business.constants.FlowStatusConstants;
+import com.zjugis.business.mapper.OutsourceApplyMapper;
+import com.zjugis.business.service.OutsourceApplyService;
+import com.zjugis.framework.common.pojo.CommonResult;
+import com.zjugis.framework.security.core.util.SecurityFrameworkUtils;
+import com.zjugis.framework.workflow.model.ProcessDto;
+import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
+import com.zjugis.framework.workflow.utils.UrlUtils;
+import com.zjugis.module.system.api.user.AdminUserApi;
+import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * (OUTSOURCE_APPLY)表服务实现类
+ *
+ * @author ljy
+ * @since 2024-03-12 18:51:40
+ */
+@Service
+public class OutsourceApplyServiceImpl implements OutsourceApplyService {
+    @Resource
+    private OutsourceApplyMapper outsourceApplyMapper;
+
+    @Autowired
+    private AdminUserApi adminUserApi;
+    @Autowired
+    private WorkflowClient workflowClient;
+
+
+    @Override
+    public Page<OutsourceApply> page(OutsourceApplyDto outsourceApplyDto) {
+        Page<OutsourceApply> page = new Page<>(outsourceApplyDto.getPageNo(),outsourceApplyDto.getPageSize());
+        QueryWrapper<OutsourceApply> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("ISVALID",1);
+        return outsourceApplyMapper.selectPage(page,queryWrapper);
+    }
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    @Override
+    public OutsourceApply queryById(String id) {
+        return outsourceApplyMapper.selectById(id);
+    }
+
+    @Override
+    public OutsourceApply selectByInstanceId(String id) {
+        QueryWrapper<OutsourceApply> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("INSTANCE_ID",id);
+        return outsourceApplyMapper.selectOne(queryWrapper);
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param outsourceApply 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public String insert(OutsourceApply outsourceApply) {
+        outsourceApply.setIsvalid(1);
+        this.outsourceApplyMapper.insert(outsourceApply);
+        return outsourceApply.getId();
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param outsourceApply 实例对象
+     * @return 实例对象
+     */
+    @Override
+    public int update(OutsourceApply outsourceApply) {
+        return this.outsourceApplyMapper.updateById(outsourceApply);
+    }
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 是否成功
+     */
+    @Override
+    public int deleteById(String id) {
+        return this.outsourceApplyMapper.deleteById(id);
+    }
+
+
+    @Override
+    public int deleteByIdList(List<String> ids) {
+        return this.outsourceApplyMapper.deleteBatchIds(ids);
+    }
+
+    /**
+     * @param projectId
+     * @return
+     */
+    @Override
+    public String process(String projectId) {
+        String userId = SecurityFrameworkUtils.getLoginUserId();
+        CommonResult<AdminUserRespDTO> userResp = adminUserApi.getUser(userId);
+        String mark = "wbhtsq";
+        ProcessDto processDto = new ProcessDto();
+        processDto.setFlowTemplateMark(mark);
+        processDto.setPromoterId(userId);
+        String returnUrl = workflowClient.createProcess(processDto);
+        OutsourceApply entity = new OutsourceApply();
+        entity.setInstanceId(UrlUtils.getParam(returnUrl,"flowInstanceId"));
+        entity.setProjectId(projectId);
+        entity.setApplyWorker(userResp.getCheckedData().getNickname());
+        entity.setApplyWorkerId(userId);
+        entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
+        insert(entity);
+        return returnUrl;
+    }
+}
+

+ 1 - 1
zjugis-module-system/zjugis-module-system-api/src/main/java/com/zjugis/module/system/api/permission/RoleApi.java

@@ -37,5 +37,5 @@ public interface RoleApi {
 
 
     @GetMapping(PREFIX + "/page")
-    CommonResult<PageResult<RoleRespDto>> getRolePage(@RequestParam("pageNo") long pageNo, @RequestParam("pageSize") long pageSize, @RequestParam("code") String code, @RequestParam("name") String name);
+    CommonResult<PageResult<RoleRespDto>> getRolePage(@RequestParam("pageNo") long pageNo, @RequestParam("pageSize") long pageSize, @RequestParam(value = "code",required = false) String code, @RequestParam("name") String name);
 }