Merge remote-tracking branch 'origin/dev_2307' into dev_2307

dev^2
zjh 1 year ago
commit e57512d638
  1. 226
      ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
  2. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/entity/FunctionxTest.java
  3. 200
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java
  4. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java
  5. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/service/impl/FieldxServiceImpl.java
  6. 39
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java
  7. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java

@ -5,24 +5,17 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperName"> <a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperName">
<j-popup <j-popup v-model="model.upperTaskName" field="upperTaskName" org-fields="id,task_name"
v-model="model.upperTaskName" dest-fields="upperId,upperTaskName" code="taskname" :multi="true" @input="popupCallback" />
field="upperTaskName"
org-fields="id,task_name"
dest-fields="upperId,upperTaskName"
code="taskname"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<!-- <a-col :span="24">--> <!-- <a-col :span="24">-->
<!-- <a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperId">--> <!-- <a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperId">-->
<!-- <j-dict-select-tag v-model="model.upperId" placeholder="请选择所属上级任务"--> <!-- <j-dict-select-tag v-model="model.upperId" placeholder="请选择所属上级任务"-->
<!-- :dict-code="task" style="width: 100%">--> <!-- :dict-code="task" style="width: 100%">-->
<!-- </j-dict-select-tag>--> <!-- </j-dict-select-tag>-->
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!-- </a-col>-->
<a-col :span="24" style="display: none;"> <a-col :span="24" style="display: none;">
<a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperId"> <a-form-model-item label="上级任务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperId">
<a-input v-model="model.upperId" placeholder="请选择所属上级任务"></a-input> <a-input v-model="model.upperId" placeholder="请选择所属上级任务"></a-input>
@ -31,26 +24,27 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel"> <a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel">
<!-- <a-input-number :min="1" :max="16" v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />--> <!-- <a-input-number :min="1" :max="16" v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workLevel" type="radio" placeholder="请选择任务等级" dict-code="workLevel" style="width: 100%"> <j-dict-select-tag v-model="model.workLevel" type="radio" placeholder="请选择任务等级" dict-code="workLevel"
style="width: 100%">
</j-dict-select-tag> </j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col > <a-col>
<a-form-model-item label="任务层级" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="level"> <a-form-model-item label="任务层级" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="level">
<j-dict-select-tag v-model="model.level" type="radio" style="width: 100%" dictCode="task_type_level"/> <j-dict-select-tag v-model="model.level" type="radio" style="width: 100%" dictCode="task_type_level" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col > <a-col>
<a-form-model-item label="任务类型" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="typeId"> <a-form-model-item label="任务类型" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="typeId">
<!-- <j-dict-select-tag v-model="model.typeId" type="radio" style="width: 100%" dict-code="task_type,type_name,id"/> --> <!-- <j-dict-select-tag v-model="model.typeId" type="radio" style="width: 100%" dict-code="task_type,type_name,id"/> -->
<div v-for="item in options" :key="item.id" class="a"> <div v-for="item in options" :key="item.id" class="a">
<span style="margin-right: 10px;" class="B">{{ item.type_Name }} </span> <span style="margin-right: 10px;" class="B">{{ item.type_Name }} </span>
<a-radio-group v-model="model.typeId" :key="`children-${item.id}`" > <a-radio-group v-model="model.typeId" :key="`children-${item.id}`">
<a-radio v-for="child in item.children" :key="child.id" :value="child.id"> <a-radio v-for="child in item.children" :key="child.id" :value="child.id">
<span>{{ child.type_Name }}</span> <span>{{ child.type_Name }}</span>
</a-radio> </a-radio>
@ -62,66 +56,59 @@
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectId"> <a-form-model-item label="项目" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectId">
<j-dict-select-tag <j-dict-select-tag v-model="model.projectId" placeholder="请选择项目" dict-code="projectx,project_name,id"
v-model="model.projectId" style="width: 100%" :disabled="model.typeId == null" @change="fillTaskName">
placeholder="请选择项目"
dict-code="projectx,project_name,id"
style="width: 100%"
:disabled="model.typeId==null"
@change="fillTaskName" >
</j-dict-select-tag> </j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName"> <a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName">
<!-- <a-input v-model="model.taskName" placeholder="请输入中文名称"--> <!-- <a-input v-model="model.taskName" placeholder="请输入中文名称"-->
<!-- autocomplete="on" --> <!-- autocomplete="on" -->
<!-- :disabled="model.typeId==null">--> <!-- :disabled="model.typeId==null">-->
<!-- </a-input>--> <!-- </a-input>-->
<a-textarea v-model="model.taskName" <a-textarea v-model="model.taskName" placeholder="请输入中文名称" autocomplete="on"
placeholder="请输入中文名称" :disabled="model.typeId == null" auto-size />
autocomplete="on"
:disabled="model.typeId==null"
auto-size />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers"> <a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers">
<j-multi-select-tag type="list_multi" v-model="model.managerUsers" dictCode="sys_user,realname,id" placeholder="请选择责任人"/> <j-multi-select-tag type="list_multi" v-model="model.managerUsers" dictCode="sys_user,realname,id"
placeholder="请选择责任人" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId"> <a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleId">
<!-- <a-input v-model="model.moduleId" placeholder="请输入模块" modulex,module_name,id></a-input>--> <!-- <a-input v-model="model.moduleId" placeholder="请输入模块" modulex,module_name,id></a-input>-->
<j-dict-select-tag v-model="model.moduleId" placeholder="请选择模块" :dict-code="this.modulex" <j-dict-select-tag v-model="model.moduleId" placeholder="请选择模块" :dict-code="this.modulex" style="width: 80%"
style="width: 80%" @change="fillModuleName()"></j-dict-select-tag> @change="fillModuleName()"></j-dict-select-tag>
<a-button @click="handleAdd3" type="primary" icon="plus" style="width: 20%;"></a-button> <a-button @click="handleAdd3" type="primary" icon="plus" style="width: 20%;"></a-button>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="功能" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionId"> <a-form-model-item label="功能" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="functionId">
<!-- <a-input v-model="model.functionId" placeholder="请输入功能id" functionx,function_name,id></a-input>--> <!-- <a-input v-model="model.functionId" placeholder="请输入功能id" functionx,function_name,id></a-input>-->
<j-dict-select-tag v-model="model.functionId" placeholder="请选择功能" <j-dict-select-tag v-model="model.functionId" placeholder="请选择功能" :dict-code="functionx" style="width: 80%"
:dict-code="functionx" @change="fillFunctionName()"></j-dict-select-tag>
style="width: 80%" @change="fillFunctionName()"></j-dict-select-tag> <a-button @click="handleAdd1(model.moduleId)" type="primary" icon="plus" style="width: 20%;"></a-button>
<a-button @click="handleAdd1(model.moduleId)" type="primary" icon="plus" style="width: 20%;" ></a-button>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="规则" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleId"> <a-form-model-item label="规则" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ruleId">
<!-- <a-input v-model="model.ruleId" placeholder="请输入规则id" rulex,rule_no,id></a-input>--> <!-- <a-input v-model="model.ruleId" placeholder="请输入规则id" rulex,rule_no,id></a-input>-->
<j-dict-select-tag v-model="model.ruleId" placeholder="请选择规则" :dict-code="rulex" <j-dict-select-tag v-model="model.ruleId" placeholder="请选择规则" :dict-code="rulex"
style="width: 80%"></j-dict-select-tag> style="width: 80%"></j-dict-select-tag>
<a-button @click="handleAdd2(model.functionId,model.moduleId)" type="primary" icon="plus" style="width: 20%;"></a-button> <a-button @click="handleAdd2(model.functionId, model.moduleId)" type="primary" icon="plus"
style="width: 20%;"></a-button>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col > <a-col>
<a-form-model-item label="任务状态" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="workStatus"> <a-form-model-item label="任务状态" :labelCol="labelCol1" :wrapperCol="wrapperCol1" prop="workStatus">
<!-- <a-input-number :min="1" :max="16" v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />--> <!-- <a-input-number :min="1" :max="16" v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workStatus" type="radio" dict-code="task_work_status" <j-dict-select-tag v-model="model.workStatus" type="radio" dict-code="task_work_status"
placeholder="请选择任务状态" style="width: 100%"/> placeholder="请选择任务状态" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -129,7 +116,7 @@
<a-col> <a-col>
<a-form-model-item label="任务描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="taskDescribe"> <a-form-model-item label="任务描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="taskDescribe">
<!-- <a-input type="textarea" v-model="model.taskDescribe" :rows="2"/> --> <!-- <a-input type="textarea" v-model="model.taskDescribe" :rows="2"/> -->
<j-editor v-model="model.taskDescribe"/> <j-editor v-model="model.taskDescribe" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -137,36 +124,37 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="publishTime"> <a-form-model-item label="发布时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="publishTime">
<!-- <j-date placeholder="请选择发布时间" v-model="model.publishTime" style="width: 100%"/>--> <!-- <j-date placeholder="请选择发布时间" v-model="model.publishTime" style="width: 100%"/>-->
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.startTime" style="width: 100%"/> <a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.startTime" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="预计结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expectedEndTime"> <a-form-model-item label="预计结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expectedEndTime">
<!-- <j-date placeholder="请选择预计结束时间" v-model="model.expectedEndTime" style="width: 100%"/>--> <!-- <j-date placeholder="请选择预计结束时间" v-model="model.expectedEndTime" style="width: 100%"/>-->
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.expectedEndTime" style="width: 100%"/> <a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.expectedEndTime"
style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="预计时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expectedDuration"> <a-form-model-item label="预计时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="expectedDuration">
<a-input-number v-model="model.expectedDuration" placeholder="请输入预计时长" style="width: 100%"/> <a-input-number v-model="model.expectedDuration" placeholder="请输入预计时长" style="width: 100%" @blur="expectedDuration()"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="实际时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realDuration"> <a-form-model-item label="实际时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="realDuration">
<a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%"/> <a-input-number v-model="model.realDuration" placeholder="请输入实际时长" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime"> <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="startTime">
<!-- <j-date placeholder="请选择开始时间" v-model="model.startTime" style="width: 100%"/>--> <!-- <j-date placeholder="请选择开始时间" v-model="model.startTime" style="width: 100%"/>-->
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.startTime" style="width: 100%"/> <a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.startTime" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitTime"> <a-form-model-item label="提交时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submitTime">
<!-- <j-date placeholder="请选择提交时间" v-model="model.submitTime" style="width: 100%"/>--> <!-- <j-date placeholder="请选择提交时间" v-model="model.submitTime" style="width: 100%"/>-->
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.submitTime" style="width: 100%"/> <a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" v-model="model.submitTime" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -193,13 +181,13 @@
<script> <script>
import store from '@/store' import store from '@/store'
import {httpAction, getAction} from '@api/manage' import { httpAction, getAction } from '@api/manage'
import {validateDuplicateValue} from '@/utils/util' import { validateDuplicateValue } from '@/utils/util'
import JVxeDateCell from "@comp/jeecg/JVxeTable/components/cells/JVxeDateCell"; import JVxeDateCell from "@comp/jeecg/JVxeTable/components/cells/JVxeDateCell";
import JMultiSelectTag from "@/components/dict/JMultiSelectTag" import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
import TaskModal from "@views/task/modules/TaskModal.vue"; import TaskModal from "@views/task/modules/TaskModal.vue";
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {mixinDevice} from "@/utils/mixin"; import { mixinDevice } from "@/utils/mixin";
import modulexModal from "@views/modulex/modules/ModulexModal__Style#Drawer.vue"; import modulexModal from "@views/modulex/modules/ModulexModal__Style#Drawer.vue";
import FunctionxModal from "@views/functionx/modules/FunctionxModal__Style#Drawer.vue"; import FunctionxModal from "@views/functionx/modules/FunctionxModal__Style#Drawer.vue";
import RulexModal from "@views/rulex/modules/RulexModal__Style#Drawer.vue"; import RulexModal from "@views/rulex/modules/RulexModal__Style#Drawer.vue";
@ -249,73 +237,73 @@ export default {
// sm: {span: 16}, // sm: {span: 16},
// }, // },
labelCol: { labelCol: {
xs: {span: 23}, xs: { span: 23 },
sm: {span: 6}, sm: { span: 6 },
}, },
wrapperCol: { wrapperCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 16}, sm: { span: 16 },
}, },
// //
labelCol1: { labelCol1: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 3}, sm: { span: 3 },
}, },
wrapperCol1: { wrapperCol1: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 21}, sm: { span: 21 },
}, },
// //
labelCol2: { labelCol2: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 3}, sm: { span: 3 },
}, },
wrapperCol2: { wrapperCol2: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 20}, sm: { span: 20 },
}, },
labelCol3: { labelCol3: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 7}, sm: { span: 7 },
}, },
wrapperCol3: { wrapperCol3: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 15}, sm: { span: 15 },
}, },
confirmLoading: false, confirmLoading: false,
validatorRules: { validatorRules: {
taskName: [ taskName: [
{required: true, message: '请输入中文名称!'}, { required: true, message: '请输入中文名称!' },
// {pattern: /^.{2,300}$/, message: '!'}, // {pattern: /^.{2,300}$/, message: '!'},
// {pattern: /^[0-9]{0,100}$/, message: ''} // {pattern: /^[0-9]{0,100}$/, message: ''}
], ],
level: [ level: [
{required: true, message: '任务层级不能为空!'}, { required: true, message: '任务层级不能为空!' },
], ],
typeId: [ typeId: [
{required: true, message: '任务类型不能为空!'}, { required: true, message: '任务类型不能为空!' },
], ],
workLevel: [ workLevel: [
{required: true, message: '任务等级不能为空!'}, { required: true, message: '任务等级不能为空!' },
], ],
workStatus: [ workStatus: [
{required: true, message: '任务状态不能为空!'}, { required: true, message: '任务状态不能为空!' },
], ],
projectId: [ projectId: [
{required: true, message: '项目不能为空!'}, { required: true, message: '项目不能为空!' },
], ],
managerUsers: [ managerUsers: [
{required: true, message: '责任人不能为空!'}, { required: true, message: '责任人不能为空!' },
], ],
expectedDuration: [ expectedDuration: [
{required: true, message: '请输入预计任务时长!'}, { required: true, message: '请输入预计任务时长!' },
{pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的时长!'}, { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的时长!' },
], ],
realDuration: [ realDuration: [
{required: false, message: '请输入实际任务时长!'}, { required: false, message: '请输入实际任务时长!' },
{pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的时长!'}, { pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的时长!' },
], ],
}, },
url: { url: {
@ -326,7 +314,8 @@ export default {
// queryTaskTypeById: "/taskType/taskType/queryById", // queryTaskTypeById: "/taskType/taskType/queryById",
fillTaskName: "/task/task/fillTaskName", fillTaskName: "/task/task/fillTaskName",
list: "/task/task/list", list: "/task/task/list",
listtasktype: '/taskType/taskType/getTypeMap' listtasktype: '/taskType/taskType/getTypeMap',
expectedDuration: '/task/task/estimateTime'
} }
} }
@ -343,6 +332,16 @@ export default {
this.tasktype() this.tasktype()
}, },
methods: { methods: {
expectedDuration() {
let param = {
startTime: this.model.startTime,
expectedDuration: this.model.expectedDuration,
}
getAction(this.url. expectedDuration, param).then((res) => {
this.model.expectedEndTime=res.result
})
},
tasktype() { tasktype() {
getAction(this.url.listtasktype).then((res) => { getAction(this.url.listtasktype).then((res) => {
const data = res.result; const data = res.result;
@ -353,9 +352,9 @@ export default {
}) })
}) })
}, },
popupCallback(value,row){ popupCallback(value, row) {
this.model = Object.assign(this.model, row); this.model = Object.assign(this.model, row);
}, },
handleCheckChange(data, checked, tree) { handleCheckChange(data, checked, tree) {
if (checked) { if (checked) {
this.currentNodeData.id = data.id this.currentNodeData.id = data.id
@ -369,7 +368,7 @@ export default {
} }
, ,
fillTaskName() { fillTaskName() {
this.modulex = "modulex,module_name,id,project_id='"+this.model.projectId+"'"; this.modulex = "modulex,module_name,id,project_id='" + this.model.projectId + "'";
let that = this; let that = this;
let fillTaskName = ""; let fillTaskName = "";
@ -396,8 +395,8 @@ export default {
} }
} }
, ,
fillLevelName(){ fillLevelName() {
this.task = "task,task_name,id,level='"+this.model.level+"'"; this.task = "task,task_name,id,level='" + this.model.level + "'";
} }
, ,
handleAdd3: function () { handleAdd3: function () {
@ -411,24 +410,24 @@ export default {
// this.$refs.modalForm1.title = ""; // this.$refs.modalForm1.title = "";
// this.$refs.modalForm1.disableSubmit = false; // this.$refs.modalForm1.disableSubmit = false;
// }, // },
handleAdd1(moduleId){ handleAdd1(moduleId) {
console.log(moduleId+"22222222222222") console.log(moduleId + "22222222222222")
this.$refs.modalForm1.add1(moduleId) this.$refs.modalForm1.add1(moduleId)
this.$refs.modalForm1.title = "新增"; this.$refs.modalForm1.title = "新增";
this.$refs.modalForm1.disableSubmit = false; this.$refs.modalForm1.disableSubmit = false;
}, },
handleAdd2: function (functionId,moduleId) { handleAdd2: function (functionId, moduleId) {
this.$refs.modalForm2.add1(functionId,moduleId); this.$refs.modalForm2.add1(functionId, moduleId);
this.$refs.modalForm2.title = "新增"; this.$refs.modalForm2.title = "新增";
this.$refs.modalForm2.disableSubmit = false; this.$refs.modalForm2.disableSubmit = false;
}, },
fillModuleName() { fillModuleName() {
this.functionx = "functionx,function_name,id,module_id='"+this.model.moduleId+"'"; this.functionx = "functionx,function_name,id,module_id='" + this.model.moduleId + "'";
}, },
fillFunctionName(){ fillFunctionName() {
this.rulex = "rulex,rule_no,id,function_id='"+this.model.functionId+"'"; this.rulex = "rulex,rule_no,id,function_id='" + this.model.functionId + "'";
}, },
// //
getProjectNum() { getProjectNum() {
const projectTime = new Date() // const projectTime = new Date() //
const Year = projectTime.getFullYear() // IE. const Year = projectTime.getFullYear() // IE.
@ -499,17 +498,18 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.a{ .a {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap:wrap; flex-wrap: wrap;
align-items: baseline; align-items: baseline;
} }
.B{
.B {
width: 10%; width: 10%;
} }
::v-deep .ant-radio-group{
::v-deep .ant-radio-group {
width: 85%; width: 85%;
} }
</style> </style>

@ -24,8 +24,7 @@ public class FunctionxTest implements Serializable {
/** /**
* 对应上级模块 * 对应上级模块
*/ */
@TableField("p_module_name") private String project;
private String pModuleName;
/** /**
* 对应模块 * 对应模块
@ -45,7 +44,7 @@ public class FunctionxTest implements Serializable {
/** /**
* 功能编码 * 功能编码
*/ */
private String functionCode; // private String functionCode;
/** /**
* 功能类型 * 功能类型

@ -23,13 +23,14 @@ import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.modulex.service.IModulexService; import org.jeecg.modules.modulex.service.IModulexService;
import org.jeecg.modules.projectUserRole.entity.ProjectUserRole; import org.jeecg.modules.projectUserRole.entity.ProjectUserRole;
import org.jeecg.modules.projectUserRole.service.IProjectUserRoleService; import org.jeecg.modules.projectUserRole.service.IProjectUserRoleService;
import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.tablex.vo.TablexVo;
import org.jeecg.modules.tablex.ws.WebSocketUtils; import org.jeecg.modules.tablex.ws.WebSocketUtils;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
@ -49,8 +50,11 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Autowired @Autowired
private WebSocketUtils webSocketUtils; private WebSocketUtils webSocketUtils;
@Autowired
private IProjectxService projectxService;
@Override @Override
@Transactional
public Result<?> importExcel(MultipartFile file) { public Result<?> importExcel(MultipartFile file) {
// 获取当前操作用户 // 获取当前操作用户
@ -137,46 +141,51 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
} }
//------------接收------------- //------------接收-------------
FunctionxTest fun = new FunctionxTest(); FunctionxTest fun = new FunctionxTest();
fun.setPModuleName(list.get(0)); fun.setProject(list.get(0)); // 对应项目
fun.setModuleName(list.get(1)); // 对应模块 fun.setModuleName(list.get(1)); // 对应模块
fun.setFunctionName(list.get(2)); // 中文名称 fun.setFunctionName(list.get(2)); // 中文名称
fun.setFunctionEnName(list.get(3)); // 英文名称 fun.setFunctionEnName(list.get(3)); // 英文名称
fun.setFunctionCode(list.get(4)); // 功能编码 // fun.setFunctionCode(list.get(4)); // 功能编码
fun.setFunctionType(list.get(5)); // 功能类型 fun.setFunctionType(list.get(4)); // 功能类型
fun.setPmDescribe(list.get(6)); // 功能描述 fun.setPmDescribe(list.get(5)); // 功能描述
fun.setUserRole(list.get(7)); // 用户角色 fun.setUserRole(list.get(6)); // 用户角色
fun.setManagerUsers(list.get(8)); // 责任人 fun.setManagerUsers(list.get(7)); // 责任人
fun.setWorkLevel(list.get(9)); // 任务等级 fun.setWorkLevel(list.get(8)); // 任务等级
fun.setWorkStatus(list.get(10)); // 任务状态 fun.setWorkStatus(list.get(9)); // 任务状态
fun.setPublishTime(list.get(11)); // 发布时间 fun.setPublishTime(list.get(10)); // 发布时间
fun.setStartTime(list.get(12)); // 开始时间 fun.setStartTime(list.get(11)); // 开始时间
fun.setDuration(list.get(13)); // 任务时长 fun.setDuration(list.get(12)); // 任务时长
fun.setSubmitTime(list.get(14)); // 提交时间 fun.setSubmitTime(list.get(13)); // 提交时间
fun.setRealDuration(list.get(15)); // 实际时长 fun.setRealDuration(list.get(14)); // 实际时长
fun.setStatus(list.get(16)); // 功能状态 fun.setStatus(list.get(15)); // 功能状态
fun.setVerisonStatus(list.get(17)); // 版本状态 fun.setVerisonStatus(list.get(16)); // 版本状态
fun.setVerison(list.get(18)); // 版本号 fun.setVerison(list.get(17)); // 版本号
fun.setCreatName(username); fun.setCreatName(username);
listVo.add(fun); listVo.add(fun);
} }
} }
boolean isSuccessSave = this.saveBatch(listVo);
if (!isSuccessSave) { LambdaQueryWrapper<FunctionxTest> queryWrapper = new LambdaQueryWrapper<>();
message.put("isError", "true"); queryWrapper.eq(username != null, FunctionxTest::getCreatName, username);
message.put("status", "文件读入失败");
message.put("closeable", "true"); int isSaveTestSuccess = saveTest(listVo);
webSocketUtils.sendMessage(loginUser.getId(), message); List<FunctionxTest> list = this.list(queryWrapper);
return Result.error("文件读入失败"); // if (isSaveTestSuccess != -1){
} // this.remove(queryWrapper);
// message.put("isError", "true");
// message.put("status", "第" + (isSaveTestSuccess+1) + "行中文名或英文名有重复");
// message.put("closeable", "true");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("中文名或英文名有重复");
// }
message.put("status", "数据校验"); message.put("status", "数据校验");
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
//************************具体字段校验****************************** //************************具体字段校验******************************
LambdaQueryWrapper<FunctionxTest> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(username != null, FunctionxTest::getCreatName, username);
List<FunctionxTest> list = this.list(queryWrapper);
boolean remove = this.remove(queryWrapper); boolean remove = this.remove(queryWrapper);
if (!remove) { if (!remove) {
@ -193,11 +202,11 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
FunctionxTest function = list.get(i); FunctionxTest function = list.get(i);
Functionx functionx = new Functionx(); Functionx functionx = new Functionx();
String pModuleId = function.getPModuleName(); String project = function.getProject();
String moduleId = function.getModuleName(); String moduleId = function.getModuleName();
String functionName = function.getFunctionName(); String functionName = function.getFunctionName();
String functionEnName = function.getFunctionEnName(); String functionEnName = function.getFunctionEnName();
String functionCode = function.getFunctionCode(); // String functionCode = function.getFunctionCode();
String functionType = function.getFunctionType(); String functionType = function.getFunctionType();
String pmDescribe = function.getPmDescribe(); String pmDescribe = function.getPmDescribe();
String userRole = function.getUserRole(); String userRole = function.getUserRole();
@ -214,8 +223,30 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
String verison = function.getVerison(); String verison = function.getVerison();
String moduleName = ""; // 模块编码 String moduleName = ""; // 模块编码
String moduleCode= ""; // 模块编码
functionx.setCreateBy(username); // 创建人 functionx.setCreateBy(username); // 创建人
functionx.setCreateTime(new Date()); //创建日期 functionx.setCreateTime(new Date()); //创建日期
if (StringUtils.isBlank(project)) {
message.put("isError", "true");
message.put("status", "第" + (i+1) + "行数据项目名称不能为空");
message.put("closeable", "true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("项目名称不能为空");
} else {
LambdaQueryWrapper<Projectx> projectxQueryWrapper =new LambdaQueryWrapper<>();
projectxQueryWrapper.eq(Projectx::getProjectName,project);
List<Projectx> list1 = projectxService.list(projectxQueryWrapper);
if (list1.size()==0){
message.put("isError", "true");
message.put("status", "第" + i + "行数据项目名称错误");
message.put("closeable", "true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("项目名称错误");
}
project = list1.get(0).getId(); // 此时project为项目id
}
if (StringUtils.isBlank(moduleId)) { if (StringUtils.isBlank(moduleId)) {
message.put("isError", "true"); message.put("isError", "true");
message.put("status", "第" + i + "行数据对应模块不能为空"); message.put("status", "第" + i + "行数据对应模块不能为空");
@ -223,30 +254,13 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("对应模块不能为空"); return Result.error("对应模块不能为空");
} else { } else {
if (pModuleId != null && pModuleId.length()>0) { for (Modulex modulex : modulexList) {
String pid = ""; if (modulex.getModuleName().equals(moduleId) && modulex.getProjectId().equals(project)) {
for (Modulex modulex : modulexList) { functionx.setModuleId(modulex.getId());
if (modulex.getModuleName().equals(pModuleId)) { moduleId = modulex.getId();
pid = modulex.getId(); moduleName = modulex.getModuleName();
break; moduleCode = modulex.getModuleCode();
} break;
}
for (Modulex modulex : modulexList) {
if (modulex.getModuleName().equals(moduleId) && modulex.getPid().equals(pid)) {
functionx.setModuleId(modulex.getId());
moduleId = modulex.getId();
moduleName = modulex.getModuleName();
break;
}
}
} else {
for (Modulex modulex : modulexList) {
if (modulex.getModuleName().equals(moduleId) && modulex.getPid() == null) {
functionx.setModuleId(modulex.getId());
moduleId = modulex.getId();
moduleName = modulex.getModuleName();
break;
}
} }
} }
if (functionx.getModuleId() == null) { if (functionx.getModuleId() == null) {
@ -342,30 +356,32 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
} }
functionx.setFunctionType(type); functionx.setFunctionType(type);
} }
// 模块编码+功能缩写;自动填充+手动修改 // 模块编码+功能缩写;自动填充+手动修改 // 改为自动生成
if (StringUtils.isBlank(functionCode)) { String firstChar = toFirstChar(functionName);
message.put("isError", "true"); String functionCode = moduleCode + firstChar;
message.put("status", "第" + (i+1) + "行数据数据功能编码不能为空"); functionx.setFunctionCode(functionCode);
message.put("closeable", "true"); // if (StringUtils.isBlank(functionCode)) {
webSocketUtils.sendMessage(loginUser.getId(), message); // message.put("isError", "true");
return Result.error("功能编码不能为空"); // message.put("status", "第" + (i+1) + "行数据数据功能编码不能为空");
} else { // message.put("closeable", "true");
LambdaQueryWrapper<Modulex> queryWrapperModulex = new LambdaQueryWrapper<>(); // webSocketUtils.sendMessage(loginUser.getId(), message);
queryWrapperModulex.eq(Modulex::getModuleName, moduleName); // return Result.error("功能编码不能为空");
Modulex modulex = modulexService.getOne(queryWrapperModulex); // } else {
String moduleCode = modulex.getModuleCode(); // LambdaQueryWrapper<Modulex> queryWrapperModulex = new LambdaQueryWrapper<>();
String firstChar = toFirstChar(functionType); // queryWrapperModulex.eq(Modulex::getModuleName, moduleName);
String str = moduleCode + firstChar; // Modulex modulex = modulexService.getOne(queryWrapperModulex);
if (!str.equals(functionCode)) { // String moduleCode = modulex.getModuleCode();
message.put("isError", "true"); // String firstChar = toFirstChar(functionName);
message.put("status", "第" + (i+1) + "行数据数据功能编码错误"); // String str = moduleCode + firstChar;
message.put("closeable", "true"); // if (!str.equals(functionCode)) {
webSocketUtils.sendMessage(loginUser.getId(), message); // message.put("isError", "true");
return Result.error("功能编码错误"); // message.put("status", "第" + (i+1) + "行数据数据功能编码错误");
} // message.put("closeable", "true");
// webSocketUtils.sendMessage(loginUser.getId(), message);
functionx.setFunctionCode(functionCode); // return Result.error("功能编码错误");
} // }
// functionx.setFunctionCode(functionCode);
// }
if (StringUtils.isNotBlank(pmDescribe)) { // 功能描述 if (StringUtils.isNotBlank(pmDescribe)) { // 功能描述
functionx.setPmDescribe(pmDescribe); functionx.setPmDescribe(pmDescribe);
@ -514,6 +530,13 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
if (StringUtils.isNotBlank(duration)) { if (StringUtils.isNotBlank(duration)) {
Double aDouble = Double.valueOf(duration); Double aDouble = Double.valueOf(duration);
if (aDouble <= 0){
message.put("isError", "true");
message.put("status", "第" + (i+1) + "行数据任务时长错误");
message.put("closeable", "true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("任务时长错误");
}
functionx.setDuration(aDouble); functionx.setDuration(aDouble);
} }
@ -609,6 +632,13 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
return Result.error("版本号不能为空"); return Result.error("版本号不能为空");
} else { } else {
Integer integer = Integer.valueOf(verison); Integer integer = Integer.valueOf(verison);
if (integer<1){
message.put("isError", "true");
message.put("status", "第" + (i+1) + "行数据数据版本号不能小于1");
message.put("closeable", "true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("版本号不能小于1");
}
functionx.setStatus(integer); functionx.setStatus(integer);
} }
@ -639,6 +669,18 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
return Result.OK("导入成功"); return Result.OK("导入成功");
} }
int saveTest(List<FunctionxTest> listVo) {
for (int i = 0; i < listVo.size(); i++) {
try {
this.save(listVo.get(i));
} catch (Exception e) {
return i;
}
}
return -1;
}
private boolean funCheck(List<String> list) { private boolean funCheck(List<String> list) {
for (int i=0;i<list.size();i++){ for (int i=0;i<list.size();i++){
if(list.get(i)!=null && list.get(i).length()>0){ if(list.get(i)!=null && list.get(i).length()>0){

@ -689,6 +689,7 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
message.put("isError", "true"); message.put("isError", "true");
message.put("status","单元格样式错误,请根据注意事项保证单元格样式正确"); message.put("status","单元格样式错误,请根据注意事项保证单元格样式正确");
message.put("closeable","true"); message.put("closeable","true");
fieldxService.remove(null);
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
} }
return Result.OK("文件上传成功"); return Result.OK("文件上传成功");

@ -9,10 +9,12 @@ import org.jeecg.modules.fieldx.service.IFieldxService;
import org.jeecg.modules.tablex.entity.Tablex; import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService; import org.jeecg.modules.tablex.service.ITablexService;
import org.jeecg.modules.tablex.ws.WebSocketUtils; import org.jeecg.modules.tablex.ws.WebSocketUtils;
import org.jsoup.helper.StringUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -24,7 +26,7 @@ import java.util.Map;
* @Version: V1.0 * @Version: V1.0
*/ */
@Transactional
@Service @Service
public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> implements IFieldxService { public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> implements IFieldxService {
@Autowired @Autowired
@ -39,11 +41,21 @@ public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> impleme
try { try {
Thread.sleep(500L); Thread.sleep(500L);
message.put("uploaded", String.valueOf(i + 1)); message.put("uploaded", String.valueOf(i + 1));
this.save(fieldxList.get(i)); Fieldx fieldx=fieldxList.get(i);
this.save(fieldx);
if(!StringUtil.isBlank(fieldx.getAssociateTable())||!StringUtil.isBlank(fieldx.getAssociateField())){
webSocketUtils.sendMessage(loginUser.getId(), message);
break;
}
Tablex tablex = tablexService.getById(fieldx.getTableId());
tablexService.updateVersion(fieldx.getTableId(), tablex.getVerison() + 1);
tablexService.updateSql(fieldx.getTableId(), fieldxController.createSql(fieldx.getTableId()));
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
} }
} }
} }

@ -401,13 +401,14 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if(cell==null){ if(cell==null){
propertyNames.add(null); propertyNames.add(null);
}else {
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
DataFormatter formatter = new DataFormatter();
//单元格不设置数字格式
cell.setCellStyle(null);
String name = formatter.formatCellValue(cell,evaluator);
propertyNames.add(name);
} }
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
DataFormatter formatter = new DataFormatter();
//单元格不设置数字格式
cell.setCellStyle(null);
String name = formatter.formatCellValue(cell,evaluator);
propertyNames.add(name);
} }
if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称") if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称")
|| !propertyNames.get(1).equals("项目名称") || !propertyNames.get(1).equals("项目名称")
@ -442,7 +443,11 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
String value=""; String value="";
if(cell!=null){ if(cell!=null){
value = cell.getStringCellValue(); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
DataFormatter formatter = new DataFormatter();
//单元格不设置数字格式
cell.setCellStyle(null);
value = formatter.formatCellValue(cell,evaluator);
} }
switch (k){ switch (k){
case 0: case 0:
@ -504,7 +509,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
modulexVo.setVerisonStatus(value); modulexVo.setVerisonStatus(value);
break; break;
case 17: case 17:
modulexVo.setVerison(value); modulexVo.setVerison(value);
break; break;
default: default:
message.put("isError", "true"); message.put("isError", "true");
@ -663,14 +668,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,英文名称不能为空"); return Result.error("导入失败,英文名称不能为空");
}modulex.setModuleEnName(moduleEnName); }modulex.setModuleEnName(moduleEnName);
// String moduleCode = modulexTemplate.getModuleCode();
// if(moduleCode==null||moduleCode.length()>30){
// message.put("isError", "true");
// message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不能为空或者模块编码过长");
// message.put("closeable","true");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("导入失败,模块编码不能为空或者模块编码过长");
// }
String modulecode = null; String modulecode = null;
LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Projectx::getProjectName,projectId); queryWrapper.eq(Projectx::getProjectName,projectId);
@ -685,13 +682,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
return Result.error("导入失败,模块对应的项目编码不存在,请完善对应项目里的项目编码后,重新导入"); return Result.error("导入失败,模块对应的项目编码不存在,请完善对应项目里的项目编码后,重新导入");
} }
modulecode = projectCode + firstChar; modulecode = projectCode + firstChar;
// if(!modulecode.equals(moduleCode)){
// message.put("isError", "true");
// message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不规范,导入失败");
// message.put("closeable","true");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("模块编码不规范,导入失败");
// }
modulex.setModuleCode(modulecode); modulex.setModuleCode(modulecode);
String pmDescribe = modulexTemplate.getPmDescribe(); String pmDescribe = modulexTemplate.getPmDescribe();
if(StringUtils.isBlank(pmDescribe)){ if(StringUtils.isBlank(pmDescribe)){
@ -710,7 +700,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
modulex.setManagerUsers(null); modulex.setManagerUsers(null);
}else { }else {
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
String[] split = managerUsers.split(","); String[] split = managerUsers.split("\\s+|,|;|,|、");
List<String> managerUserName= Arrays.stream(split).map(String::valueOf).collect(Collectors.toList()); List<String> managerUserName= Arrays.stream(split).map(String::valueOf).collect(Collectors.toList());
sysUserLambdaQueryWrapper.in(SysUser::getUsername,managerUserName); sysUserLambdaQueryWrapper.in(SysUser::getUsername,managerUserName);
List<SysUser> iSysUserServiceOne = iSysUserService.list(sysUserLambdaQueryWrapper); List<SysUser> iSysUserServiceOne = iSysUserService.list(sysUserLambdaQueryWrapper);
@ -729,7 +719,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,责任人信息查询不到"); return Result.error("导入失败,责任人信息查询不到");
} }
// String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]");
String s = ""; String s = "";
for (int j = 0; j < list.size(); j++) { for (int j = 0; j < list.size(); j++) {
s = s + list.get(j); s = s + list.get(j);

@ -361,6 +361,7 @@ public class TaskController extends JeecgController<Task, ITaskService> {
/** /**
* 提交任务更新状态同时计算实际任务时长 * 提交任务更新状态同时计算实际任务时长
* 计算一整天之后算头和尾时间 * 计算一整天之后算头和尾时间
* 任务时长单位是小时填写预计任务时长后自动计算结束时间跨天每天按7小时计算每天上午8点半开始到12点下午2点半开始到6点
* @param task * @param task
* @return * @return
*/ */
@ -453,7 +454,10 @@ public class TaskController extends JeecgController<Task, ITaskService> {
workTime += endTime.getTime() - date3.getTime(); workTime += endTime.getTime() - date3.getTime();
return workTime; return workTime;
}else { }else {
//时间跨度没有超过两天 //时间跨度没有超过两天
if (startTime.compareTo(date4) >= 0)
return workTime; //任务是下午下班之后发布的,且是下班之后提交的,没有多余工作时间
if (startTime.compareTo(date1) <= 0) if (startTime.compareTo(date1) <= 0)
startTime = date1; //发布任务在8点之前 startTime = date1; //发布任务在8点之前
if (startTime.compareTo(date2) <= 0){ if (startTime.compareTo(date2) <= 0){
@ -484,6 +488,7 @@ public class TaskController extends JeecgController<Task, ITaskService> {
/** /**
* 计算预计结束时间 * 计算预计结束时间
* 任务时长单位是小时填写预计任务时长后自动计算结束时间跨天每天按7小时计算每天上午8点半开始到12点下午2点半开始到6点
* @param task * @param task
* @return * @return
*/ */
@ -530,6 +535,11 @@ public class TaskController extends JeecgController<Task, ITaskService> {
long tempTime = 0; long tempTime = 0;
if (startTime.compareTo(date1) <= 0) if (startTime.compareTo(date1) <= 0)
startTime = date1; //任务发布在8点半之前,修正时间 startTime = date1; //任务发布在8点半之前,修正时间
if (startTime.compareTo(date4) >= 0){
startTime = date1; //任务发布在晚上下班后,修正到第二天早上上班时间
offset ++;
}
if (startTime.compareTo(date2) < 0){ if (startTime.compareTo(date2) < 0){
//上午发布任务 //上午发布任务
tempTime = date2.getTime() - startTime.getTime(); tempTime = date2.getTime() - startTime.getTime();
@ -547,6 +557,8 @@ public class TaskController extends JeecgController<Task, ITaskService> {
tempTime = date4.getTime() - startTime.getTime(); tempTime = date4.getTime() - startTime.getTime();
if (tempTime >= millisecond) if (tempTime >= millisecond)
return new Date(startTime.getTime() + millisecond + DAYTIME*offset); return new Date(startTime.getTime() + millisecond + DAYTIME*offset);
else
millisecond -= tempTime;
} }
//时间修正,天数偏移量加1,到这里有两中情况,1、白天工作时间不足抵消 2、下午6点之后发布任务 //时间修正,天数偏移量加1,到这里有两中情况,1、白天工作时间不足抵消 2、下午6点之后发布任务
offset ++; offset ++;
@ -557,6 +569,7 @@ public class TaskController extends JeecgController<Task, ITaskService> {
return new Date(startTime.getTime() + millisecond + DAYTIME*offset); return new Date(startTime.getTime() + millisecond + DAYTIME*offset);
//上午偏移不足,下午一定够,因为不会跨两天 //上午偏移不足,下午一定够,因为不会跨两天
millisecond -= tempTime; millisecond -= tempTime;
startTime = date3;
return new Date(startTime.getTime() + millisecond + DAYTIME*offset); return new Date(startTime.getTime() + millisecond + DAYTIME*offset);
} }

Loading…
Cancel
Save