Mr.Shi
2023-08-16 d044dc871c16f05c9a1fb1489621020c91ec9d59
Merge branch 'master' of ssh://139.186.142.91:29418/productDev/dmMes
已添加15个文件
已删除1个文件
已修改65个文件
2953 ■■■■ 文件已修改
.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/.env.development 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/components/business/OperaClientMangerWindow.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/components/system/menu/OperaMenuH5Window.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/components/system/permission/OperaPermissionWindow.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/views/system/menuH5.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/views/system/permission.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
platform_web/src/views/system/permissionCom.vue 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/business/SalaryParamController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/business/UnqualifiedRecordController.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/CategoryExtController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/PlansExtController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/api/ext/WorkorderRecordExtController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/biz/system/impl/SystemMenuBizImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/config/shiro/ShiroRealm.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/core/utils/excel/EasyExcelUtil.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/UnqualifiedRecordMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/dto/AutoWorkReportDTO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/dto/CreateUnqualifiedDTO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/model/Plans.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/model/SalaryParam.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/model/UnqualifiedRecord.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/model/Workorder.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/vo/SalaryParamVO.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/business/vo/WorkPlansVO.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/beanDto/QueryWStockDto.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/dto/QueryBomDetailExtDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/dto/QueryBomExtDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/dto/QueryPlansExtDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/dto/QueryUserSalaryListDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/dto/SalaryParamImportDTO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/vo/BomExtListVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/vo/CompanyExtListVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/dao/ext/vo/PlansExtListVO.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/UnqualifiedRecordService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/CompanyOpenServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/UnqualifiedRecordServiceImpl.java 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/business/impl/WOutboundServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/CategoryExtService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/WorkorderRecordStandardService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/CategoryExtServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/CompanyExtServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/DepartmentExtServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/WorkorderExtServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java 364 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/PlansExtMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/SalaryParamMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/UserDeviceExtMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/WorkPlansExtMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/mappers/WorkorderRecordExtMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/.env.development 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/.env.production 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/coderd.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/public/salary_import_template.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/api/business/salaryParam.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/api/ext/salaryStatistic.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/api/ext/userSalary.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/assets/style/lib.css 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/assets/style/style.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/business/OperaSalaryParamWindow.vue 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/common/Header.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/ext/OperaWorkorderDetailWindow.vue 217 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/ext/OrderDistrubution.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/ext/OrderQrCodeLabel.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/ext/addProcesRoute.vue 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/utils/form.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/business/salaryParam.vue 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/business/workPlans.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/plansExt.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/salaryStatistic.vue 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/userSalary.vue 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/workingorderExt.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/workorderPutRecordExt.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/views/ext/workorderRecordExt.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -10,3 +10,4 @@
/web_standard/doumeeplant_web
/web_standard/.vscode
.idea
.DS_Store
platform_web/.env.development
@@ -13,20 +13,11 @@
# æŽ¥å£å‰ç¼€
VUE_APP_API_PREFIX = ''
#测试服务器
# VUE_APP_BASE_URL = 'http://139.186.142.91:10012/'
#汇智
#VUE_APP_BASE_URL = 'https://106.14.220.133:10012/'
#任康本地
# VUE_APP_BASE_URL = 'http://192.168.0.15:10012/'
# VUE_APP_BASE_URL = 'https://hsky.doumee.com/doumeeplant_api/'
#江萍本地
#VUE_APP_BASE_URL = 'http://192.168.0.12:10012/'
#VUE_APP_BASE_URL = 'http://192.168.0.36:10021/'
#刘磊磊本地
#VUE_APP_BASE_URL = 'http://192.168.0.18:10012/'
#VUE_APP_BASE_URL = 'http://192.168.0.176:10012/'
#VUE_APP_BASE_URL = 'http://6201h1b706.zicp.fun:19470/'
VUE_APP_BASE_URL = 'http://192.168.0.18:10021/'
VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
# VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
platform_web/src/components/business/OperaClientMangerWindow.vue
@@ -217,6 +217,7 @@
        this.form.fileurlfull = this.form.fileStoreAddr ? this.form.fileurlfull : ''
      })
    },
    typeChange() {
      let tempDate = new Date();
      tempDate.setDate(tempDate.getDate() + (this.form.oepnType ? 365 : 15))
platform_web/src/components/system/menu/OperaMenuH5Window.vue
@@ -29,7 +29,7 @@
            @uploadBegin="isUploading=true"
          />
          <div style="display: flex; flex-direction: column-reverse;" v-if="!!form.icon">
            <el-button style="margin-left: 5px; padding: 0 5px;" type="text" @click="form.icon=''">删除</el-button>
            <el-button style="margin-left: 5px; padding: 0 5px;" type="text" @click="deletePic">删除</el-button>
          </div>
        </div>
      </el-form-item>
@@ -59,7 +59,8 @@
      // éœ€æŽ’除选择的菜单ID
      excludeMenuId: null,
      uploadData: {
        floader: 'company/menu'
        // floader: 'company/menu'
        folder: 'company/menu'
      },
      parent: {},
      // è¡¨å•数据
@@ -98,7 +99,6 @@
      debugger
      this.title = title
      
      console.log('-----',parent);
      this.visible = true
      // æ–°å»ºï¼Œmenu为空时表示新建菜单
      if (target == null) {
@@ -109,6 +109,7 @@
          this.form.id = null
          this.form.parentId = parent == null ? null : parent.id
          this.parentName = parent == null ? null : parent.name
          this.form.fullIcon = ''
        })
        return
      }
@@ -124,6 +125,10 @@
    uploadReverseSuccess(file) {
      this.form.icon = file.imgurl;
      this.form.fullIcon = file.imgurlfull;
    },
    deletePic() {
      this.form.fullIcon=''
      this.form.icon=''
    }
  },
}
platform_web/src/components/system/permission/OperaPermissionWindow.vue
@@ -26,6 +26,12 @@
  name: 'OperaPermissionWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  props: {
    type: {
      type: Number|String,
      default: 0
    }
  },
  data () {
    return {
      // åŽŸæƒé™ç 
@@ -58,6 +64,7 @@
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
          this.form.type = this.type
        })
        return
      }
@@ -67,6 +74,7 @@
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        this.form.type = this.type
      })
    },
    confirm () {
platform_web/src/views/system/menuH5.vue
@@ -23,7 +23,7 @@
        <el-table-column prop="name" label="菜单名称"  fixed="left" align="center" min-width="160px"></el-table-column>
        <el-table-column prop="icon" label="图标" align="center" min-width="80px" class-name="table-column-icon">
          <template slot-scope="{row}">
            <el-image v-if="row.icon != null && row.icon !== ''" style="width: 40px; height: 40px;" :src="row.icon"></el-image>
            <el-image v-if="row.icon != null && row.icon !== ''" style="width: 40px; height: 40px;" :src="row.resourcePath + row.icon"></el-image>
            <template v-else>未设置</template>
          </template>
        </el-table-column>
platform_web/src/views/system/permission.vue
@@ -60,7 +60,7 @@
      ></pagination>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaPermissionWindow ref="operaPermissionWindow" @success="handlePageChange"/>
    <OperaPermissionWindow ref="operaPermissionWindow" :type="0" @success="handlePageChange"/>
  </TableLayout>
</template>
platform_web/src/views/system/permissionCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,99 @@
<template>
  <TableLayout :permissions="['system:permission:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="权限编码" prop="code">
        <el-input v-model="searchForm.code" v-trim placeholder="请输入权限编码" @keypress.enter.native="search"/>
      </el-form-item>
      <el-form-item label="权限名称" prop="name">
        <el-input v-model="searchForm.name" v-trim placeholder="请输入权限名称" @keypress.enter.native="search"/>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['system:permission:create', 'system:permission:delete']">
        <li><el-button type="primary" @click="$refs.operaPermissionWindow.open('新建系统权限')" icon="el-icon-plus" v-permissions="['system:permission:create']">新建</el-button></li>
        <li><el-button @click="deleteByIdInBatch" v-permissions="['system:permission:delete']">删除</el-button></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        :default-sort = "{prop: 'createTime', order: 'descending'}"
        stripe
        border
        @selection-change="handleSelectionChange"
        @sort-change="handleSortChange"
      >
        <el-table-column type="selection" fixed="left" align="center" width="55"></el-table-column>
        <el-table-column prop="code" label="权限编码" fixed="left" align="center" min-width="200px"></el-table-column>
        <el-table-column prop="name" label="权限名称" fixed="left" align="center" min-width="120px"></el-table-column>
        <el-table-column prop="remark" label="权限备注" align="center" min-width="120px"></el-table-column>
        <el-table-column prop="createUser" label="创建人" align="center" min-width="100px">
          <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" align="center" min-width="140px" sortable="custom" sort-by="perm.CREATE_TIME"></el-table-column>
        <el-table-column prop="updateUser" label="更新人" align="center" min-width="100px">
          <template slot-scope="{row}">{{row.updateUserInfo == null ? '' : row.updateUserInfo.username}}</template>
        </el-table-column>
        <el-table-column prop="updateTime" label="更新时间" align="center" min-width="140px"></el-table-column>
        <el-table-column
          v-if="containPermissions(['system:permission:update', 'system:permission:delete'])"
          label="操作"
          align="center"
          min-width="130"
          fixed="right"
        >
          <template slot-scope="{row}">
            <el-button v-if="!row.fixed" type="text" @click="$refs.operaPermissionWindow.open('编辑系统权限', row)"  v-permissions="['system:permission:update']">编辑</el-button>
            <el-button v-if="!row.fixed" type="text" @click="deleteById(row)" style="color: red" v-permissions="['system:permission:delete']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      ></pagination>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaPermissionWindow ref="operaPermissionWindow" :type="1" @success="handlePageChange"/>
  </TableLayout>
</template>
<script>
import Pagination from '@/components/common/Pagination'
import TableLayout from '@/layouts/TableLayout'
import BaseTable from '@/components/base/BaseTable'
import OperaPermissionWindow from '@/components/system/permission/OperaPermissionWindow'
export default {
  name: 'SystemPermission',
  extends: BaseTable,
  components: { OperaPermissionWindow, TableLayout, Pagination },
  data () {
    return {
      // æœç´¢
      searchForm: {
        code: '',
        name: '',
        remark: '',
        type: 1
      }
    }
  },
  created () {
    this.config({
      module: '权限',
      api: '/system/permission',
      sorts: [{
        property: 'perm.CREATE_TIME',
        direction: 'DESC'
      }]
    })
    this.search()
  }
}
</script>
server/src/main/java/doumeemes/api/business/SalaryParamController.java
@@ -11,13 +11,21 @@
import doumeemes.dao.ext.dto.SalaryParamDTO;
import doumeemes.service.business.SalaryParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@@ -89,4 +97,24 @@
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(salaryParamService.findById(id));
    }
    @ApiOperation(value = "批量导入计划", notes = "批量导入计划", httpMethod = "POST", position = 6)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "folder", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class),
    })
    @PostMapping(value = "/importBatch", headers = "content-type=multipart/form-data")
//    @RequiresPermissions("business:salaryparam:create")
    public ApiResponse importBatch(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception {
        CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver();
        if (multipartResovler.isMultipart(request)) {
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Iterator<String> it = multipartRequest.getFileNames();
            while (it.hasNext()) {
                MultipartFile file = multipartRequest.getFile((String) it.next());
                salaryParamService.importPlans(file);
                break;
            }
        }
        return ApiResponse.success( null);
    }
}
server/src/main/java/doumeemes/api/business/UnqualifiedRecordController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package doumeemes.api.business;
import doumeemes.api.BaseController;
import doumeemes.core.annotation.excel.ExcelExporter;
import doumeemes.core.annotation.pr.PreventRepeat;
import doumeemes.core.model.ApiResponse;
import doumeemes.core.model.PageWrap;
import doumeemes.core.model.PageData;
import doumeemes.dao.business.model.UnqualifiedRecord;
import doumeemes.service.business.UnqualifiedRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author æ±Ÿè¹„蹄
 * @since 2023/08/16 14:15
 */
@Api(tags = "工单类-报工不良记录类型表")
@RestController
@RequestMapping("/business/unqualifiedRecord")
public class UnqualifiedRecordController extends BaseController {
    @Autowired
    private UnqualifiedRecordService unqualifiedRecordService;
    @PreventRepeat
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:unqualifiedrecord:create")
    public ApiResponse create(@RequestBody UnqualifiedRecord unqualifiedRecord) {
        return ApiResponse.success(unqualifiedRecordService.create(unqualifiedRecord));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
    @RequiresPermissions("business:unqualifiedrecord:delete")
    public ApiResponse deleteById(@PathVariable Integer id) {
        unqualifiedRecordService.deleteById(id);
        return ApiResponse.success(null);
    }
    @ApiOperation("根据ID修改")
    @PostMapping("/updateById")
    @RequiresPermissions("business:unqualifiedrecord:update")
    public ApiResponse updateById(@RequestBody UnqualifiedRecord unqualifiedRecord) {
        unqualifiedRecordService.updateById(unqualifiedRecord);
        return ApiResponse.success(null);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:unqualifiedrecord:query")
    public ApiResponse<PageData<UnqualifiedRecord>> findPage (@RequestBody PageWrap<UnqualifiedRecord> pageWrap) {
        return ApiResponse.success(unqualifiedRecordService.findPage(pageWrap));
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:unqualifiedrecord:query")
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(unqualifiedRecordService.findById(id));
    }
}
server/src/main/java/doumeemes/api/ext/CategoryExtController.java
@@ -154,6 +154,15 @@
        return ApiResponse.success(categoryExtService.findPage(pageWrap));
    }
    @ApiOperation("列表查询")
    @PostMapping("/list")
    @RequiresPermissions("ext:categoryext:query")
    public ApiResponse<List<CategoryExtListVO>> list(@RequestBody QueryCategoryExtDTO queryCategoryExtDTO) {
        queryCategoryExtDTO.setDeleted(Constants.ZERO);
        queryCategoryExtDTO.setRootDepartId(getLoginUser().getRootDepartment().getId());
        return ApiResponse.success(categoryExtService.findList(queryCategoryExtDTO));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("ext:categoryext:exportExcel")
server/src/main/java/doumeemes/api/ext/PlansExtController.java
@@ -3,6 +3,7 @@
import doumeemes.config.rocketmq.MqConfig;
import doumeemes.config.rocketmq.RocketMessageProducer;
import doumeemes.core.utils.DateUtil;
import doumeemes.dao.business.dto.AutoWorkReportDTO;
import doumeemes.dao.business.model.Workorder;
import doumeemes.dao.ext.vo.PlansExtListCountVO;
import doumeemes.dao.ext.vo.PlansExtListH5VO;
@@ -187,6 +188,7 @@
        plansExtService.backByIdInBatch(idList);
        return ApiResponse.success(null);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("ext:plansext:query")
@@ -221,6 +223,13 @@
        return ApiResponse.success(plansExtService.pageCount(param));
    }
    @ApiOperation("一键报工")
    @PostMapping("/autoWorkReport")
    public ApiResponse autoWorkReport (@RequestBody AutoWorkReportDTO autoWorkReportDTO) {
        plansExtService.autoWorkReport(getLoginUser(),autoWorkReportDTO);
        return ApiResponse.success("操作成功");
    }
    /**
     * æ‰¹é‡å¯¼å…¥è®¡åˆ’
     *
server/src/main/java/doumeemes/api/ext/SalaryParamExtController.java
@@ -76,6 +76,14 @@
        return ApiResponse.success(null);
    }
    @ApiOperation("根据对象信息查询")
    @PostMapping("/queryOne")
    @RequiresPermissions("business:salaryparam:query")
    public ApiResponse<SalaryParam> queryOne(@RequestBody SalaryParam salaryParam) {
        SalaryParam data = salaryParamService.findOne(salaryParam);
        return ApiResponse.success(data);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:salaryparam:query")
server/src/main/java/doumeemes/api/ext/WorkorderRecordExtController.java
@@ -224,6 +224,10 @@
        return ApiResponse.success(workorderRecordStandardService.choiceStockPageForWorkorder(pageWrap,getLoginUser()));
    }
    @ApiOperation("根据供需计划查询可用库存")
    @PostMapping("/getStockByPlansForStandard")
    public ApiResponse<PageData<WStockExtListVO>> getStockByPlansForStandard (@RequestBody PageWrap<QueryWStockDto> pageWrap) {
        return ApiResponse.success(workorderRecordStandardService.choiceStockPageForPlans(pageWrap,getLoginUser()));
    }
}
server/src/main/java/doumeemes/biz/system/impl/SystemMenuBizImpl.java
@@ -113,7 +113,7 @@
        String rPath =systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.MENU_IMG).getCode();
        for (SystemMenu menu : menus) {
            if(Constants.equalsInteger(menu.getType(),Constants.PlatType.companyH5) && StringUtils.isNotBlank(menu.getIcon())){
                menu.setIcon(rPath+menu.getIcon());
                menu.setIcon(menu.getIcon());
                menu.setResourcePath(rPath);
            }
            if (menu.getParentId() == null) {
@@ -126,7 +126,7 @@
        menus.removeIf(menu -> menu.getParentId() == null);
        for (SystemMenuListVO child : rootMenus) {
            if(Constants.equalsInteger(child.getType(),Constants.PlatType.companyH5) && StringUtils.isNotBlank(child.getIcon())){
                child.setIcon(rPath+child.getIcon());
                child.setIcon(child.getIcon());
                child.setResourcePath(rPath);
            }
            this.fillChildren(child, menus);
server/src/main/java/doumeemes/config/shiro/ShiroRealm.java
@@ -37,6 +37,7 @@
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
 * è‡ªå®šä¹‰Realm,处理认证和权限
@@ -130,8 +131,10 @@
            if(com == null){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该账户异常!");
            }
            if(com.getOepnValidDate().before(new Date())){
            if(Constants.equalsInteger( com.getStatus(),Constants.ZERO) ){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过禁用!");
            }
            if(com.getOepnValidDate() != null && com.getOepnValidDate().before(new Date())){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该企业已过使用有效期!");
            }
            //如果是企业用户
server/src/main/java/doumeemes/core/utils/excel/EasyExcelUtil.java
@@ -87,6 +87,9 @@
    }
    /**
     *
     * titleRows : æ ‡é¢˜å å‡ è¡Œ
     * headerRows : åŒå å‡ è¡Œ
     * excel常规导入(默认只读取第一张sheet工作簿)
     */
    public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass){
@@ -150,4 +153,4 @@
        }
        return list;
    }
}
}
server/src/main/java/doumeemes/dao/business/UnqualifiedRecordMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package doumeemes.dao.business;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import doumeemes.dao.business.model.UnqualifiedRecord;
/**
 * @author æ±Ÿè¹„蹄
 * @since 2023/08/16 14:15
 */
public interface UnqualifiedRecordMapper extends BaseMapper<UnqualifiedRecord> {
}
server/src/main/java/doumeemes/dao/business/dto/AutoWorkReportDTO.java
@@ -1,5 +1,7 @@
package doumeemes.dao.business.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import doumeemes.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -18,10 +20,20 @@
    @ApiModelProperty(value = "工序计划主键")
    private Integer plansId;
    @ApiModelProperty(value = "设备主键", example = "1")
    private Integer proGroupId;
    @ApiModelProperty(value = "生产人员编码集合" )
    @TableField(exist = false)
    private List<Integer> proUserList;
    @ApiModelProperty(value = "投料记录")
    private List<MaterialListDTO> recordList ;
    @ApiModelProperty(value = "产出记录")
    private CreateWorkorderRecordDTO createWorkorderRecordDTO;
    @ApiModelProperty(value = "不良品分类记录")
    private List<CreateUnqualifiedDTO> createUnqualifiedDTOList ;
}
server/src/main/java/doumeemes/dao/business/dto/CreateUnqualifiedDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package doumeemes.dao.business.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2022/05/12 10:18
 */
@Data
public class CreateUnqualifiedDTO {
    @ApiModelProperty(value = "不良类别主键"  )
    private Integer categoryId;
    @ApiModelProperty(value = "检验不合格数量")
    private BigDecimal unQualifiedNum;
}
server/src/main/java/doumeemes/dao/business/model/Plans.java
@@ -3,6 +3,7 @@
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import doumeemes.core.annotation.excel.ExcelColumn;
import doumeemes.dao.ext.vo.BomExtListVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -160,4 +161,7 @@
    @ApiModelProperty(value = "成品计划主键(关联work_plans表)", example = "1")
    private Integer workPlansId;
    @ApiModelProperty(value = "关联BOM对象",hidden = true)
    @TableField(exist = false)
    private BomExtListVO bomModel;
}
server/src/main/java/doumeemes/dao/business/model/SalaryParam.java
@@ -83,7 +83,7 @@
    @ApiModelProperty(value = "标准时长(秒)")
    @ExcelColumn(name="标准时长(秒)")
    private String times;
    private Integer times;
    @ApiModelProperty(value = "不良品是否计入 0否 1是")
    @ExcelColumn(name="不良品是否计入 0否 1是")
server/src/main/java/doumeemes/dao/business/model/UnqualifiedRecord.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
package doumeemes.dao.business.model;
import doumeemes.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.math.BigDecimal;
/**
 * å·¥å•ç±»-报工不良记录类型表
 * @author æ±Ÿè¹„蹄
 * @since 2023/08/16 14:15
 */
@Data
@ApiModel("工单类-报工不良记录类型表")
@TableName("`unqualified_record`")
public class UnqualifiedRecord {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "是否已删除 0未删除 1已删除", example = "1")
    @ExcelColumn(name="是否已删除 0未删除 1已删除")
    private Integer deleted;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer createUser;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer updateUser;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "主组织编码(关联department表根组织)", example = "1")
    @ExcelColumn(name="主组织编码(关联department表根组织)")
    private Integer rootDepartId;
    @ApiModelProperty(value = "公司级组织编码(关联department表)", example = "1")
    @ExcelColumn(name="公司级组织编码(关联department表)")
    private Integer departId;
    @ApiModelProperty(value = "工单主键", example = "1")
    @ExcelColumn(name="工单主键")
    private Integer workorderId;
    @ApiModelProperty(value = "产出记录主键", example = "1")
    @ExcelColumn(name="产出记录主键")
    private Integer recordId;
    @ApiModelProperty(value = "类别主键", example = "1")
    @ExcelColumn(name="类别主键")
    private Integer categoryId;
    @ApiModelProperty(value = "检验不合格数量", example = "1")
    @ExcelColumn(name="检验不合格数量")
    private BigDecimal unqualifiedNum;
}
server/src/main/java/doumeemes/dao/business/model/Workorder.java
@@ -225,30 +225,4 @@
    @TableField(exist = false)
    private List<WorkorderUser>  workorderUserList;
    @ApiModelProperty(value = "报工时长(秒)", example = "1")
    @ExcelColumn(name="报工时长(秒)")
    private Integer duration;
    @ApiModelProperty(value = "工资结果(元)", example = "1")
    @ExcelColumn(name="工资结果(元)")
    private Integer salary;
    @ApiModelProperty(value = "工资单价(元)", example = "1")
    @ExcelColumn(name="工资单价(元)")
    private Integer salaryPrice;
    @ApiModelProperty(value = "标准数量", example = "1")
    @ExcelColumn(name="标准数量")
    private Integer salaryNum;
    @ApiModelProperty(value = "标准时长(秒)")
    @ExcelColumn(name="标准时长(秒)")
    private String salaryTimes;
    @ApiModelProperty(value = "不良品是否计入 0否 1是", example = "1")
    @ExcelColumn(name="不良品是否计入 0否 1是")
    private Integer salaryUnqualified;
    @ApiModelProperty(value = "计价方式 0计件 1计时", example = "1")
    @ExcelColumn(name="计价方式 0计件 1计时")
    private Integer salaryType;
}
server/src/main/java/doumeemes/dao/business/vo/SalaryParamVO.java
@@ -14,14 +14,15 @@
public class SalaryParamVO {
    @ApiModelProperty(value = "主键")
    @ExcelColumn(name="序号",index = 1)
    private Integer id;
    @ApiModelProperty(value = "创建人编码")
    @ExcelColumn(name="创建人编码")
    @ExcelColumn(name="创建人编码",index = 11)
    private String createUserName;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @ExcelColumn(name="创建时间",index = 10, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @ApiModelProperty(value = "主组织编码(关联department表根组织)")
@@ -39,42 +40,42 @@
    private Integer procedureId;
    @ApiModelProperty(value = "工序编码(关联procedure表)")
    @ExcelColumn(name="工序编码(关联procedure表)")
//    @ExcelColumn(name="工序编码(关联procedure表)")
    @NotEmpty(message = "工序编码不能为空")
    private Integer procedureCode;
    @ApiModelProperty(value = "工序编码(关联procedure表)")
    @ExcelColumn(name="工序编码(关联procedure表)")
    @ExcelColumn(name="工序名称",index =5)
    private String procedureName;
    @ApiModelProperty(value = "产品名称" )
    @Excel(name="产品名称",orderNum ="3")
    @ExcelColumn(name="物料名称",index =3)
    private String materialName;
    @ApiModelProperty(value = "产品编码" )
    @Excel(name="产品编码",orderNum ="4")
    @ExcelColumn(name="物料编码",index =4)
    private String materialCode;
    @ApiModelProperty(value = "物料编码(关联material_distribute表)", example = "1")
    private Integer materialId;
    @ApiModelProperty(value = "工资单价(元)")
    @ExcelColumn(name="工资单价(元)")
    @ExcelColumn(name="工资单价(元)",index =6)
    private BigDecimal salary;
    @ApiModelProperty(value = "标准数量")
    @ExcelColumn(name="标准数量")
    @ExcelColumn(name="标准产出",index =7)
    private Integer num;
    @ApiModelProperty(value = "标准时长(秒)")
    @ExcelColumn(name="标准时长(秒)")
    @ExcelColumn(name="标准时长(秒)",index =8)
    private String times;
    @ApiModelProperty(value = "不良品是否计入 0否 1是")
    @ExcelColumn(name="不良品是否计入 0否 1是")
    @ExcelColumn(name="不良品是否计入 0否 1是",index = 9 ,valueMapping = "0=否;1=是")
    private Integer unqualified;
    @ApiModelProperty(value = "计价方式 0计件 1计时")
    @ExcelColumn(name="计价方式 0计件 1计时")
    @ExcelColumn(name="计价方式",index = 2 ,valueMapping = "0=计件;1=计时")
    private Integer type;
}
server/src/main/java/doumeemes/dao/business/vo/WorkPlansVO.java
@@ -57,7 +57,7 @@
    private Integer factoryId;
    @ApiModelProperty(value = "工厂名称", example = "1")
    @ExcelColumn(name="工厂名称",index = 4,width =15)
    @ExcelColumn(name="工厂名称",index = 5,width =15)
    private String factoryName;
    @ApiModelProperty(value = "来源 0人工创建、1Excel导入", example = "1")
@@ -67,12 +67,12 @@
    @ExcelColumn(name="计划编码",index = 0,width =15)
    private String planCode;
    @ApiModelProperty(value = "计划日期")
    @ExcelColumn(name="计划日期",index = 3,width =15)
    @ApiModelProperty(value = "计划完成日期")
    @ExcelColumn(name="计划日期",index = 4,width =15)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planDate;
    @ApiModelProperty(value = "计划开始日期")
    @ExcelColumn(name="计划开始日期",index = 17,width =15)
    @ExcelColumn(name="计划开始日期",index = 3,width =15)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @ApiModelProperty(value = "销售单号" )
@@ -94,26 +94,26 @@
    private Integer unitId;
    @ApiModelProperty(value = "单位编码名称", example = "1")
    @ExcelColumn(name="单位名称",index = 6,width =15)
    @ExcelColumn(name="单位名称",index = 7,width =15)
    private String unitName;
    @ApiModelProperty(value = "计划数量", example = "1")
    @ExcelColumn(name="计划数量",index = 5,width =15)
    @ExcelColumn(name="计划数量",index = 6,width =15)
    private Integer num;
    @ApiModelProperty(value = "批次号")
    @ExcelColumn(name="批次号",index = 7,width =15)
    @ExcelColumn(name="批次号",index = 8,width =15)
    private String batch;
    @ApiModelProperty(value = "状态 1=已生成;2=已发布、3已取消、4已分配、5已暂停、6已完工、7已入库、8已关闭", example = "1")
    @ExcelColumn(name="计划状态",valueMapping = "0=已生成;1=执行中;3=已取消;4=已分配;5=已暂停;6=已完工;7=已入库;8=已关闭;",index = 8,width =15)
    @ExcelColumn(name="计划状态",valueMapping = "0=已生成;1=执行中;3=已取消;4=已分配;5=已暂停;6=已完工;7=已入库;8=已关闭;",index = 9,width =15)
    private Integer status;
    @ApiModelProperty(value = "导入批号(关联plan_import表)", example = "1")
    private Integer importId;
    @ApiModelProperty(value = "是否暂停 0未暂停 1已暂停", example = "1")
    @ExcelColumn(name="是否暂停",valueMapping = "0=否;1=是",index = 9,width =15)
    @ExcelColumn(name="是否暂停",valueMapping = "0=否;1=是",index = 10,width =15)
    private Integer paused;
    @ApiModelProperty(value = "计划员编码(与system_user表关联)", example = "1")
@@ -123,31 +123,31 @@
    private Integer urgent;
    @ApiModelProperty(value = "计划员姓名", example = "1")
    @ExcelColumn(name="计划员姓名",index = 14,width =15)
    @ExcelColumn(name="计划员姓名",index = 15,width =15)
    private String userName;
    @ApiModelProperty(value = "计划员手机号", example = "1")
    @ExcelColumn(name="计划员手机号",index = 15,width =15)
    @ExcelColumn(name="计划员手机号",index = 16,width =15)
    private String userMobile;
    @ApiModelProperty(value = "计划发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ExcelColumn(name="计划发布时间",index = 13,width =15)
    @ExcelColumn(name="计划发布时间",index = 14,width =15)
    private Date publishDate;
    @ApiModelProperty(value = "用户部门名称", example = "1")
    private String userDepartName;
    @ApiModelProperty(value = "完工数量", example = "1")
    @ExcelColumn(name="完工数量" ,index = 10,width =15)
    @ExcelColumn(name="完工数量" ,index = 11,width =15)
    private Integer finishNum;
    @ApiModelProperty(value = "完工合格数量", example = "1")
    @ExcelColumn(name="完工合格数量",index = 11,width =15)
    @ExcelColumn(name="完工合格数量",index = 12,width =15)
    private Integer finishQualifiedNum;
    @ApiModelProperty(value = "完工不良数量", example = "1")
    @ExcelColumn(name="完工不良数量",index = 12,width =15)
    @ExcelColumn(name="完工不良数量",index = 13,width =15)
    private Integer finishUnQualifiedNum;
    @ApiModelProperty(value = "子计划明细信息", example = "1")
server/src/main/java/doumeemes/dao/ext/beanDto/QueryWStockDto.java
@@ -80,5 +80,7 @@
    @ApiModelProperty(value = "工单主键")
    private Integer workorderId;
    @ApiModelProperty(value = "工序计划主键")
    private Integer plansId;
}
server/src/main/java/doumeemes/dao/ext/dto/QueryBomDetailExtDTO.java
@@ -256,6 +256,8 @@
    @ApiModelProperty(value = "工单编码", example = "1",hidden = true)
    private Integer workorderId;
    @ApiModelProperty(value = "工序计划主键", example = "1",hidden = true)
    private Integer plansId;
    @ApiModelProperty(value = "物料清单信息表最后启用时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date bmodelValidTime;
server/src/main/java/doumeemes/dao/ext/dto/QueryBomExtDTO.java
@@ -1,5 +1,7 @@
package doumeemes.dao.ext.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import doumeemes.dao.ext.vo.BomExtListVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -286,4 +288,5 @@
    @ApiModelProperty(value = "物料清单信息表主键", example = "1")
    private Integer bmodelId;
}
server/src/main/java/doumeemes/dao/ext/dto/QueryPlansExtDTO.java
@@ -441,8 +441,8 @@
    private String mixParam;
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    private String planDateStartDate;
    @ApiModelProperty(value = "截止时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private String planDateEndDate;
}
server/src/main/java/doumeemes/dao/ext/dto/QueryUserSalaryListDTO.java
@@ -28,10 +28,10 @@
    private Integer rootDepartId;
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    private String startDate;
    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private String endDate;
    @ApiModelProperty(value = "数据权限部门编码集合" ,hidden = true)
    private List<Integer> departIds;
server/src/main/java/doumeemes/dao/ext/dto/SalaryParamImportDTO.java
@@ -1,6 +1,7 @@
package doumeemes.dao.ext.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@@ -12,6 +13,7 @@
 */
@Data
@ApiModel("绩效工资配置导入")
@ExcelTarget("SalaryParamImportDTO")
public class SalaryParamImportDTO {
    @Excel(name="计价方式",orderNum ="1")
@@ -20,10 +22,10 @@
    @Excel(name="工厂名称",orderNum ="2")
    private String departName;
    @Excel(name="产品名称",orderNum ="3")
    @Excel(name="物料名称",orderNum ="3")
    private String materialName;
    @Excel(name="产品编码",orderNum ="4")
    @Excel(name="物料编码",orderNum ="4")
    private String materialCode;
    @Excel(name="工序名称",orderNum ="5")
@@ -33,7 +35,7 @@
    private BigDecimal salary;
    @Excel(name="标准产出",orderNum ="7")
    private Integer NUM;
    private String num;
    @Excel(name="标准工时",orderNum ="8")
    private String timesName;
server/src/main/java/doumeemes/dao/ext/vo/BomExtListVO.java
@@ -60,8 +60,8 @@
    @ExcelColumn(name="公司级组织编码(关联department表)")
    private Integer departId;
    @ApiModelProperty(value = "物料ID(关联material表)", example = "1")
    @ExcelColumn(name="物料ID(关联material表)")
    @ApiModelProperty(value = "物料ID(该字段关联 material_distribute è¡¨ID ï¼ï¼ï¼ï¼ ï¼‰", example = "1")
    @ExcelColumn(name="物料ID(关联material_distribute表)")
    private Integer materialId;
    @ApiModelProperty(value = "版本号")
@@ -157,5 +157,6 @@
    @ApiModelProperty(value = "工序名称")
    private String procedureName;
    @ApiModelProperty(value = "material id")
    private Integer realMaterialId;
}
server/src/main/java/doumeemes/dao/ext/vo/CompanyExtListVO.java
@@ -165,4 +165,7 @@
    @ApiModelProperty(value = "羚羊平台应用参数,json格式存储{app_key:,aes_key:,app_secret:}" )
    private String lingyangInfo;
    @ApiModelProperty(value = "状态 1 å¼€å¯ 0 ç¦ç”¨")
    private Integer status;
}
server/src/main/java/doumeemes/dao/ext/vo/PlansExtListVO.java
@@ -71,7 +71,7 @@
    private Integer lessDistributNum;
    @ApiModelProperty(value = "计划类型 0正常1异常2返工", example = "1")
    @ExcelColumn(name="计划类型",valueMapping = "0=正常;1=异常;2=返工;",index = 11,width =15)
    @ExcelColumn(name="计划类型",valueMapping = "0=正常;1=异常;2=返工;",index = 12,width =15)
    private Integer type;
    @ApiModelProperty(value = "生产工序编码(关联procedures表)", example = "1")
@@ -84,15 +84,15 @@
    private Integer unitId;
    @ApiModelProperty(value = "计划数量", example = "1")
    @ExcelColumn(name="计划数量",index = 6,width =15)
    @ExcelColumn(name="计划数量",index = 7,width =15)
    private Integer num;
    @ApiModelProperty(value = "批次号")
    @ExcelColumn(name="生产批次号",index = 8,width =15)
    @ExcelColumn(name="生产批次号",index = 9,width =15)
    private String batch;
    @ApiModelProperty(value = "优先级(排序码)字段", example = "1")
    @ExcelColumn(name="优先级",index = 9,width =15)
    @ExcelColumn(name="优先级",index = 10,width =15)
    private Integer urgent;
    @ApiModelProperty(value = "导入批号(关联plan_import表)", example = "1")
@@ -102,14 +102,14 @@
    private Integer userId;
    @ApiModelProperty(value = "状态 0已生成、1已发布、2已撤回、3已取消、4已分配、5已暂停、6已完工、7已入库、8已关闭", example = "1")
    @ExcelColumn(name="计划状态",valueMapping = "0=已生成;1=已发布;2=已撤回;3=已取消;4=已分配;5=已暂停;6=已完工;7=已入库;8=已关闭;",index = 10,width =15)
    @ExcelColumn(name="计划状态",valueMapping = "0=已生成;1=已发布;2=已撤回;3=已取消;4=已分配;5=已暂停;6=已完工;7=已入库;8=已关闭;",index = 11,width =15)
    private Integer status;
    @ApiModelProperty(value = "返修申请单号(关联backorder表)", example = "1")
    private Integer backorderId;
    @ApiModelProperty(value = "计划发布时间")
    @ExcelColumn(name="发布日期",index = 15,width =15)
    @ExcelColumn(name="发布日期",index = 16,width =15)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date publishDate;
@@ -133,20 +133,29 @@
    @ApiModelProperty(value = "已完工数量", example = "0")
    private Integer  doneNum;
    @ApiModelProperty(value = "合格数量", example = "0")
    @ExcelColumn(name="合格数量",index = 13,width =15)
    @ExcelColumn(name="合格数量",index = 14,width =15)
    private Integer  qulifiedNum;
    @ApiModelProperty(value = "不良数量", example = "0")
    @ExcelColumn(name="不良数量",index = 14,width =15)
    @ExcelColumn(name="不良数量",index = 15,width =15)
    private Integer  unqulifiedNum;
    @ApiModelProperty(value = "已分配生产数量", example = "1",hidden = true)
    private Integer distributNum;
    @ApiModelProperty(value = "工单已分配生产数量", example = "1",hidden = true)
    private Integer workorderDistributNum;
    @ApiModelProperty(value = "已分配未完工生产数量", example = "1",hidden = true)
    @ExcelColumn(name="已分配未完工生产数量",index = 12,width =15)
    @ExcelColumn(name="已分配未完工生产数量",index = 13,width =15)
    private Integer distributNoDoneNum;
    @ApiModelProperty(value = "库存是否满足 0不满足 1满足", example = "0")
    private Integer  isStock;
    @ApiModelProperty(value = "是否延期")
    private Boolean hasExpire;
    @ApiModelProperty(value = "成品计划开始日期")
    @ExcelColumn(name="计划日期",index = 4,width =15)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private  Date workPlanPlanDate;
    @ApiModelProperty(value = "成品计划开始日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private  Date workPlanStartDate;
    @ExcelColumn(name="物料名称",index = 1,width =15)
@@ -155,19 +164,34 @@
    @ExcelColumn(name="物料编码",index = 2,width =15)
    private String materialCode;
    @ExcelColumn(name="工厂",index = 4,width =15)
    @ExcelColumn(name="工厂",index = 5,width =15)
    private String factoryName;
    @ExcelColumn(name="工序",index = 5,width =15)
    @ExcelColumn(name="工序",index = 6,width =15)
    private String produceName;
    @ExcelColumn(name="计划员",index = 16,width =15)
    @ExcelColumn(name="计划员",index = 17,width =15)
    private String planUserName;
    @ExcelColumn(name="单位名称",index = 7,width =15)
    @ExcelColumn(name="单位名称",index = 8,width =15)
    private String unitName;
    @ExcelColumn(name="成品计划编码")
    private String workPlanCode;
    @ExcelColumn(name="销售订单")
    private String salesOrder;
    @ApiModelProperty(value = "成品计划结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date workPlanEndDate;
    @ApiModelProperty(value = "已生产数量")
    private Integer produceNum;
    @ApiModelProperty(value = "是否有bom配置 0无 1有", example = "1")
    private Integer hasBom;
    @ApiModelProperty(value = "bom投料方式 0推式 1拉式", example = "1")
    private Integer bomType;
}
server/src/main/java/doumeemes/service/business/UnqualifiedRecordService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
package doumeemes.service.business;
import doumeemes.core.model.PageData;
import doumeemes.core.model.PageWrap;
import doumeemes.dao.business.model.UnqualifiedRecord;
import java.util.List;
/**
 * å·¥å•ç±»-报工不良记录类型表Service定义
 * @author æ±Ÿè¹„蹄
 * @since 2023/08/16 14:15
 */
public interface UnqualifiedRecordService {
    /**
     * åˆ›å»º
     *
     * @param unqualifiedRecord å®žä½“对象
     * @return Integer
     */
    Integer create(UnqualifiedRecord unqualifiedRecord);
    /**
     * ä¸»é”®åˆ é™¤
     *
     * @param id ä¸»é”®
     */
    void deleteById(Integer id);
    /**
     * åˆ é™¤
     *
     * @param unqualifiedRecord å®žä½“对象
     */
    void delete(UnqualifiedRecord unqualifiedRecord);
    /**
     * æ‰¹é‡ä¸»é”®åˆ é™¤
     *
     * @param ids ä¸»é”®é›†
     */
    void deleteByIdInBatch(List<Integer> ids);
    /**
     * ä¸»é”®æ›´æ–°
     *
     * @param unqualifiedRecord å®žä½“对象
     */
    void updateById(UnqualifiedRecord unqualifiedRecord);
    /**
     * æ‰¹é‡ä¸»é”®æ›´æ–°
     *
     * @param unqualifiedRecords å®žä½“集
     */
    void updateByIdInBatch(List<UnqualifiedRecord> unqualifiedRecords);
    /**
     * ä¸»é”®æŸ¥è¯¢
     *
     * @param id ä¸»é”®
     * @return UnqualifiedRecord
     */
    UnqualifiedRecord findById(Integer id);
    /**
     * æ¡ä»¶æŸ¥è¯¢å•条记录
     *
     * @param unqualifiedRecord å®žä½“对象
     * @return UnqualifiedRecord
     */
    UnqualifiedRecord findOne(UnqualifiedRecord unqualifiedRecord);
    /**
     * æ¡ä»¶æŸ¥è¯¢
     *
     * @param unqualifiedRecord å®žä½“对象
     * @return List<UnqualifiedRecord>
     */
    List<UnqualifiedRecord> findList(UnqualifiedRecord unqualifiedRecord);
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param pageWrap åˆ†é¡µå¯¹è±¡
     * @return PageData<UnqualifiedRecord>
     */
    PageData<UnqualifiedRecord> findPage(PageWrap<UnqualifiedRecord> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
     * @param unqualifiedRecord å®žä½“对象
     * @return long
     */
    long count(UnqualifiedRecord unqualifiedRecord);
}
server/src/main/java/doumeemes/service/business/impl/CompanyOpenServiceImpl.java
@@ -11,14 +11,18 @@
import doumeemes.dao.business.model.Company;
import doumeemes.dao.business.model.CompanyLog;
import doumeemes.dao.business.model.CompanyOpen;
import doumeemes.dao.ext.vo.CompanyExtListVO;
import doumeemes.service.business.CompanyLogService;
import doumeemes.service.business.CompanyOpenService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import doumeemes.service.ext.DepartmentExtService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -43,6 +47,10 @@
    @Autowired
    CompanyLogService companyLogService;
    @Autowired
    @Lazy
    private DepartmentExtService departmentExtService;
    @Override
    public Integer create(CompanyOpen companyOpen) {
@@ -90,7 +98,7 @@
        company.setOepnValidDate(companyOpen.getValidDate());
        company.setOepnType(companyOpen.getOepnType());
        companyMapper.updateById(company);
        Company company1 = companyMapper.selectById(companyOpen.getCompanyId());
        CompanyLog companyLog = new CompanyLog();
        companyLog.setDeleted((byte) Constants.ZERO);
@@ -103,6 +111,15 @@
        companyLog.setUpdateType(Constants.CompanyUpdateType.UPDATE_VAIL_DATE.getKey());
        companyLog.setDetail("有效期从"+format.format(cyResult.getOepnValidDate())+"日调整至"+format.format(companyOpen.getValidDate()));
        companyLogService.create(companyLog);
        initRedisCache(company1);
    }
    private void initRedisCache(Company com) {
        CompanyExtListVO c = new CompanyExtListVO();
        BeanUtils.copyProperties(com,c);
        departmentExtService.loadComDepart(c);
        departmentExtService.initCompnayCodesByCom(com);
    }
    @Override
@@ -131,7 +148,7 @@
        QueryWrapper<CompanyOpen> wrapper = new QueryWrapper<>(companyOpen);
        return companyOpenMapper.selectList(wrapper);
    }
    @Override
    public PageData<CompanyOpen> findPage(PageWrap<CompanyOpen> pageWrap) {
        IPage<CompanyOpen> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
server/src/main/java/doumeemes/service/business/impl/CompanyServiceImpl.java
@@ -14,6 +14,7 @@
import doumeemes.dao.business.model.CompanyLog;
import doumeemes.dao.business.model.Multifiles;
import doumeemes.dao.ext.dto.DingDingConfig;
import doumeemes.dao.ext.vo.CompanyExtListVO;
import doumeemes.service.business.CompanyLogService;
import doumeemes.service.business.CompanyService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -21,9 +22,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import doumeemes.service.business.MultifilesService;
import doumeemes.service.ext.DepartmentExtService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -46,6 +50,10 @@
    @Autowired
    private CompanyLogService companyLogService;
    @Autowired
    @Lazy
    private DepartmentExtService departmentExtService;
    @Override
@@ -115,36 +123,35 @@
        update.setStatus(company.getStatus());
        update.setDingdingInfo(company.getDingdingInfo());
        companyMapper.updateById(update);
//        æ›´æ–°è®°å½•
        CompanyLog companyLog = new CompanyLog();
        companyLog.setDeleted((byte)Constants.ZERO);
        companyLog.setUpdateUser(principal.getId());
        companyLog.setCreateUser(principal.getId());
        companyLog.setCreateTime(new Date());
        companyLog.setUpdateTime(new Date());
        companyLog.setCompanyId(company.getId());
        if(Objects.nonNull(company.getStatus())){
            CompanyLog companyLog = new CompanyLog();
            companyLog.setDeleted((byte)Constants.ZERO);
            companyLog.setUpdateUser(principal.getId());
            companyLog.setCreateUser(principal.getId());
            companyLog.setCreateTime(new Date());
            companyLog.setUpdateTime(new Date());
            companyLog.setRemark(company.getStatus() == 1 ? "数据启用" : "数据禁用");
            companyLog.setCompanyId(company.getId());
            companyLog.setUpdateType(company.getStatus() == 1 ? Constants.CompanyUpdateType.UPDATE_ENABLE.getKey()
                    : Constants.CompanyUpdateType.UPDATE_DISABLE.getKey());
            companyLog.setDetail(company.getStatus() == 1 ? "数据启用" : "数据禁用");
            companyLogService.create(companyLog);
        }else {
            CompanyLog companyLog = new CompanyLog();
            companyLog.setDeleted((byte)Constants.ZERO);
            companyLog.setUpdateUser(principal.getId());
            companyLog.setCreateUser(principal.getId());
            companyLog.setCreateTime(new Date());
            companyLog.setUpdateTime(new Date());
            companyLog.setRemark("更新企业数据");
            companyLog.setCompanyId(company.getId());
            companyLog.setUpdateType(Constants.CompanyUpdateType.UPDATE_CONTENT.getKey());
            companyLog.setDetail("更新企业数据");
            companyLogService.create(companyLog);
        }
        companyLogService.create(companyLog);
        Company company1 = companyMapper.selectById(company.getId());
        initRedisCache(company1);
    }
    private void initRedisCache(Company com) {
        CompanyExtListVO c = new CompanyExtListVO();
        BeanUtils.copyProperties(com,c);
        departmentExtService.loadComDepart(c);
        departmentExtService.initCompnayCodesByCom(com);
    }
    private Boolean isParseObject(String dingdingInfo){
@@ -185,7 +192,7 @@
        QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
        return companyMapper.selectList(wrapper);
    }
    @Override
    public PageData<Company> findPage(PageWrap<Company> pageWrap) {
        IPage<Company> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
@@ -29,10 +29,8 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.math.BigDecimal;
import java.util.*;
/**
 * è®¾ç½®ç±»-绩效工资配置表Service实现
@@ -56,19 +54,24 @@
    @Override
    public Integer create(SalaryParam salaryParam) {
        LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        SalaryParam insert = new SalaryParam();
        insert.setRootDepartId(salaryParam.getRootDepartId());
        insert.setDepartId(salaryParam.getDepartId());
        insert.setProcedureId(salaryParam.getProcedureId());
        insert.setMaterialId(salaryParam.getMaterialId());
        insert.setDeleted((byte) Constants.ZERO);
        if(findOne(insert) != null){
            throw  new BusinessException(ResponseStatus.DATA_EXISTS.getCode(),"同一个物料在相同工序不能重复配置哦!");
        }
        insert.setCreateUser(principal.getId());
        insert.setCreateTime(new Date());
        insert.setUpdateUser(principal.getId());
        insert.setUpdateTime(new Date());
        insert.setRemark(salaryParam.getRemark());
        insert.setRootDepartId(salaryParam.getRootDepartId());
        insert.setDepartId(salaryParam.getDepartId());
        insert.setProcedureId(salaryParam.getProcedureId());
        insert.setMaterialId(salaryParam.getMaterialId());
        insert.setSalary(salaryParam.getSalary());
        insert.setNum(salaryParam.getNum());
        insert.setTimes(salaryParam.getTimes());
@@ -111,9 +114,9 @@
                .set(SalaryParam::getUpdateTime,new Date())
                .set(SalaryParam::getUpdateUser,principal.getId())
                .set(SalaryParam::getType,salaryParam.getType())
                .set(SalaryParam::getDepartId,salaryParam.getDepartId())
                .set(SalaryParam::getMaterialId,salaryParam.getMaterialId())
                .set(SalaryParam::getProcedureId,salaryParam.getProcedureId())
//                .set(SalaryParam::getDepartId,salaryParam.getDepartId())
//                .set(SalaryParam::getMaterialId,salaryParam.getMaterialId())
//                .set(SalaryParam::getProcedureId,salaryParam.getProcedureId())
                .set(SalaryParam::getSalary,salaryParam.getSalary())
                .set(SalaryParam::getNum,salaryParam.getNum())
                .set(SalaryParam::getTimes,salaryParam.getTimes())
@@ -139,6 +142,7 @@
    @Override
    public SalaryParam findOne(SalaryParam salaryParam) {
        QueryWrapper<SalaryParam> wrapper = new QueryWrapper<>(salaryParam);
        wrapper.last("limit 1");
        return salaryParamMapper.selectOne(wrapper);
    }
@@ -180,7 +184,7 @@
                || Objects.isNull(s.getDepartName())
                || Objects.isNull(s.getMaterialCode())
                || Objects.isNull(s.getProcedureName())
                || Objects.isNull(s.getNUM())){
                || Objects.isNull(s.getNum())){
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "导入数据内容有误!");
            }
        });
@@ -216,7 +220,7 @@
            proceduresWrapper.lambda()
                    .eq(Procedures::getName,salaryParamImportDTO.getProcedureName())
                    .eq(Procedures::getRootDepartId,department.getRootId())
                    .eq(Procedures::getDepartId,department.getId())
                    .eq(Procedures::getOrgId,department.getId())
                    .last("limit 1");
            Procedures procedures = proceduresMapper.selectOne(proceduresWrapper);
            if (Objects.isNull(procedures)){
@@ -228,13 +232,49 @@
            salaryParam.setProcedureId(procedures.getId());
            salaryParam.setMaterialId(material.getId());
            salaryParam.setSalary(salaryParamImportDTO.getSalary());
            salaryParam.setNum(salaryParamImportDTO.getNUM());
            //todo
//            salaryParam.setTimes();
//            salaryParam.setUnqualified(salaryParamImportDTO.getUnqualified() );
//            salaryParam.setType(salaryParamImportDTO.getType());
            salaryParam.setNum(new BigDecimal(salaryParamImportDTO.getNum()));
            salaryParam.setTimes(getIntegerTimes(salaryParamImportDTO.getTimesName()));
            Integer unqualified = Optional.ofNullable(salaryParamImportDTO.getUnqualified()).map(s -> {
                if ("否".equals(s)) {
                    return 0;
                } else {
                    return 1;
                }
            }).orElse(0);
            salaryParam.setUnqualified(unqualified);
            Integer type = Optional.ofNullable(salaryParamImportDTO.getUnqualified()).map(s -> {
                if ("计件".equals(s)) {
                    return 0;
                } else {
                    return 1;
                }
            }).orElse(0);
            salaryParam.setType(type);
            create(salaryParam);
        }
    }
    private Integer getIntegerTimes(String a) {
        int h =0,m=0,s=0;
        try{
            int hIndex =a.lastIndexOf("小时");
            int mIndex=a.lastIndexOf("分钟");
            int sIndex =a.lastIndexOf("秒");
            if( hIndex>0){
                h = Integer.parseInt(a.substring(0,hIndex));
            }
            if(mIndex > hIndex){
                m = Integer.parseInt(a.substring(hIndex >=0?hIndex+2:0,mIndex));
            }
            if(sIndex > mIndex){
               s = Integer.parseInt(a.substring(mIndex >= 0 ? mIndex+2 : 0, sIndex));
            }
            return  h*3600+m*60+s;
        }catch (Exception e){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,时长【"+a+"】格式不正确!" );
        }
    }
}
server/src/main/java/doumeemes/service/business/impl/UnqualifiedRecordServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
package doumeemes.service.business.impl;
import doumeemes.core.model.PageData;
import doumeemes.core.model.PageWrap;
import doumeemes.core.utils.Utils;
import doumeemes.dao.business.UnqualifiedRecordMapper;
import doumeemes.dao.business.model.UnqualifiedRecord;
import doumeemes.service.business.UnqualifiedRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
 * å·¥å•ç±»-报工不良记录类型表Service实现
 * @author æ±Ÿè¹„蹄
 * @since 2023/08/16 14:15
 */
@Service
public class UnqualifiedRecordServiceImpl implements UnqualifiedRecordService {
    @Autowired
    private UnqualifiedRecordMapper unqualifiedRecordMapper;
    @Override
    public Integer create(UnqualifiedRecord unqualifiedRecord) {
        unqualifiedRecordMapper.insert(unqualifiedRecord);
        return unqualifiedRecord.getId();
    }
    @Override
    public void deleteById(Integer id) {
        unqualifiedRecordMapper.deleteById(id);
    }
    @Override
    public void delete(UnqualifiedRecord unqualifiedRecord) {
        UpdateWrapper<UnqualifiedRecord> deleteWrapper = new UpdateWrapper<>(unqualifiedRecord);
        unqualifiedRecordMapper.delete(deleteWrapper);
    }
    @Override
    public void deleteByIdInBatch(List<Integer> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        unqualifiedRecordMapper.deleteBatchIds(ids);
    }
    @Override
    public void updateById(UnqualifiedRecord unqualifiedRecord) {
        unqualifiedRecordMapper.updateById(unqualifiedRecord);
    }
    @Override
    public void updateByIdInBatch(List<UnqualifiedRecord> unqualifiedRecords) {
        if (CollectionUtils.isEmpty(unqualifiedRecords)) {
            return;
        }
        for (UnqualifiedRecord unqualifiedRecord: unqualifiedRecords) {
            this.updateById(unqualifiedRecord);
        }
    }
    @Override
    public UnqualifiedRecord findById(Integer id) {
        return unqualifiedRecordMapper.selectById(id);
    }
    @Override
    public UnqualifiedRecord findOne(UnqualifiedRecord unqualifiedRecord) {
        QueryWrapper<UnqualifiedRecord> wrapper = new QueryWrapper<>(unqualifiedRecord);
        return unqualifiedRecordMapper.selectOne(wrapper);
    }
    @Override
    public List<UnqualifiedRecord> findList(UnqualifiedRecord unqualifiedRecord) {
        QueryWrapper<UnqualifiedRecord> wrapper = new QueryWrapper<>(unqualifiedRecord);
        return unqualifiedRecordMapper.selectList(wrapper);
    }
    @Override
    public PageData<UnqualifiedRecord> findPage(PageWrap<UnqualifiedRecord> pageWrap) {
        IPage<UnqualifiedRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<UnqualifiedRecord> queryWrapper = new QueryWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        queryWrapper.lambda()
                .eq(pageWrap.getModel().getId() != null, UnqualifiedRecord::getId, pageWrap.getModel().getId())
                .eq(pageWrap.getModel().getDeleted() != null, UnqualifiedRecord::getDeleted, pageWrap.getModel().getDeleted())
                .eq(pageWrap.getModel().getCreateUser() != null, UnqualifiedRecord::getCreateUser, pageWrap.getModel().getCreateUser())
                .ge(pageWrap.getModel().getCreateTime() != null, UnqualifiedRecord::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime()))
                .le(pageWrap.getModel().getCreateTime() != null, UnqualifiedRecord::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime()))
                .eq(pageWrap.getModel().getUpdateUser() != null, UnqualifiedRecord::getUpdateUser, pageWrap.getModel().getUpdateUser())
                .ge(pageWrap.getModel().getUpdateTime() != null, UnqualifiedRecord::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime()))
                .le(pageWrap.getModel().getUpdateTime() != null, UnqualifiedRecord::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime()))
                .eq(pageWrap.getModel().getRemark() != null, UnqualifiedRecord::getRemark, pageWrap.getModel().getRemark())
                .eq(pageWrap.getModel().getRootDepartId() != null, UnqualifiedRecord::getRootDepartId, pageWrap.getModel().getRootDepartId())
                .eq(pageWrap.getModel().getDepartId() != null, UnqualifiedRecord::getDepartId, pageWrap.getModel().getDepartId())
                .eq(pageWrap.getModel().getWorkorderId() != null, UnqualifiedRecord::getWorkorderId, pageWrap.getModel().getWorkorderId())
                .eq(pageWrap.getModel().getRecordId() != null, UnqualifiedRecord::getRecordId, pageWrap.getModel().getRecordId())
                .eq(pageWrap.getModel().getCategoryId() != null, UnqualifiedRecord::getCategoryId, pageWrap.getModel().getCategoryId())
                .eq(pageWrap.getModel().getUnqualifiedNum() != null, UnqualifiedRecord::getUnqualifiedNum, pageWrap.getModel().getUnqualifiedNum())
        ;
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(unqualifiedRecordMapper.selectPage(page, queryWrapper));
    }
    @Override
    public long count(UnqualifiedRecord unqualifiedRecord) {
        QueryWrapper<UnqualifiedRecord> wrapper = new QueryWrapper<>(unqualifiedRecord);
        return unqualifiedRecordMapper.selectCount(wrapper);
    }
}
server/src/main/java/doumeemes/service/business/impl/WOutboundServiceImpl.java
@@ -2126,6 +2126,9 @@
            WOutboundInBodyBean wOutboundInBodyBean = wOutboundInBodyBeans.get(Constants.ZERO);
            //累计入库数量
            wOutboundInBodyBean.setNum(wOutboundInBodyBeans.stream().map(s -> s.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add));
            if(wOutboundInBodyBean.getNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "数量异常,请检查数量!");
            }
            WOutboundDetail wOutboundDetail = new WOutboundDetail();
            //查询物料数据
            MaterialDistribute materialDistribute = materialDistributeMapper.selectById(wOutboundInBodyBean.getMaterialId());
server/src/main/java/doumeemes/service/ext/CategoryExtService.java
@@ -33,4 +33,6 @@
    CategoryExtListVO getByCategoryId(Integer comid, Integer id);
    CategoryExtListVO getByCategoryId(Integer comid, Integer id,List<CategoryExtListVO> allList);
    void loadAll();
    List<CategoryExtListVO> findList(QueryCategoryExtDTO queryCategoryExtDTO);
}
server/src/main/java/doumeemes/service/ext/WorkorderRecordStandardService.java
@@ -36,4 +36,6 @@
    List<WorkorderRecord> getWorkorderRecordList(Integer workorderId);
    PageData<WStockExtListVO> choiceStockPageForWorkorder(PageWrap<QueryWStockDto> pageWrap, LoginUserInfo userInfo);
    PageData<WStockExtListVO> choiceStockPageForPlans(PageWrap<QueryWStockDto> pageWrap,LoginUserInfo userInfo);
}
server/src/main/java/doumeemes/service/ext/impl/CategoryExtServiceImpl.java
@@ -49,6 +49,12 @@
    }
    @Override
    public List<CategoryExtListVO> findList(QueryCategoryExtDTO queryCategoryExtDTO) {
        List<CategoryExtListVO> result = categoryExtMapper.selectList(queryCategoryExtDTO);
        return result;
    }
    @Override
    public List<CategoryExtListVO> getListByType(String type,Integer rootDepartId,String cateType,String id) {
        QueryCategoryExtDTO queryCategoryExtDTO=new QueryCategoryExtDTO();
        queryCategoryExtDTO.setDeleted(Constants.ZERO);
server/src/main/java/doumeemes/service/ext/impl/CompanyExtServiceImpl.java
@@ -590,7 +590,7 @@
            return companyInfoListVO;
        }
        String rPath =systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.MENU_IMG).getCode();
        companyInfoListVO.setFileurlfull(rPath+"/"+companyInfoListVO.getFileStoreAddr());
        companyInfoListVO.setFileurlfull(rPath+companyInfoListVO.getFileStoreAddr());
        companyInfoListVO.setSystemUrl( systemDictDataBiz.queryByCode(Constants.EDGP_PARAM,Constants.SYSTEM_URL).getCode()+companyInfoListVO.getId());
server/src/main/java/doumeemes/service/ext/impl/DepartmentExtServiceImpl.java
@@ -37,6 +37,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import java.util.*;
import java.util.stream.Collectors;
@@ -443,6 +444,7 @@
            //加入redis缓存,存储企业信息
            RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_DEPART_TREE_KEY+com.getId(),rootDepart);
    }
    @PostConstruct
    @Override
    public  void loadAllDepart() {
        QueryCompanyExtDTO dto = new QueryCompanyExtDTO();
@@ -796,7 +798,7 @@
            for (Department department:departmentList ) {
                this.dealDepartmentData(department,user);
            }
        }
        }
    }
    public void dealDepartmentData(Department department,LoginUserInfo user){
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
@@ -16,6 +16,8 @@
import doumeemes.core.utils.excel.EasyExcelUtil;
import doumeemes.core.utils.redis.RedisUtil;
import doumeemes.dao.business.PlansMapper;
import doumeemes.dao.business.UnqualifiedRecordMapper;
import doumeemes.dao.business.WorkorderMapper;
import doumeemes.dao.business.dto.*;
import doumeemes.dao.business.model.*;
import doumeemes.dao.ext.*;
@@ -34,6 +36,7 @@
import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -64,7 +67,8 @@
    private WorkorderHistoryExtMapper workorderHistoryExtMapper;
    @Autowired
    private WorkorderRecordExtMapper workorderRecordExtMapper;
    @Autowired
    private WorkorderMapper workorderMapper;
    @Autowired
    private RouteProcedureExtMapper routeProcedureExtMapper;
    @Autowired
@@ -89,6 +93,8 @@
    private WStockExtService  wStockExtService;
    @Autowired
    private WorkorderRecordStandardService workorderRecordStandardService;
    @Autowired
    private UnqualifiedRecordMapper unqualifiedRecordMapper;
    @Override
    public  PlansExtListVO findById(Integer id){
@@ -139,6 +145,19 @@
//        //统计已完工数量
//        param.setStatus(Constants.WORKORDER_STATUS.done);
//        plan.setDoneNum(workorderExtMapper.sumOrderNum(param));
        QueryBomExtDTO bb = new QueryBomExtDTO();
        bb.setDepartId(plan.getDepartId());
        bb.setDeleted(Constants.ZERO);
        bb.setRootDepartId(user.getRootDepartment().getId());
        bb.setMaterialId(plan.getMaterialId());
        bb.setProcedureId(plan.getProcedureId());
        BomExtListVO versionBom = bomExtMapper.selectByModel( bb);
        if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){
            plan.setHasBom(Constants.ZERO);
        }else {
            plan.setBomType(Constants.formatIntegerNum(versionBom.getType()));
            plan.setHasBom(Constants.ONE);
        }
        return plan;
    }
@@ -197,6 +216,14 @@
//                p.setDistributNum(tp.getDistributNum());
//                p.setDoneNum(tp.getDoneNum());
                p.setIsStock(wStockExtService.isStockForPlan(p));
                p.setHasExpire(false);
                p.setStatus(Constants.formatIntegerNum(p.getStatus()));
                if ( !p.getStatus().equals(Constants.PLAN_STATUS.done) &&
                        !p.getStatus().equals(Constants.PLAN_STATUS.close)){
                    if (Objects.nonNull(p.getPlanDate())){
                        p.setHasExpire(DateUtil.toDateLocalDateTime(p.getWorkPlanPlanDate()).toLocalDate().isBefore(LocalDate.now()));
                    }
                }
            }
        }
        return PageData.from(new PageInfo<>(result));
@@ -592,7 +619,7 @@
        if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,计划已暂停!");
        }
        if(Constants.formatIntegerNum(mp.getDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){
        if(Constants.formatIntegerNum(mp.getWorkorderDistributNum())+thisPlanNum > Constants.formatIntegerNum(mp.getNum())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,累计分配数量大于计划数量!");
        }
        if(!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.publish)&&!Constants.equalsInteger(mp.getStatus(),Constants.PLAN_STATUS.distribute)){
@@ -678,9 +705,9 @@
        if(ulist == null){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,生产人员信息不正确,请刷新页面重试!");
        }
        if(ulist.size() < param.getProUserList().size()){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,存在生产人员信息不正确,请刷新页面重试!");
        }
//        if(ulist.size() < param.getProUserList().size()){
//            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,存在生产人员信息不正确,请刷新页面重试!");
//        }
        List<WorkorderUser> userList = new ArrayList<>();
        for(UserDeviceExtListVO uModel : ulist){
            WorkorderUser u = new WorkorderUser();
@@ -1507,7 +1534,7 @@
    }
    /**
     * æ¢å¤è®¡åˆ’
     * @param p
     * @param
     */
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    @Override
@@ -1563,14 +1590,18 @@
        if(Objects.isNull(plans)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到工序计划数据");
        }
        if(plans.getStatus().equals(Constants.PLAN_STATUS.create)){
        if(!(plans.getStatus().equals(Constants.PLAN_STATUS.create)||plans.getStatus().equals(Constants.PLAN_STATUS.publish)||plans.getStatus().equals(Constants.PLAN_STATUS.distribute))){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"工序计划已流转,无法操作");
        }
        if(plans.getPaused().equals(Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"工序计划已暂停,无法操作");
        }
        if(Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"参数错误:产出数据");
        }
        //查询工序计划已分配数量
        List<Workorder> workorderList = workorderExtMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId()));
        List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId())
                .eq("STATUS",Constants.WORKORDER_STATUS.baogong));
        //本次产出数量
        BigDecimal num = autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum().add(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum());
        if(num.compareTo(BigDecimal.ZERO)<=Constants.ZERO){
@@ -1585,11 +1616,9 @@
        Workorder param = new Workorder();
        param.setPlanId(autoWorkReportDTO.getPlansId());
        param.setPlanDate(new Date());
        List<Integer> proUserList = new ArrayList<Integer>();
        //TODO
        proUserList.add(user.getId());
        param.setProUserList(proUserList);
        param.setPlanNum(plans.getNum());
        param.setProGroupId(autoWorkReportDTO.getProGroupId());
        param.setProUserList(autoWorkReportDTO.getProUserList());
        param.setPlanNum(num.intValue());
        //生成工单信息
        Workorder workorder = this.distributeDone(user,param,plans.getNum());
        //工单投料记录
@@ -1600,11 +1629,48 @@
            workorderRecordStandardService.createMaterialStandard(createMaterialDTO);
        }
        //工单产出记录
        workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user);
        autoWorkReportDTO.getCreateWorkorderRecordDTO().setWorkorderId(workorder.getId());
        WorkorderRecord workorderRecord = workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user);
        //工单报工
        workorderRecordStandardService.comfirmDone(workorder);
        //更新工单状态
        if(num.compareTo(BigDecimal.valueOf(surplusNum))==Constants.ZERO){
            plans.setStatus(Constants.PLAN_STATUS.done);
        }else{
            if(plans.getStatus().equals(Constants.PLAN_STATUS.create)){
                plans.setStatus(Constants.PLAN_STATUS.distribute);
            }
        }
        plansExtMapper.updateById(plans);
        //存储报工不良项数据
        if(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){
            if(!Objects.isNull(autoWorkReportDTO.getCreateUnqualifiedDTOList())&&autoWorkReportDTO.getCreateUnqualifiedDTOList().size()>Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"不良项错误:请检查不良项数据");
            }
        }else{
            List<CreateUnqualifiedDTO> createUnqualifiedDTOList = autoWorkReportDTO.getCreateUnqualifiedDTOList();
            BigDecimal unqualified = createUnqualifiedDTOList.stream().map(s -> s.getUnQualifiedNum()).reduce(BigDecimal.ZERO, BigDecimal::add);
            if(unqualified.compareTo(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum())!=Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"不良项错误:请检查不良项数据");
            }
            for (CreateUnqualifiedDTO createUnqualifiedDTO:createUnqualifiedDTOList) {
                if(createUnqualifiedDTO.getUnQualifiedNum().compareTo(BigDecimal.ZERO)==Constants.ZERO
                ||Objects.isNull(createUnqualifiedDTO.getCategoryId())){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"不良项错误:请检查不良项数据");
                }
                UnqualifiedRecord unqualifiedRecord = new UnqualifiedRecord();
                unqualifiedRecord.setDeleted(Constants.ZERO);
                unqualifiedRecord.setCreateUser(user.getId());
                unqualifiedRecord.setCreateTime(new Date());
                unqualifiedRecord.setRootDepartId(plans.getRootDepartId());
                unqualifiedRecord.setDepartId(plans.getDepartId());
                unqualifiedRecord.setWorkorderId(workorder.getId());
                unqualifiedRecord.setRecordId(workorderRecord.getId());
                unqualifiedRecord.setCategoryId(createUnqualifiedDTO.getCategoryId());
                unqualifiedRecord.setUnqualifiedNum(createUnqualifiedDTO.getUnQualifiedNum());
                unqualifiedRecordMapper.insert(unqualifiedRecord);
            }
        }
    }
server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java
@@ -175,12 +175,16 @@
                    i.setFinishUnQualifiedNum(Objects.isNull(plansExtListVO.getUnqulifiedNum())?Constants.ZERO:plansExtListVO.getUnqulifiedNum());
                    i.setFinishNum(Objects.isNull(plansExtListVO.getDoneNum())?Constants.ZERO:plansExtListVO.getDoneNum());
                }
                if (Objects.nonNull(i.getPlanDate())){
                    i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now()));
                }else {
                    i.setHasExpire(false);
                i.setHasExpire(false);
                i.setStatus(Constants.formatIntegerNum(i.getStatus()));
                if ( !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.done) &&
                        !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.close)){
                    if (Objects.nonNull(i.getPlanDate())){
                        i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now()));
                    }
                }
            });
        }
        return PageData.from(new PageInfo<>(result));
server/src/main/java/doumeemes/service/ext/impl/WorkorderExtServiceImpl.java
@@ -343,6 +343,7 @@
        result.setStartNum(workorderExtMapper.selectCount(param));
        param.setStatusList(new ArrayList<>());
        param.getStatusList().add(Constants.WORKORDER_STATUS.done);
        param.getStatusList().add(Constants.WORKORDER_STATUS.producing);
        param.getStatusList().add(Constants.WORKORDER_STATUS.check);
        //进行中数量
        result.setIngNum(workorderExtMapper.selectCount(param));
server/src/main/java/doumeemes/service/ext/impl/WorkorderRecordStandardServiceImpl.java
@@ -83,6 +83,10 @@
    private MaterialExtMapper materialExtMapper;
    @Autowired
    private SalaryParamMapper salaryParamMapper;
    @Autowired
    private PlansExtMapper plansExtMapper;
    @Autowired
    private DeviceExtMapper deviceExtMapper;
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    @Override
@@ -188,6 +192,14 @@
        return mp;
    }
    private void getPlansAndValid(LoginUserInfo user, Plans mp)  throws  BusinessException{
        if(mp== null){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,该记录不存在!");
        }
        if(Constants.equalsInteger(mp.getPaused(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工单已暂停!");
        }
    }
    private QueryBomDetailExtDTO initBomParam(LoginUserInfo user, Workorder mp)  throws BusinessException{
        QueryBomExtDTO bb = new QueryBomExtDTO();
@@ -207,6 +219,27 @@
        bom.setBomId(versionBom.getBomVersionId());
//        bom.setProcedureId(mp.getProcedureId());
        bom.setWorkorderId(mp.getId());
        return bom;
    }
    private QueryBomDetailExtDTO initBomParamForPlans(LoginUserInfo user, Plans plans)  throws BusinessException{
        QueryBomExtDTO bb = new QueryBomExtDTO();
        bb.setDepartId(plans.getDepartId());
        bb.setDeleted(Constants.ZERO);
        bb.setRootDepartId(user.getRootDepartment().getId());
        bb.setMaterialId(plans.getMaterialId());
        bb.setProcedureId(plans.getProcedureId());
        BomExtListVO versionBom = bomExtMapper.selectByModel( bb);
        if(versionBom == null || StringUtils.isBlank(versionBom.getVersion()) || versionBom.getBomVersionId() == null){
            return  null;
            // throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "对不起,该工单物料BOM信息配置有误,请联系管理员!");
        }
        plans.setBomModel(versionBom);
        QueryBomDetailExtDTO  bom = new QueryBomDetailExtDTO();
        bom.setDeleted(Constants.ZERO);
        bom.setBomId(versionBom.getBomVersionId());
//        bom.setProcedureId(mp.getProcedureId());
        bom.setPlansId(plans.getId());
        return bom;
    }
@@ -281,7 +314,6 @@
    }
    private void updateOrderInfo(LoginUserInfo user, Workorder mp,int status) {
        List<WorkorderHistory> whList = new ArrayList<>();
        //工单历史数据
        Workorder order = new Workorder();
@@ -299,7 +331,7 @@
            order.setStatus(Constants.WORKORDER_STATUS.material);
        }else if(status ==Constants.WORKORDER_HISTORY_STATUS.done){
            order.setStatus(Constants.WORKORDER_STATUS.done);
        }else if(status ==Constants.WORKORDER_HISTORY_STATUS.material){
        }else if(status ==Constants.WORKORDER_HISTORY_STATUS.material ||status ==Constants.WORKORDER_HISTORY_STATUS.produce){
            //投料操作
            if(Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.create)
                    ||Constants.equalsInteger(mp.getStatus(),Constants.WORKORDER_STATUS.material)){
@@ -637,13 +669,13 @@
            if (bomDetailList == null || bomDetailList.size() == 0) {
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,该生产物料的bom配置有误,请联系管理员!");
            }
            for (BomDetailExtListVO i :bomDetailList) {
                //查询是否投料
                if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>()
                        .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工");
                }
            }
//            for (BomDetailExtListVO i :bomDetailList) {
//                //查询是否投料
//                if(workorderRecordExtMapper.selectCount(new QueryWrapper<WorkorderRecord>()
//                        .eq("DELETED",Constants.ZERO).eq("MATERIAL_ID",i.getMaterialId()).eq("TYPE",Constants.ZERO))<=0){
//                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未投料BOM物料,无法进行报工");
//                }
//            }
        }
        WOutbound outbound = new WOutbound();
@@ -762,6 +794,126 @@
//    private void dealAppliancePro(Workorder mp
//            , LoginUserInfo user
//            , List<WorkorderRecordExtListVO> allRecordList
//            , List<Appliances> updateApplianceList
//            , List<Appliances> updateApplianceProList
//            ,   List<WOutboundDetail> outboundDetailList
//            ,   List<WStock> stockList) {
//        WOutbound outbound = new WOutbound();
//        outbound.setDeleted(Constants.ZERO);
//        outbound.setCreateTime(DateUtil.getCurrentDate());
//        outbound.setDealDate(outbound.getCreateTime());
//        outbound.setValidDate(outbound.getCreateTime());
//        outbound.setCreateUser(user.getId());
//        outbound.setRootDepartId(mp.getRootDepartId());
//        outbound.setDepartId(mp.getDepartId());
//        outbound.setStatus(Constants.WOUTBOUND_STATUS.dealed);
//        outbound.setType(Constants.WOUTBOUND_TYPE.in);
//        //2022å¹´7月1日14:42:41 åŠ å…¥å•æ®ç±»åˆ«
//        outbound.setBillType(Constants.WOUTBOUND_BILLTYPE.workerOrderIn);
//        outbound.setCode(wOutboundService.getNextInCode(user.getCompany().getId()));
//        outbound.setOrigin(Constants.ONE);
//        outbound.setOriginType(Constants.WOUTBOUND_ORIGIN_TYPE.produce);
//        outbound.setOriginCode(mp.getCode());
//        outbound.setOriginId(mp.getId());
//        outbound.setPlanDate(DateUtil.getCurrentDate());
//        outbound.setProcedureId(mp.getProcedureId());
//        outbound.setUserId(user.getId());
//        outbound.setWarehouseId(mp.getFinishWarehouseId());
//        wOutboundService.create(outbound);
//
//        List<WOutboundDetail> detailList = new ArrayList<>();
//        List<WOutboundRecord> recordList = new ArrayList<>();
//        for(WorkorderRecordExtListVO tModel :allRecordList){
//            if(Constants.equalsInteger(tModel.getType(),Constants.WORKORDER_RECORD_TYPE.produce)){
//                if(tModel.getNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){
//                    continue;
//                }
//                //如果是产出
//                mp.setHasProduceNum(Constants.formatBigdecimal(tModel.getNum()).intValue()+Constants.formatIntegerNum(mp.getHasProduceNum()));
//
//                //物料+批次+工序+质量属性去重
//                WOutboundDetail detail =getWoutbondDetailByList(tModel,detailList);
//                if(detail!=null){
//                    detail.setNum(Constants.formatBigdecimal(detail.getNum()).add(tModel.getNum()));
//                }else{
//                    detail = new WOutboundDetail();
//                    detail.setDeleted(Constants.ZERO);
//                    detail.setCreateTime(DateUtil.getCurrentDate());
//                    detail.setCreateUser(user.getId());
//                    detail.setOutboundId(outbound.getId());
//                    detail.setRootDepartId(outbound.getRootDepartId());
//                    detail.setWarehouseId(outbound.getWarehouseId());
//                    detail.setLocationId(mp.getFinishWarehouseLocationId());
//                    detail.setNum(tModel.getNum());
//                    detail.setStatus(Constants.ONE);
//                    detail.setDoneNum(tModel.getNum());
//                    detail.setDoneDate(new Date());
//                    detail.setUnitId(tModel.getUnitId());
//                    detail.setBatch(tModel.getMaterialBatch());
//                    detail.setProcedureId(tModel.getProcedureId());
//                    detail.setMaterialId(tModel.getMaterialId());
//                    detail.setQualityType(tModel.getDoneType());
//                    detail.setWOutboundRecordInList(new ArrayList<>());
//                    detailList.add(detail);
//                }
//
//                WOutboundRecord record = new WOutboundRecord();
//                record.setDeleted(Constants.ZERO);
//                record.setCreateTime(DateUtil.getCurrentDate());
//                record.setCreateUser(user.getId());
//                record.setAppliancesId(tModel.getAppliancesId());
//                record.setBatch(detail.getBatch());
//                record.setRootDepartId(mp.getRootDepartId());
//                record.setNum(tModel.getNum());
//                record.setOutboundId(detail.getOutboundId());
//                record.setUnitId(detail.getUnitId());
//                record.setWarehouseId(detail.getWarehouseId());
//                record.setMaterialId(detail.getMaterialId());
//                record.setProcedureId(detail.getProcedureId());
//                record.setLocationId(detail.getLocationId());
//                record.setQualityType(detail.getQualityType());
//                detail.getWOutboundRecordInList().add(record);
//
//                WStock stock = getFromStockList(mp.getFinishWarehouseLocationId(),detail.getWarehouseId(),detail.getMaterialId(),detail.getBatch(),
//                        tModel.getProcedureId(),tModel.getDoneType(),stockList);
//                if(stock!=null){
//                    //如果库存对象已存在,直接增加对应的库存量
//                    stock.setNum(Constants.formatBigdecimal(stock.getNum()).add(Constants.formatBigdecimal(tModel.getNum())));
//                }else{
//                    stock = new WStock();
//                    stock.setMaterialId(detail.getMaterialId());
//                    stock.setBatch(detail.getBatch());
//                    stock.setWarehouseId(outbound.getWarehouseId());
//                    stock.setLocationId(mp.getFinishWarehouseLocationId());
//                    stock.setUnitId(detail.getUnitId());
//                    stock.setNum(Constants.formatBigdecimal(tModel.getNum()));
//                    stock.setProcedureId(tModel.getProcedureId());
//                    stock.setQualityType(tModel.getDoneType());
//                    //待更新库存信息
//                    stockList.add(stock);
//                }
//            }
//        }
//        for(WOutboundDetail detail : detailList){
//            wOutboundDetailExtMapper.insert(detail);
//            //记录库存变动记录
//            wStockRecordExtService.saveRecord(Constants.ONE,detail.getId(),user);
//            if(detail.getWOutboundRecordInList()!=null){
//                for(WOutboundRecord r : detail.getWOutboundRecordInList()){
//                    r.setDetailId(detail.getId());
//                    wOutboundRecordExtMapper.insert(r);
//                }
//            }
//        }
//        if(Constants.formatIntegerNum(mp.getHasProduceNum()) >Constants.formatIntegerNum(mp.getPlanNum())){
//            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该工单的产出数量不能大于工单计划数量!");
//        }
//    }
    private void dealAppliancePro(Workorder mp
            , LoginUserInfo user
            , List<WorkorderRecordExtListVO> allRecordList
@@ -801,78 +953,10 @@
                }
                //如果是产出
                mp.setHasProduceNum(Constants.formatBigdecimal(tModel.getNum()).intValue()+Constants.formatIntegerNum(mp.getHasProduceNum()));
                if(tModel.getDoneType() == null){
                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,工装器具【"+tModel.getAmodel().getCode()+"】产出质量属性为空,无法报工!");
                }
                if(!Constants.equalsInteger(tModel.getDoneType(),Constants.ZERO)){
                    //如果不良,累计工单的不良产出
                    mp.setUnqualifiedNum(Constants.formatIntegerNum(mp.getUnqualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
                }else{
                    //如果是合格,累计工单的合格数量
                    mp.setQualifiedNum(Constants.formatIntegerNum(mp.getQualifiedNum())+(Constants.formatBigdecimal(tModel.getNum()).intValue()));
                }
                //物料+批次+工序+质量属性去重
                WOutboundDetail detail =getWoutbondDetailByList(tModel,detailList);
                if(detail!=null){
                    detail.setNum(Constants.formatBigdecimal(detail.getNum()).add(tModel.getNum()));
                }else{
                    detail = new WOutboundDetail();
                    detail.setDeleted(Constants.ZERO);
                    detail.setCreateTime(DateUtil.getCurrentDate());
                    detail.setCreateUser(user.getId());
                    detail.setOutboundId(outbound.getId());
                    detail.setRootDepartId(outbound.getRootDepartId());
                    detail.setWarehouseId(outbound.getWarehouseId());
                    detail.setLocationId(mp.getFinishWarehouseLocationId());
                    detail.setNum(tModel.getNum());
                    detail.setStatus(Constants.ONE);
                    detail.setDoneNum(tModel.getNum());
                    detail.setDoneDate(new Date());
                    detail.setUnitId(tModel.getUnitId());
                    detail.setBatch(tModel.getMaterialBatch());
                    detail.setProcedureId(tModel.getProcedureId());
                    detail.setMaterialId(tModel.getMaterialId());
                    detail.setQualityType(tModel.getDoneType());
                    detail.setWOutboundRecordInList(new ArrayList<>());
                    detailList.add(detail);
                }
                WOutboundRecord record = new WOutboundRecord();
                record.setDeleted(Constants.ZERO);
                record.setCreateTime(DateUtil.getCurrentDate());
                record.setCreateUser(user.getId());
                record.setAppliancesId(tModel.getAppliancesId());
                record.setBatch(detail.getBatch());
                record.setRootDepartId(mp.getRootDepartId());
                record.setNum(tModel.getNum());
                record.setOutboundId(detail.getOutboundId());
                record.setUnitId(detail.getUnitId());
                record.setWarehouseId(detail.getWarehouseId());
                record.setMaterialId(detail.getMaterialId());
                record.setProcedureId(detail.getProcedureId());
                record.setLocationId(detail.getLocationId());
                record.setQualityType(detail.getQualityType());
                detail.getWOutboundRecordInList().add(record);
                WStock stock = getFromStockList(mp.getFinishWarehouseLocationId(),detail.getWarehouseId(),detail.getMaterialId(),detail.getBatch(),
                        tModel.getProcedureId(),tModel.getDoneType(),stockList);
                if(stock!=null){
                    //如果库存对象已存在,直接增加对应的库存量
                    stock.setNum(Constants.formatBigdecimal(stock.getNum()).add(Constants.formatBigdecimal(tModel.getNum())));
                }else{
                    stock = new WStock();
                    stock.setMaterialId(detail.getMaterialId());
                    stock.setBatch(detail.getBatch());
                    stock.setWarehouseId(outbound.getWarehouseId());
                    stock.setLocationId(mp.getFinishWarehouseLocationId());
                    stock.setUnitId(detail.getUnitId());
                    stock.setNum(Constants.formatBigdecimal(tModel.getNum()));
                    stock.setProcedureId(tModel.getProcedureId());
                    stock.setQualityType(tModel.getDoneType());
                    //待更新库存信息
                    stockList.add(stock);
                }
                //产出合格
               this.createOutDetail(user,outbound,mp,tModel,Constants.ZERO,detailList,stockList);
               //产出不良
                this.createOutDetail(user,outbound,mp,tModel,Constants.ONE,detailList,stockList);
            }
        }
        for(WOutboundDetail detail : detailList){
@@ -890,6 +974,68 @@
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,该工单的产出数量不能大于工单计划数量!");
        }
    }
    public void createOutDetail(LoginUserInfo user,WOutbound outbound,Workorder mp,WorkorderRecordExtListVO tModel,Integer doneType
            ,List<WOutboundDetail> detailList,List<WStock> stockList ){
        //物料+批次+工序+质量属性去重
        WOutboundDetail detail =  new WOutboundDetail();
        detail.setDeleted(Constants.ZERO);
        detail.setCreateTime(DateUtil.getCurrentDate());
        detail.setCreateUser(user.getId());
        detail.setOutboundId(outbound.getId());
        detail.setRootDepartId(outbound.getRootDepartId());
        detail.setWarehouseId(outbound.getWarehouseId());
        detail.setLocationId(mp.getFinishWarehouseLocationId());
        detail.setNum(BigDecimal.valueOf(doneType.equals(Constants.ZERO)?tModel.getQualifiedNum():tModel.getUnqualifiedNum()));
        detail.setStatus(Constants.ONE);
        detail.setDoneNum(detail.getNum());
        detail.setDoneDate(new Date());
        detail.setUnitId(tModel.getUnitId());
        detail.setBatch(tModel.getMaterialBatch());
        detail.setProcedureId(tModel.getProcedureId());
        detail.setMaterialId(tModel.getMaterialId());
        detail.setQualityType(doneType);
        detail.setWOutboundRecordInList(new ArrayList<>());
        detailList.add(detail);
        WOutboundRecord record = new WOutboundRecord();
        record.setDeleted(Constants.ZERO);
        record.setCreateTime(DateUtil.getCurrentDate());
        record.setCreateUser(user.getId());
        record.setAppliancesId(tModel.getAppliancesId());
        record.setBatch(detail.getBatch());
        record.setRootDepartId(mp.getRootDepartId());
        record.setNum(tModel.getNum());
        record.setOutboundId(detail.getOutboundId());
        record.setUnitId(detail.getUnitId());
        record.setWarehouseId(detail.getWarehouseId());
        record.setMaterialId(detail.getMaterialId());
        record.setProcedureId(detail.getProcedureId());
        record.setLocationId(detail.getLocationId());
        record.setQualityType(detail.getQualityType());
        detail.getWOutboundRecordInList().add(record);
        WStock stock = getFromStockList(mp.getFinishWarehouseLocationId(),detail.getWarehouseId(),detail.getMaterialId(),detail.getBatch(),
                tModel.getProcedureId(),tModel.getDoneType(),stockList);
        if(stock!=null){
            //如果库存对象已存在,直接增加对应的库存量
            stock.setNum(Constants.formatBigdecimal(stock.getNum()).add(Constants.formatBigdecimal(tModel.getNum())));
        }else{
            stock = new WStock();
            stock.setMaterialId(detail.getMaterialId());
            stock.setBatch(detail.getBatch());
            stock.setWarehouseId(outbound.getWarehouseId());
            stock.setLocationId(mp.getFinishWarehouseLocationId());
            stock.setUnitId(detail.getUnitId());
            stock.setNum(Constants.formatBigdecimal(tModel.getNum()));
            stock.setProcedureId(tModel.getProcedureId());
            stock.setQualityType(tModel.getDoneType());
            //待更新库存信息
            stockList.add(stock);
        }
    }
    private WStock initMaterialNum(Integer materialId, BigDecimal num) {
        WStock s = new WStock();
@@ -1111,7 +1257,52 @@
        return PageData.from(new PageInfo<>(result));
    }
    @Override
    public PageData<WStockExtListVO> choiceStockPageForPlans(PageWrap<QueryWStockDto> pageWrap,LoginUserInfo userInfo) {
        Plans plans =plansExtMapper.selectById(pageWrap.getModel().getPlansId());
        if(Objects.isNull(plans)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到工序计划信息!");
        }
        Device device = deviceExtMapper.selectById(pageWrap.getModel().getDeviceId());
        if(Objects.isNull(plans)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到设备信息!");
        }
        //查询并验证工单信息
        this.getPlansAndValid(userInfo,plans);
        //查询全部bom组成数据,如果有BOM配置,按照BOM组成进行投料,如果没有BOM配置,则投料物料为待生产库位的物料本身
        QueryBomDetailExtDTO bdparam = initBomParamForPlans(userInfo,plans);
        List<BomDetailExtListVO> bomDetailList = null;
        if(bdparam!=null){
            bomDetailList = bomDetailExtMapper.selectList(bdparam);
            List<Integer> materialDistributeId = bomDetailList.stream().map(BomDetailExtListVO::getMaterialId).collect(Collectors.toList());
            pageWrap.getModel().setMaterialDistributeId(materialDistributeId);
        }else{
            //查询物料BOM信息
            Bom bom = bomExtMapper.selectOne(new QueryWrapper<Bom>().eq("MATERIAL_ID",plans.getMaterialId()).eq("DELETED",Constants.ZERO).last(" limit 1 "));
            if(Objects.isNull(bom)){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到BOM信息!");
            }
            RouteProcedure currentRouteProcedure   = routeProcedureExtMapper.selectOne(new QueryWrapper<RouteProcedure>()
                    .eq("ROUTE_ID",bom.getRouteId())
                    .eq("PROCEDURE_ID",plans.getProcedureId())
                    .last(" limit 1 ")
            );
            if(currentRouteProcedure!=null){
                RouteProcedure routeProcedure   = routeProcedureExtMapper.selectOne(new QueryWrapper<RouteProcedure>()
                        .eq("ROUTE_ID",currentRouteProcedure.getRouteId()).apply(" SORTNUM <  " + currentRouteProcedure.getSortnum() ).eq("STATUS",Constants.ONE).orderByDesc(" SORTNUM ").last(" limit 1  ")
                );
                if(Objects.isNull(routeProcedure)){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未查询到生产物料上一步工序信息!");
                }
                pageWrap.getModel().setProcedureId(routeProcedure.getProcedureId());
                pageWrap.getModel().setMaterialId(plans.getMaterialId());
            }
        }
        pageWrap.getModel().setLocationId(device.getProduceWarehouseLocationId());
        PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity());
        List<WStockExtListVO> result = wStockExtMapper.choiceStockList(pageWrap.getModel());
        return PageData.from(new PageInfo<>(result));
    }
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
@@ -1170,18 +1361,21 @@
        workorderRecord.setSalaryPrice(salaryParam.getSalary());
        workorderRecord.setSalaryType(salaryParam.getType());
        workorderRecord.setSalaryUnqualified(salaryParam.getUnqualified());
        //计件工资
        if(salaryParam.getType().equals(Constants.ZERO)){
            workorderRecord.setSalaryNum(salaryParam.getNum());
            workorderRecord.setSalary(salaryParam.getSalary().multiply(salaryParam.getUnqualified()==Constants.ZERO?num:createWorkorderRecordDTO.getUnQualifiedNum()));
            workorderRecord.setSalary(salaryParam.getSalary().multiply(salaryParam.getUnqualified()==Constants.ONE?num:createWorkorderRecordDTO.getQualifiedNum()));
        }else{
            workorderRecord.setDuration(createWorkorderRecordDTO.getDuration());
            workorderRecord.setSalary(BigDecimal.valueOf(createWorkorderRecordDTO.getDuration()).multiply(salaryParam.getSalary()).divide(new BigDecimal(3600)));
        }
        //插入工单操作记录,并且判断是否更改为工单的状态【生产中】
        updateOrderInfo(loginUserInfo,workorder,Constants.WORKORDER_HISTORY_STATUS.produce);
        workorderRecordExtMapper.insert(workorderRecord);
        return workorderRecord;
    }
}
server/src/main/java/doumeemes/service/system/impl/WxLoginServiceImpl.java
@@ -134,7 +134,7 @@
            loginLog.setSuccess(Boolean.TRUE);
            systemLoginLogService.create(loginLog);
            String session = (String)subject.getSession().getId();
            wxLoginVO.setLoginStatus(Constants.ONE);
            wxLoginVO.setLoginStatus(Constants.ZERO);
            wxLoginVO.setSession(session);
            return wxLoginVO;
        }catch (AuthenticationException e) {
server/src/main/resources/mappers/PlansExtMapper.xml
@@ -123,7 +123,7 @@
  <select id="selectByModel" parameterType="doumeemes.dao.ext.dto.QueryPlansExtDTO" resultMap="PlansExtListVO">
  SELECT
  `a`.*
    ,(  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status !=6) AS workorderDistributNum
    ,ifnull((  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id and b.status not in (7,8) ),0) AS workorderDistributNum
    from plans a
    <where>
    <if test="id != null">
@@ -363,11 +363,13 @@
      `usermodel`.`SYSTEMID` AS USERMODEL_SYSTEMID,
      `usermodel`.`INVALID_TIME` AS USERMODEL_INVALID_TIME,
      `usermodel`.`TYPE` AS USERMODEL_TYPE
    ,(  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0 AND b.PLAN_ID = a.id  and b.status !=6) AS workorderDistributNum ,
    , ifnull((  SELECT sum( b.PLAN_NUM ) FROM  workorder b  WHERE b.deleted = 0  AND b.PLAN_ID = a.id  and b.status !=6),0) AS workorderDistributNum ,
    `mmodel`.name as materialName , `mmodel`.code as materialCode ,`fmodel`.name as factoryName , `pmodel`.name as produceName ,
      concat(`usermodel`.realname,' ',`usermodel`.mobile) as planUserName , `umodel`.name as unitName ,
      w.PLAN_CODE as workPlanCode
      w.PLAN_CODE as workPlanCode , w.SALESORDER as salesOrder ,
      w.START_DATE as workPlanStartDate  , w.PLAN_DATE as workPlanEndDate,
      w.`PLAN_DATE` as workPlanPlanDate,
      ifnull((select  sum(worder.PLAN_NUM) from workorder worder where worder.PLAN_ID = a.id and worder.STATUS not in (7,8)  ),0) as produceNum
    FROM `plans` `a`
    LEFT JOIN `department` `dmodel` ON a.DEPART_ID=dmodel.ID
    LEFT JOIN `material_distribute` `mdmodel` ON a.MATERIAL_ID=mdmodel.ID
@@ -420,6 +422,12 @@
      </if>
      <if test="planDate != null">
        AND `a`.`PLAN_DATE` = #{planDate}
      </if>
      <if test="planDateStartDate != null and planDateStartDate != ''">
        AND `a`.`PLAN_DATE` >= concat(#{planDateStartDate},' 00:00:00')
      </if>
      <if test="planDateEndDate != null and planDateEndDate != ''">
        AND concat(#{planDateEndDate},' 23:59:59') >= `a`.`PLAN_DATE`
      </if>
      <if test="materialId != null">
        AND `a`.`MATERIAL_ID` = #{materialId}
@@ -763,12 +771,12 @@
      <if test="usermodelInvalidTime != null">
        AND `usermodel`.`INVALID_TIME` = #{usermodelInvalidTime}
      </if>
      <if test="startDate != null">
        AND `a`.`PLAN_DATE` >= #{startDate}
      </if>
      <if test="endDate != null">
        AND   #{endDate} >= `a`.`PLAN_DATE`
      </if>
<!--      <if test="startDate != null">-->
<!--        AND `a`.`PLAN_DATE` >= #{startDate}-->
<!--      </if>-->
<!--      <if test="endDate != null">-->
<!--        AND   #{endDate} >= `a`.`PLAN_DATE`-->
<!--      </if>-->
      <if test="mixParam != null and mixParam!=''">
        AND  (mmodel.name like concat('%',#{mixParam},'%') or mmodel.code like concat('%',#{mixParam},'%') or pmodel.name like concat('%',#{mixParam},'%'))
      </if>
server/src/main/resources/mappers/SalaryParamMapper.xml
@@ -13,14 +13,16 @@
        from
            salary_param sp
        LEFT JOIN procedures p on p.ID = sp.PROCEDURE_ID
        LEFT JOIN material m on m.ID = sp.MATERIAL_ID
        LEFT JOIN material_distribute md on md.ID = sp.MATERIAL_ID
        LEFT JOIN material m on m.ID = md.MATERIAL_ID
        LEFT JOIN `system_user` su  on su.ID = sp.CREATE_USER
        where
        sp.DELETED = 0
        <if test="model.keyWord != null and model.keyWord != ''">
           ( and  p`NAME` like concat('%',#{model.keyWord},'%')
            or   p.`CODE` = #{model.keyWord})</if>
           and  ( m.`NAME` like concat('%',#{model.keyWord},'%')
            or   m.`CODE` = #{model.keyWord})</if>
        <if test="model.procedureName != null and model.procedureName != ''"> and p.`NAME` like concat('%',#{model.procedureName},'%')</if>
        <if test="model.type != null"> and sp.`TYPE` = #{model.type}</if>
        order by sp.CREATE_TIME desc
    </select>
</mapper>
server/src/main/resources/mappers/UserDeviceExtMapper.xml
@@ -201,7 +201,7 @@
        AND `umodel`.`ROOT_DEPART_ID` = #{umodelRootDepartId}
      </if>
      <if test="umodelName != null and umodelName != ''">
        AND `umodel`.`NAME` = #{umodelName}
        AND `umodel`.`NAME` like concat('%', #{umodelName} , '%')
      </if>
      <if test="umodelPhone != null and umodelPhone != ''">
        AND `umodel`.`PHONE` = #{umodelPhone}
server/src/main/resources/mappers/WorkPlansExtMapper.xml
@@ -156,10 +156,10 @@
        AND `a`.`SALESORDER` like concat('%',#{salesorder},'%')
      </if>
      <if test="startDateStart != null and startDateStart != ''">
        AND `a`.`START_DATE` >= concat(#{planDateStart},' 00:00:00')
        AND `a`.`START_DATE` >= concat(#{startDateStart},' 00:00:00')
      </if>
      <if test="startDateEnd != null and startDateEnd != ''">
        AND concat(#{planDateEnd},' 23:59:59') >= `a`.`START_DATE`
        AND concat(#{startDateEnd},' 23:59:59') >= `a`.`START_DATE`
      </if>
      <if test="planDateStart != null and planDateStart != ''">
        AND `a`.`PLAN_DATE` >= concat(#{planDateStart},' 00:00:00')
@@ -168,7 +168,7 @@
        AND concat(#{planDateEnd},' 23:59:59') >= `a`.`PLAN_DATE`
      </if>
    </where>
        order by a.PLAN_DATE desc, a.CREATE_TIME  desc
        order by a.START_DATE desc, a.CREATE_TIME  desc
  </select>
server/src/main/resources/mappers/WorkorderRecordExtMapper.xml
@@ -453,11 +453,11 @@
    <if test="materialName != null and materialName !=''">
      AND  (c.`name` like concat('%', #{materialName},'%') or c.`code` like concat('%', #{materialName},'%'))
    </if>
    <if test="startDate != null">
      AND  a.`CREATE_TIME` >= #{startDate}
    <if test="startDate != null and startDate != ''">
      AND  a.`CREATE_TIME` >= concat(#{startDate},' 00:00:00')
    </if>
    <if test="endDate != null">
      AND   #{endDate} >= a.`CREATE_TIME`
    <if test="endDate != null and endDate != ''">
      AND   concat(#{endDate},' 23:59:59') >= a.`CREATE_TIME`
    </if>
    <if test="userId != null">
      AND  a.`CREATE_USER` = #{userId}
@@ -479,10 +479,10 @@
      AND  `CREATE_USER` = #{userId}
    </if>
    <if test="startDate != null">
      AND  a.`CREATE_TIME` >= #{startDate}
      AND  `CREATE_TIME` >= #{startDate}
    </if>
    <if test="endDate != null">
      AND   #{endDate} >= a.`CREATE_TIME`
      AND   #{endDate} >= `CREATE_TIME`
    </if>
    group by  `CREATE_USER`
   <!-- order by `CREATE_TIME` desc-->
web_standard/.env.development
@@ -13,16 +13,15 @@
# æŽ¥å£å‰ç¼€
VUE_APP_API_PREFIX = ''
# æµ‹è¯•服务器
# VUE_APP_BASE_URL = 'http://139.186.142.91:10012/'
# æ±‡æ™º
# VUE_APP_BASE_URL = 'https://106.14.220.133:10012/'
# ç„¦æ¾
# VUE_APP_BASE_URL = 'http://192.168.0.36:10021/'
# ä»»åº·
VUE_APP_BASE_URL = 'http://192.168.0.15:10021/'
# VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
# æ±Ÿè
# VUE_APP_BASE_URL = 'http://192.168.0.35:10021/'
# æµ‹è¯•服务器
VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
web_standard/.env.production
@@ -8,21 +8,9 @@
VUE_APP_ROUTER_MODE = 'hash'
# é¡¹ç›®ä¸Šä¸‹æ–‡è·¯å¾„
# VUE_APP_CONTEXT_PATH = '/doumeeplant_web/'
VUE_APP_CONTEXT_PATH = '/web/'
# æŽ¥å£å‰ç¼€
VUE_APP_API_PREFIX = '/doumeeplant'
# æµ‹è¯•服务器
# VUE_APP_BASE_URL = 'http://139.186.142.91:10012/'
# æ¼”示服务器
# VUE_APP_BASE_URL = 'http://121.41.112.139:10012/'
# æ­£å¼çŽ¯å¢ƒ
# VUE_APP_BASE_URL = 'http://127.0.0.1:10012/'
#艾丽格斯 https://hsky.doumee.com/doumeeplant_api/doc.html
# VUE_APP_BASE_URL = 'https://hsky.doumee.com/doumeeplant_api/'
# VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
VUE_APP_BASE_URL = 'https://www.mes.red/doumeeplant/'
web_standard/coderd.json
@@ -4,7 +4,7 @@
    "alias": "eva",
    "command": "page",
    "option": {
      "resources": "workorder_check_attr_ext"
      "resources": "salary_param"
    }
  }
}
web_standard/public/salary_import_template.xlsx
Binary files differ
web_standard/src/api/business/salaryParam.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
import request from '../../utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/business/salaryParam/page', data, {
    trim: true
  })
}
// å¯¼å‡ºExcel
export function exportExcel (data) {
  return request.post('/business/salaryParam/exportExcel', data, {
    trim: true,
    download: true
  })
}
// åˆ›å»º
export function create (data) {
  return request.post('/business/salaryParam/create', data)
}
// ä¿®æ”¹
export function updateById (data) {
  return request.post('/business/salaryParam/updateById', data)
}
// åˆ é™¤
export function deleteById (id) {
  return request.get(`/business/salaryParam/delete/${id}`)
}
// æ‰¹é‡åˆ é™¤
export function deleteByIdInBatch (ids) {
  return request.get('/business/salaryParam/delete/batch', {
    params: {
      ids
    }
  })
}
web_standard/src/api/ext/salaryStatistic.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
import request from '../../utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/ext/workorderRecordExt/salaryStatistic', data, {
    trim: true
  })
}
// å¯¼å‡ºExcel
export function exportExcel (data) {
  return request.post('/ext/workorderRecordExt/exportSalaryStatistics', data, {
    trim: true,
    download: true
  })
}
web_standard/src/api/ext/userSalary.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
import request from '../../utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  return request.post('/ext/workorderRecordExt/userSalary', data, {
    trim: true
  })
}
// å¯¼å‡ºExcel
export function exportExcel (data) {
  return request.post('/ext/workorderRecordExt/exportUserSalary', data, {
    trim: true,
    download: true
  })
}
web_standard/src/assets/style/lib.css
@@ -115,6 +115,7 @@
.success{ color: #70B603; }
.waring{ color: #F59A23; }
.error{ color: #f00; }
.c1{color: #111}.c2{color: #222}.c3{ color: #333;}.c6{ color: #666;}.cc{ color: #ccc;}.cf{ color: #fff;}
/* /deep/ .uicon-close .u-icon--right{ position: absolute; right: 30px; top: 30px; z-index: 999;} */
.popCloseBtn{ position: absolute; width:50px; height:50px; right: 20px; top: 20px;}
.fixedHeader{ position: absolute; left: 0; top: 0;}
web_standard/src/assets/style/style.scss
@@ -89,7 +89,7 @@
.el-date-editor--daterange.el-input__inner,
.el-date-editor--timerange.el-input,
.el-date-editor--timerange.el-input__inner {
  width: 220px !important;
  width: 240px !important;
}
.el-input__inner {
web_standard/src/components/business/OperaSalaryParamWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,254 @@
<template>
  <GlobalWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <el-form :model="form" ref="form" :rules="rules">
      <el-form-item label="计价方式" prop="type">
        <el-select v-model="form.type" placeholder="请选择计价方式" clearable>
          <el-option
            v-for="item in type"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="工厂" prop="departId">
        <el-select v-model="form.departId" placeholder="请选择工厂" :disabled="isEdit" clearable @change="selectFactoey">
          <el-option
            v-for="item in factories"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="物料" prop="materialId">
        <el-select v-model="form.materialId" placeholder="请选择物料" :disabled="isEdit" clearable @change="selectMaterial">
          <el-option
            v-for="item in materials"
            :key="item.realMaterialId"
            :label="item.mmodel.name"
            :value="item.realMaterialId"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="工序" prop="procedureId">
        <el-select v-model="form.procedureId" placeholder="请选择工序" :disabled="isEdit" clearable>
          <el-option
            v-for="item in productes"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="工资单价(元)" prop="salary">
        <el-input v-model="form.salary" placeholder="请输入工资单价(元)" @input="inputZAction(form, 'salary')" v-trim/>
      </el-form-item>
      <el-form-item label="标准效率" prop="num">
        <div style="display: flex;">
          <el-input v-model="form.num" v-trim/>/
          <el-input v-model="form.hours" v-trim/><div class="unit">小时</div>
          <el-input v-model="form.minute" v-trim/><div class="unit">分钟</div>
          <el-input v-model="form.second" v-trim/><div>秒</div>
        </div>
      </el-form-item>
      <el-form-item label="不良品是否计入" prop="unqualified">
        <el-switch v-model="form.unqualified" :inactive-value="0" :active-value="1"></el-switch>
        <!-- <el-input v-model="form.unqualified" placeholder="请输入不良品是否计入 0否 1是" v-trim/> -->
      </el-form-item>
    </el-form>
  </GlobalWindow>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { getDepartmentListByConditon } from '@/api/ext/departmentExt'
import { getBomMaterialList } from '@/api/ext/bomExt'
import { routeExt as proceList } from '@/api/ext/routeProcedureExt'
import { numRule } from '@/utils/form'
export default {
  name: 'OperaSalaryParamWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      // è¡¨å•数据
      form: {
        id: null,
        materialId: '',
        createUser: '',
        createTime: '',
        updateUser: '',
        updateTime: '',
        remark: '',
        rootDepartId: '',
        departId: '',
        procedureId: '',
        bomId: '',
        salary: '',
        num: '',
        times: '',
        hours: '',
        minute: '',
        second: '',
        unqualified: 0,
        type: ''
      },
      isEdit: false,
      type: [
        { label: '计件', value: 0 },
        { label: '计时', value: 1 },
      ],
      factories: [],
      materials: [],
      productes: [],
      // éªŒè¯è§„则
      rules: {
        departId: [
          { required: true, validator: numRule, message: '请选择工厂', tigger: 'change' }
        ],
        materialId: [
          { required: true, validator: numRule, message: '请选择物料', tigger: 'change' }
        ],
        procedureId: [
          { required: true, validator: numRule, message: '请选择工序', tigger: 'change' }
        ],
        salary: [
          { required: true, validator: numRule, message: '请输入工资单价', tigger: 'blur' }
        ],
      }
    }
  },
  created () {
    this.config({
      api: '/business/salaryParam',
      'field.id': 'id'
    })
    this.initData()
  },
  methods: {
    open (title, target) {
      this.title = title
      this.visible = true
      this.isEdit = false
      // æ–°å»º
      if (target == null) {
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.form[this.configData['field.id']] = null
          this.form.times = ''
          this.form.second = ''
          this.form.minute = ''
          this.form.hours = ''
          this.form.departId = this.factories[0]?this.factories[0].id:''
          this.selectFactoey(this.form.departId)
        })
        return
      }
      // ç¼–辑
      this.$nextTick(() => {
        this.isEdit = true
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        let { times } = target
        this.form.second = +times%60
        let lesMin = Math.floor(+times/60)
        this.form.minute = lesMin%60
        this.form.hours = Math.floor(lesMin/60)
        this.selectFactoey(this.form.departId, true)
      })
    },
    initData() {
      getDepartmentListByConditon({ type: 1 })
        .then(res => {
          this.factories = res
        })
        .catch(err => {
          console.log(err)
        })
    },
    selectFactoey (v, isEdit=false) {
      // console.log(v)
      if (!isEdit) {
        this.materials = []
        this.form.materialId = ''
        this.form.procedureId = ''
        this.productes = []
      }
      getBomMaterialList({ departId: v })
        .then(res => {
          // console.log(res)
          this.materials = res
          // if (!isEdit) {
          //   this.form.materialId = res[0]?res[0].materialId:''
          // }
          // this.selectMaterial(this.form.materialId)
        })
        .catch(err => {
          console.log(err)
        })
    },
    selectMaterial (id, isEdit) {
      let routeId;
      for (const item of this.materials) {
        if (item.realMaterialId === id) {
          routeId = item.routeId
        }
      }
      proceList(routeId)
        .then(res => {
          // console.log(res)
          this.productes = res.proceList
          if (!isEdit) {
            // debugger
            this.form.procedureId = this.productes[0]?this.productes[0].id:''
          }
        }).catch(err => {
          console.log(err)
        })
    },
    // 2位有效销售(正)
    inputZAction(item, key) {
      item[key] = item[key].replace(/[^\d.]/g, '')
                      .replace(/\.{2,}/g, '.')
                      .replace('.', '$#$')
                      .replace(/\./g, '')
                      .replace('$#$', '.')
                      .replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
                      .replace(/^\./g, '')
    },
    confirm () {
      // console.log((+this.form.hours) * 3600);
      // console.log((+this.form.minute) * 60);
      // console.log(this.form.second);
      this.form.times = (+this.form.hours) * 3600 + (+this.form.minute)* 60 + (+this.form.second)
      if (this.form.id == null || this.form.id === '') {
        this.__confirmCreate()
        return
      }
      this.__confirmEdit()
    },
  },
}
</script>
<style>
.unit {
  white-space: nowrap;
}
</style>
web_standard/src/components/common/Header.vue
@@ -8,14 +8,18 @@
          {{title}}
        </h2>
        <div class="user">
          <div class="user_help" @click="jumpWord">
            <img src="@/assets/images/ic_help@2x.png" alt="" />
            <span>帮助文档</span>
          <div class="help" @click="jumpWord">
            <div class="user_help">
              <img src="@/assets/images/ic_help@2x.png" alt="" />
              <span>帮助文档</span>
            </div>
            <span class="ml5 mr5">|</span>
            <span>企业代码: {{ tempId }}</span>
          </div>
          <div style="margin-right: 10px;">企业代码: {{ tempId }}</div>
          <!-- <div style="margin-right: 10px;">企业代码: {{ tempId }}</div> -->
          <el-dropdown trigger="click" style="margin-right: 20px;" v-userState @command="select">
            <span class="el-dropdown-link">
            {{ tempC }}<i class="el-icon-arrow-down el-icon--right"></i>
            <span class="c2 f16">{{ tempC }}</span><i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item v-for="(item, index) in cList" :key="index" :command='item.id'>{{ item.name }}</el-dropdown-item>
@@ -131,7 +135,7 @@
  created () {
    if (this.userInfo.curComDepartment) {
      this.tempC = this.userInfo.curComDepartment.name
      this.tempId = this.userInfo.curComDepartment.id
      this.tempId = this.userInfo.company.id
    }
    getDepartmentListByConditon({
      type: 0
@@ -276,30 +280,41 @@
      // width: 30%;
      flex-shrink: 0;
      // text-align: right;
      vertical-align: middle;
      display: flex;
      align-items: center;
      .user_help {
        width: 111px;
        height: 36px;
      .help {
        display: flex;
        height: 29px;
        line-height: 38px;
        align-items: center;
        justify-content: center;
        background: #F7F7F7;
        border-radius: 4px;
        vertical-align: middle;
        margin-right: 30px;
        cursor: pointer;
        img {
          width: 16px;
          height: 16px;
          margin-right: 7px !important;
        }
        span {
          font-size: 16px;
          font-size: 12px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          vertical-align: middle;
          color: #666666;
        }
        .user_help {
          // width: 111px;
          // background: #F7F7F7;
          cursor: pointer;
          img {
            width: 16px;
            height: 16px;
            margin-right: 7px !important;
            vertical-align: middle;
          }
        }
      }
      .el-dropdown {
        flex-shrink: 0;
        top: 2px;
web_standard/src/components/ext/OperaWorkorderDetailWindow.vue
@@ -1,28 +1,23 @@
<template>
  <GlobalWindow
    :title="title"
    width="1182px"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
  <GlobalWindow :title="title" width="1182px" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
    <div style="min-width:1150px">
      <el-form :model="form" ref="form" label-width="100px" label-suffix=":" inline>
        <div style="margin-bottom:15px">
          <span class="text-code">{{ form.procedureName + ' | ' + form.mmodel.name + ' ' + form.mmodel.code }}</span>
          <!-- 0已创建、1已备料、2已完工检、3已检验、4已报工、、6已取消 -->
          <span v-if="form.status==0" style="background-color: #305ED5;" class="status-log">已创建</span>
          <span v-else-if="form.status==6" style="background-color: #BBBBBB;" class="status-log">已取消</span>
          <span v-else style="background-color: #03AF76;" class="status-log">{{ form.status==1 ? '已备料' : form.status==2 ? '已完工检' : form.status==3 ? '已检验' : '已报工' }}</span>
          <span v-if="form.status == 0" style="background-color: #305ED5;" class="status-log">已创建</span>
          <span v-else-if="form.status == 6" style="background-color: #BBBBBB;" class="status-log">已取消</span>
          <span v-else style="background-color: #03AF76;" class="status-log">{{ form.status == 1 ? '已备料' : form.status == 2 ?
            '已完工检' : form.status == 3 ? '已检验' : '已报工' }}</span>
          <!-- <span v-if="form.status==3" style="background-color: #BBBBBB;" class="status-log">已取消</span> -->
        </div>
        <el-form-item label="工单编号" prop="workorderCode" class="count-style" >
        <el-form-item label="工单编号" prop="workorderCode" class="count-style">
          {{ form.code }}
        </el-form-item>
        <el-form-item label="生产日期" prop="proTime" class="count-style" >
        <el-form-item label="生产日期" prop="proTime" class="count-style">
          {{ form.planDate }}
        </el-form-item>
        <el-form-item label="生产批次号" prop="batch" class="count-style" >
        <el-form-item label="生产批次号" prop="batch" class="count-style">
          {{ form.batch }}
        </el-form-item>
        <!-- <el-form-item label="计划人员" prop="planUser" class="count-style" >
@@ -31,8 +26,8 @@
        <el-form-item label="计划日期" prop="planDate" class="count-style" >
          {{ form.pmodel.createTime }}
        </el-form-item> -->
        <el-form-item label="生产数量" prop="machine" class="count-style" >
          {{ form.planNum ? (form.planNum + (form.umodel.name ? form.umodel.name : '')) : '0'  }}
        <el-form-item label="生产数量" prop="machine" class="count-style">
          {{ form.planNum ? (form.planNum + (form.umodel.name ? form.umodel.name : '')) : '0' }}
        </el-form-item>
        <!-- <el-form-item label="计划数量" prop="planNum" class="count-style" >
          {{ form.pmodel.num }}
@@ -43,42 +38,36 @@
        <!-- <el-form-item label="发布日期" prop="startDate" class="count-style" >
          {{ form.pmodel.publishDate }}
        </el-form-item> -->
        <el-form-item label="原工单号" prop="originWorkorderId" class="count-style" >
        <el-form-item label="原工单号" prop="originWorkorderId" class="count-style">
          {{ form.originWorkorderId }}
        </el-form-item>
        <el-form-item label="分配人员" prop="distributeUser" class="count-style" >
        <el-form-item label="分配人员" prop="distributeUser" class="count-style">
          {{ form.userName }}
        </el-form-item>
        <el-form-item label="分配时间" prop="distributeTime" class="count-style" >
        <el-form-item label="分配时间" prop="distributeTime" class="count-style">
          {{ form.createTime }}
        </el-form-item>
        <el-form-item label="生产人员" prop="proUser" class="count-style" >
        <el-form-item label="生产人员" prop="proUser" class="count-style">
          <div v-for="(item, index) in form.proUserList" :key="index">{{ item.proUserDepartName }}</div>
          <!-- {{ form.proUserName + (form.proUserDepartName ? ('/' + form.proUserDepartName) : '') }} -->
        </el-form-item>
        <el-form-item label="生产设备" prop="machine" class="count-style" >
          {{ form.pgmodel && `【${form.pgmodel.code}】${form.pgmodel.name}`}}
        <el-form-item label="生产设备" prop="machine" class="count-style">
          {{ form.pgmodel && `【${form.pgmodel.code}】${form.pgmodel.name}` }}
        </el-form-item>
        <el-form-item label="合格数量" prop="qualifiedNum" class="count-style" >
        <el-form-item label="合格数量" prop="qualifiedNum" class="count-style">
          {{ form.qualifiedNum ? (form.qualifiedNum + (form.umodel.name ? form.umodel.name : '')) : '0' }}
        </el-form-item>
        <el-form-item label="不良数量" prop="unqualifiedNum" class="count-style" >
        <el-form-item label="不良数量" prop="unqualifiedNum" class="count-style">
          {{ form.unqualifiedNum ? (form.unqualifiedNum + (form.umodel.name ? form.umodel.name : '')) : '0' }}
        </el-form-item>
      </el-form>
      <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="生产报工" name="first">
          <el-table
            v-loading="isSearch"
            :data="report"
            border
            show-summary
            :summary-method="getReportSummaries"
          >
          <!-- stripe -->
          <el-table v-loading="isSearch" :data="report" border show-summary :summary-method="getReportSummaries">
            <!-- stripe -->
            <el-table-column prop="createTime" label="报工时间" min-width="140px"></el-table-column>
            <el-table-column label="生产人员" show-overflow-tooltip min-width="100px">
              <template slot-scope="{row}">
@@ -86,11 +75,27 @@
              </template>
            </el-table-column>
            <el-table-column prop="machine" label="生产设备" min-width="100px">
              {{ form.pgmodel && `【${form.pgmodel.code}】${form.pgmodel.name}`}}
              {{ form.pgmodel && `【${form.pgmodel.code}】${form.pgmodel.name}` }}
            </el-table-column>
            <!-- <el-table-column prop="amodel.code" label="工装容器编号" show-overflow-tooltip="" min-width="100px"></el-table-column> -->
            <el-table-column prop="mmodel.name" label="物料名称" show-overflow-tooltip min-width="100px"></el-table-column>
            <el-table-column prop="doneType" label="报工类型" min-width="60px">
            <el-table-column prop="qualifiedNum" label="合格数量" min-width="100px">
              <template slot-scope="{row}">
                <span class="valid-style">{{ row.qualifiedNum + row.umodel.name }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="unqualifiedNum" label="不良数量" min-width="100px">
              <template slot-scope="{row}">
                <span class="unvalid-style">{{ row.unqualifiedNum + row.umodel.name }}</span>
                <!-- <span :class="row.materialDonetype==0 ? 'valid-style' : ''">{{ row.num + row.umodel.name }}</span> -->
              </template>
            </el-table-column>
            <el-table-column prop="num" label="报工数量" min-width="100px">
              <template slot-scope="{row}">
                <span>{{ row.num + row.umodel.name }}</span>
              </template>
            </el-table-column>
            <!-- <el-table-column prop="doneType" label="报工类型" min-width="60px">
              <template slot-scope="{row}">
                <span v-if="row.doneType==0" class="valid-style">合格</span>
                <span v-else-if="row.doneType==1" class="unvalid-style">不良</span>
@@ -102,15 +107,11 @@
              <template slot-scope="{row}">
                <span :class="row.doneType==0 ? 'valid-style' : (row.doneType==1 ? 'unvalid-style' :(row.doneType==2 ? 'scrap-style' : ''))">{{ row.num ? (row.num + (row.umodel.name ? row.umodel.name : '')) : '0' }}</span>
              </template>
            </el-table-column>
            </el-table-column> -->
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="生产检验" name="second">
          <el-table
            v-loading="isSearch"
            :data="verify"
            stripe
            border>
          <el-table v-loading="isSearch" :data="verify" stripe border>
            <el-table-column prop="code" label="检验记录编号" min-width="140px"></el-table-column>
            <el-table-column prop="createTime" label="检验时间" min-width="140px"></el-table-column>
            <el-table-column prop="smodelRealName" label="检验人员" min-width="100px"></el-table-column>
@@ -138,30 +139,23 @@
            </el-table-column>
            <el-table-column prop="devmodel.code" label="生产设备" min-width="100px">
              <template slot-scope="{row}">
                {{ row.devmodel && `【${row.devmodel.code}】${row.devmodel.name}`}}
                {{ row.devmodel && `【${row.devmodel.code}】${row.devmodel.name}` }}
              </template>
            </el-table-column>
            <!-- <el-table-column prop="proUserids" label="生产人员" show-overflow-tooltip min-width="100px"></el-table-column> -->
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="生产投料" name="third">
          <el-table
            v-loading="isSearch"
            :data="feeds"
            stripe
            border
            show-summary
            :summary-method="getPutSummaries"
          >
          <el-table v-loading="isSearch" :data="feeds" stripe border show-summary :summary-method="getPutSummaries">
            <el-table-column prop="createTime" label="投料时间" min-width="140px"></el-table-column>
            <!-- <el-table-column prop="amodel.code" label="工装容器编号" min-width="100px"></el-table-column> -->
            <el-table-column prop="mmodel.name" label="物料名称" min-width="100px"></el-table-column>
            <el-table-column prop="promodel.name" label="工序名称" min-width="100px"></el-table-column>
            <el-table-column label="质量属性" min-width="100px">
              <template slot-scope="{row}">
                <span v-if="row.materialDonetype==0" class="valid-style">合格</span>
                <span v-else-if="row.materialDonetype==1" class="unvalid-style">不良</span>
                <span v-else-if="row.materialDonetype==2" class="scrap-style">报废</span>
                <span v-if="row.materialDonetype == 0" class="valid-style">合格</span>
                <span v-else-if="row.materialDonetype == 1" class="unvalid-style">不良</span>
                <span v-else-if="row.materialDonetype == 2" class="scrap-style">报废</span>
                <span v-else>-</span>
              </template>
            </el-table-column>
@@ -178,12 +172,7 @@
          </el-table>
        </el-tab-pane>
        <el-tab-pane label="生产点检" name="fourth">
          <el-table
            v-loading="isSearch"
            :data="check"
            stripe
            border
          >
          <el-table v-loading="isSearch" :data="check" stripe border>
            <el-table-column prop="createTime" label="记录时间" min-width="140px"></el-table-column>
            <el-table-column prop="userName" label="操作人员" min-width="100px"></el-table-column>
            <el-table-column prop="attrName" label="检点属性" min-width="100px"></el-table-column>
@@ -203,12 +192,8 @@
            <el-table-column prop="value" align="left"></el-table-column>
          </el-table> -->
        </el-tab-pane>
        <Pagination
          style="margin-top:10px"
          @size-change="handleSizeChange"
          @current-change="handlePageChange"
          :pagination="pagination"
        ></Pagination>
        <Pagination style="margin-top:10px" @size-change="handleSizeChange" @current-change="handlePageChange"
          :pagination="pagination"></Pagination>
      </el-tabs>
    </div>
    <div slot="footer" class="window__header">
@@ -229,7 +214,7 @@
  name: 'OperaWorkorderDetailWindow',
  extends: BaseOpera,
  components: { GlobalWindow, Pagination },
  data () {
  data() {
    return {
      // è¡¨å•数据
      form: {
@@ -287,7 +272,7 @@
    }
  },
  inject: ['origins'],
  created () {
  created() {
    this.config({
      api: '/ext/materialExt',
      'field.id': 'id'
@@ -302,39 +287,39 @@
    //   })
  },
  methods: {
    open (title, target) {
    open(title, target) {
      this.title = title
      this.visible = true
      this.activeName = 'first',
      // ç¼–辑
      this.$nextTick(() => {
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        // console.log('this.form', this.form)
        workorderRecordExtPage(
          {
            capacity: this.pagination.pageSize,
            model: {
              type: 1,
              workorderId: this.form.id
            },
            page: this.pagination.pageIndex,
            sorts: null
          })
          .then(res => {
            // console.log(res)
            this.report = res.records
            this.pagination.pageIndex = res.page
            this.pagination.total = res.total
            this.pagination.pageSize = res.capacity
          })
          .catch(err => {
            console.log(err)
          })
      })
        // ç¼–辑
        this.$nextTick(() => {
          for (const key in this.form) {
            this.form[key] = target[key]
          }
          // console.log('this.form', this.form)
          workorderRecordExtPage(
            {
              capacity: this.pagination.pageSize,
              model: {
                type: 1,
                workorderId: this.form.id
              },
              page: this.pagination.pageIndex,
              sorts: null
            })
            .then(res => {
              // console.log(res)
              this.report = res.records
              this.pagination.pageIndex = res.page
              this.pagination.total = res.total
              this.pagination.pageSize = res.capacity
            })
            .catch(err => {
              console.log(err)
            })
        })
    },
    cancel () {
    cancel() {
      this.$refs.form.resetFields()
      this.activeName = 'first'
      this.pagination.pageIndex = 1
@@ -342,21 +327,21 @@
      this.pagination.total = 0
      this.visible = false
    },
    statusToStr (status) {
    statusToStr(status) {
      for (const item of this.status) {
        if (item.id === status) {
          return item.name
        }
      }
    },
    originToStr (id) {
    originToStr(id) {
      for (const item of this.origins()) {
        if (item.id === id) {
          return item.code
        }
      }
    },
    columnStyle ({ row, column, rowIndex, columnIndex }) {
    columnStyle({ row, column, rowIndex, columnIndex }) {
      if (rowIndex % 2 === 0) {
        // ä¿®æ”¹æ¯è¡Œç¬¬ä¸€ä¸ªå•元格的背景色
        return 'background:#f3f6fc;'
@@ -364,22 +349,22 @@
        return 'background:#ffffff;'
      }
    },
    handleClick (tab, event) {
    handleClick(tab, event) {
      this.pagination.pageIndex = 1
      this.pagination.pageSize = 10
      this.pagination.total = 0
      this.search()
    },
    handleSizeChange (pageSize) {
    handleSizeChange(pageSize) {
      this.pagination.pageSize = pageSize
      this.search()
    },
    handlePageChange (pageIndex) {
    handlePageChange(pageIndex) {
      this.pagination.pageIndex = pageIndex
      // console.log('获取数据')
      this.search()
    },
    search () {
    search() {
      if (this.activeName === 'first') {
        workorderRecordExtPage(
          {
@@ -389,7 +374,7 @@
              workorderId: this.form.id
            },
            page: this.pagination.pageIndex,
            sorts: [{direction: "DESC", property: "CREATE_TIME"}]
            sorts: [{ direction: "DESC", property: "CREATE_TIME" }]
          })
          .then(res => {
            // console.log(res)
@@ -408,7 +393,7 @@
            workorderId: this.form.id
          },
          page: this.pagination.pageIndex,
          sorts: [{direction: "DESC", property: "CREATE_TIME"}]
          sorts: [{ direction: "DESC", property: "CREATE_TIME" }]
        })
          .then(res => {
            // console.log(res.records)
@@ -429,7 +414,7 @@
              workorderId: this.form.id
            },
            page: this.pagination.pageIndex,
            sorts: [{direction: "DESC", property: "CREATE_TIME"}]
            sorts: [{ direction: "DESC", property: "CREATE_TIME" }]
          })
          .then(res => {
            // console.log(res)
@@ -449,7 +434,7 @@
              workorderId: this.form.id
            },
            page: this.pagination.pageIndex,
            sorts: [{direction: "DESC", property: "CREATE_TIME"}]
            sorts: [{ direction: "DESC", property: "CREATE_TIME" }]
          })
          .then(res => {
            // console.log(res)
@@ -463,7 +448,7 @@
          })
      }
    },
    getPutSummaries (param) {
    getPutSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
@@ -476,7 +461,7 @@
        } else if (index === 5) {
          sums[index] = '-';
          return;
        }
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          sums[index] = 0
@@ -489,15 +474,12 @@
      });
      return sums
    },
    getReportSummaries (param) {
    getReportSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        } else if (index === 4) {
          sums[index] = '-';
          return;
        }
        const values = data.map(item => Number(item[column.property]));
@@ -522,21 +504,24 @@
  width: 23%;
  // height: 32px;
}
::v-deep .el-form-item {
  margin-bottom: 8px !important;
}
.text-code {
  color: #333;
  font-weight: 500;
  padding-right: 15px;
  font-size: 15px;
  vertical-align:middle;
  vertical-align: middle;
}
.status-log {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color:#fff;
  vertical-align:middle;
  color: #fff;
  vertical-align: middle;
}
</style>
web_standard/src/components/ext/OrderDistrubution.vue
@@ -109,9 +109,12 @@
        this.form.planDate = new Date()
        this.form.planId = target.id
        this.form.planNum = target.num - target.distributNum
        getDeviceByCondition({})
        getDeviceByCondition({procedureId: target.procedureId})
          .then(res => {
            this.device = res
            this.form.proGroupId = res[0] ? res[0].id : ''
            this.getUser(this.form.proGroupId)
          })
          .catch(err => {
            console.log(err)
web_standard/src/components/ext/OrderQrCodeLabel.vue
@@ -93,7 +93,7 @@
                <tr>
                  <td>打印信息</td>
                  <td style="text-align:left; line-height:16px;" colspan="2">
                    <div>{{ userInfo.realname + ', ' + current}}</div>
                    <div>{{ userInfo.companyUser.name + ', ' + current}}</div>
                  </td>
                </tr>
              </tbody>
web_standard/src/components/ext/addProcesRoute.vue
ÎļþÒÑɾ³ý
web_standard/src/utils/form.js
@@ -35,3 +35,12 @@
  }
  callback()
}
export function numRule(rule, value, callback) {
  // debugger
  if (value == null || value < 0 || !value) {
    callback(new Error())
  } else {
    callback()
  }
}
web_standard/src/views/.DS_Store
Binary files differ
web_standard/src/views/business/salaryParam.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,159 @@
<template>
  <TableLayout :permissions="['business:salaryparam:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="物料信息" prop="keyWord">
        <el-input v-model="searchForm.keyWord" placeholder="请输入物料名称/编码" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="工序" prop="procedureName">
        <el-input v-model="searchForm.procedureName" placeholder="请输入工序" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="计价方式" prop="type">
        <el-select v-model="searchForm.type" placeholder="请选择计价方式" clearable>
          <el-option
            v-for="item in type"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar" v-permissions="['business:salaryparam:create', 'business:salaryparam:delete', 'business:salaryparam:exportExcel', 'business:salaryparam:importExcel']">
        <li><el-button type="primary" @click="$refs.operaSalaryParamWindow.open('新建绩效工资配置')" v-permissions="['business:salaryparam:create']">新建</el-button></li>
        <li><el-button type="primary" @click="deleteByIdInBatch" v-permissions="['business:salaryparam:delete']">批量删除</el-button></li>
        <li>
          <el-button type="primary" :loading="isWorking.export" v-permissions="['business:salaryparam:exportExcel']" @click="exportExcel">导出</el-button>
        </li>
        <li v-permissions="['business:salaryparam:importExcel']">
          <ImportButton
            text="导入"
            template-name="salary_import_template.xlsx"
            template-path="/template/salary_import_template.xlsx"
            action="/business/salaryParam/importBatch"
            @success="search"
          />
        </li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="id" label="序号"  min-width="100px"></el-table-column>
        <el-table-column prop="type" label="计价方式" min-width="100px">
          <template slot-scope="{row}">
            {{ row.type == 0 ? '计件' : '计时' }}
          </template>
        </el-table-column>
        <el-table-column prop="materialName" label="物料名称" min-width="140px"></el-table-column>
        <el-table-column prop="materialCode" label="物料编码" min-width="100px"></el-table-column>
        <el-table-column prop="procedureName" label="工序名称" min-width="100px"></el-table-column>
        <el-table-column prop="salary" label="工资单价(元)" min-width="100px"></el-table-column>
        <el-table-column prop="num" label="标准产出" min-width="100px">
          <template slot-scope="{row}">
            {{ row.num == 0 ? '-' : row.num }}
          </template>
        </el-table-column>
        <el-table-column prop="times" label="标准工时" min-width="100px">
          <template slot-scope="{row}">
            {{ timesToStr(row.times) }}
          </template>
        </el-table-column>
        <el-table-column prop="unqualified" label="不良品是否计入" min-width="110px">
          <template slot-scope="{row}">
            {{ row.unqualified == 0 ? '否' : '是' }}
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" min-width="150px"></el-table-column>
        <el-table-column prop="createUserName" label="创建人" min-width="100px"></el-table-column>
        <!-- <el-table-column prop="updateTime" label="更新时间" min-width="100px"></el-table-column>
        <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column>
        <el-table-column prop="rootDepartId" label="主组织编码(关联department表根组织)" min-width="100px"></el-table-column>
        <el-table-column prop="departId" label="工厂编码(关联department表)" min-width="100px"></el-table-column>
        <el-table-column prop="bomId" label="bom编码(关联bom表)" min-width="100px"></el-table-column> -->
        <el-table-column
          v-if="containPermissions(['business:salaryparam:update', 'business:salaryparam:delete'])"
          label="操作"
          min-width="120"
          fixed="right"
        >
          <template slot-scope="{row}">
            <el-button type="text" @click="$refs.operaSalaryParamWindow.open('编辑绩效工资配', row)" v-permissions="['business:salaryparam:update']">编辑</el-button>
            <el-button type="text" @click="deleteById(row)" v-permissions="['business:salaryparam:delete']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaSalaryParamWindow ref="operaSalaryParamWindow" @success="handlePageChange"/>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import ImportButton from '@/components/common/ImportButton'
import OperaSalaryParamWindow from '@/components/business/OperaSalaryParamWindow'
export default {
  name: 'SalaryParam',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaSalaryParamWindow, ImportButton },
  data () {
    return {
      // æœç´¢
      searchForm: {
        keyWord: '',
        procedureName: '',
        type: ''
      },
      type: [
        { label: '计件', value: '0' },
        { label: '计时', value: '1' },
      ]
    }
  },
  created () {
    this.config({
      module: '设置类-绩效工资配置表',
      api: '/business/salaryParam',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    timesToStr(times) {
      if (times==0||!times) {
        return '-'
      }
      let sec = times%60
      let lesMin = Math.floor(times/60)
      let min = lesMin%60
      let hours =  Math.floor(lesMin/60)
      return `${hours}时${min}分${sec}秒`
    }
  },
}
</script>
web_standard/src/views/business/workPlans.vue
@@ -26,6 +26,9 @@
      <el-form-item label="批次号" prop="batch">
        <el-input v-model="searchForm.batch" placeholder="请输入" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="销售单号" prop="salesorder">
        <el-input v-model="searchForm.salesorder" placeholder="请输入" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="计划日期" prop="planDate">
        <el-date-picker style="width: 300px;" @change="changeDate" v-model="searchForm.planDate" type="datetimerange"
          value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
@@ -45,7 +48,7 @@
          <ImportButton
            text="导入"
            template-name="workplans_import_template.xlsx"
            template-path="template/workplans_import_template.xlsx"
            template-path="/template/workplans_import_template.xlsx"
            action="/business/workPlans/importBatch"
            @success="search"
          />
@@ -57,11 +60,12 @@
      </ul>
      <el-table v-loading="isWorking.search" :data="tableData.list" border stripe @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="planCode" label="成品计划编码" min-width="150px">
        <el-table-column prop="planCode" label="成品计划编码" min-width="190px">
          <template slot-scope="{row}">
            <el-button type="text" @click="$refs.plannedProgress.open('计划执行进度', row)">
              <span class="long-title-style">{{ row.planCode }}</span>
            </el-button>
            <el-tag type="danger" size="mini" v-if="row.hasExpire">延期</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="materialName" label="物料名称" min-width="100px"></el-table-column>
@@ -109,16 +113,15 @@
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="优先级" min-width="80px">
          <template slot-scope="{row}">
        <el-table-column prop="urgent" label="优先级" min-width="80px">
          <!-- <template slot-scope="{row}">
            <span v-if="row.urgent">{{ row.urgent }}</span>
            <span v-else>-</span>
          </template>
          </template> -->
        </el-table-column>
        <el-table-column label="暂停" min-width="80px">
          <template slot-scope="{row}">
            {{ row.paused==0?'否':'是' }}
          </template>
        </el-table-column>
@@ -185,6 +188,7 @@
        factoryId: '',
        materialId: '',
        batch: '',
        salesorder: '',
        planStatus: '',
        planCode: ''
      },
web_standard/src/views/ext/plansExt.vue
@@ -100,7 +100,11 @@
        @row-style="rowStyle"
      >
        <el-table-column type="selection" fixed="left" width="55"></el-table-column>
        <el-table-column prop="id" label="计划序号" fixed="left" min-width="80px"></el-table-column>
        <el-table-column prop="id" label="计划序号" fixed="left" min-width="80px">
          <template slot-scope="{row}">
            <span>{{ row.id }}</span><el-tag type="danger" size="mini" v-if="row.hasExpire">延期</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="mmodel.name" fixed="left" label="物料名称" show-overflow-tooltip min-width="140px">
          <template slot-scope="{row}">
            <el-button type="text" class="materail" @click="showPlan(row.id)">
@@ -110,36 +114,35 @@
        </el-table-column>
        <el-table-column prop="mmodel.code" label="物料编码" min-width="160px">
        </el-table-column>
        <el-table-column prop="planDate" label="计划日期" min-width="100px"></el-table-column>
        <el-table-column prop="fmodel.name" label="工厂" min-width="100px"></el-table-column>
        <el-table-column prop="pmodel.name" label="工序" show-overflow-tooltip min-width="100px">
          <template slot-scope="{row}">
            <span class="long-title-style">{{ row.pmodel ? row.pmodel.name : '-' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="batch" label="生产批次号" show-overflow-tooltip min-width="140px"></el-table-column>
        <el-table-column prop="num" label="计划数量" min-width="100px">
          <template slot-scope="{row}">
            <span>{{ row.num + (row.umodel ? row.umodel.name : '') }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="batch" label="生产批次号" show-overflow-tooltip min-width="140px"></el-table-column>
        <el-table-column prop="urgent" label="优先级" min-width="60px"></el-table-column>
        <el-table-column prop="workPlanStartDate" label="计划开始日期" min-width="100px">
          <!-- <template slot-scope="{row}">
            {{ row.workPlanStartDate ? row.workPlanStartDate.substring(0, row.workPlanStartDate.length-9) : '-' }}
          </template> -->
        </el-table-column>
        <el-table-column prop="workPlanEndDate" label="计划结束日期" min-width="100px">
          <template slot-scope="{row}">
            {{ row.workPlanStartDate ? row.workPlanStartDate.substring(0, row.workPlanStartDate.length-9) : '-' }}
          </template>
        </el-table-column>
        <el-table-column label="计划状态" min-width="80px">
          <template slot-scope="{row}">
            {{ statusToStr(row.status) }}
          </template>
        </el-table-column>
        <el-table-column label="计划类型" min-width="80px">
          <template slot-scope="{row}">
            <span :style="typeColor(row.type)">{{ typeToStr(row.type) }}</span>
          </template>
        </el-table-column>
        <el-table-column label="暂停" min-width="60px">
          <template slot-scope="{row}">
            {{ row.paused == 0 ? '否' : '是' }}
          </template>
        </el-table-column>
        <el-table-column prop="workPlanCode" label="成品计划编码" min-width="140px"></el-table-column>
        <el-table-column prop="distributNoDoneNum" label="已分配未报工数量" min-width="140px">
          <template slot-scope="{row}">
            <span>{{row.distributNoDoneNum ? (row.distributNoDoneNum + (row.umodel ? row.umodel.name : '')) : '-' }}</span>
@@ -153,6 +156,18 @@
        <el-table-column prop="unqulifiedNum" label="不良数量" min-width="100px">
          <template slot-scope="{row}">
            <span>{{row.unqulifiedNum ? (row.unqulifiedNum + (row.umodel ? row.umodel.name : '')) : '-' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="urgent" label="优先级" min-width="60px"></el-table-column>
        <el-table-column label="暂停" min-width="60px">
          <template slot-scope="{row}">
            {{ row.paused == 0 ? '否' : '是' }}
          </template>
        </el-table-column>
        <el-table-column prop="workPlanCode" label="主计划编码" min-width="140px"></el-table-column>
        <el-table-column label="类型" min-width="80px">
          <template slot-scope="{row}">
            <span :style="typeColor(row.type)">{{ typeToStr(row.type) }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="publishDate" label="发布日期" min-width="100px">
@@ -559,7 +574,7 @@
        if (index === 0) {
          sums[index] = '合计';
          return;
        } else if (index === 1 || index === 8 || index === 9 || index === 16 || index === 17) {
        } else if (index === 1 || index === 6 || index === 8 || index === 9 || index === 14 || index === 16 || index === 17) {
          sums[index] = '-';
          return;
        } else if (index === 8 ) {
web_standard/src/views/ext/salaryStatistic.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,182 @@
<template>
  <TableLayout v-permissions="['ext:workorderrecordext:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" label-suffix=":" inline>
      <el-form-item label="生产人员" prop="userId">
        <el-select v-model="searchForm.userId" clearable filterable placeholder="请选择">
          <el-option
            v-for="item in proUsers"
            :key="item.id"
            :label="item.name"
            :value="item.userId">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="物料编码" prop="mmodelCode">
        <el-input v-model="searchForm.mmodelCode" placeholder="请输入物料编码" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="工序" prop="procedureId">
        <el-select v-model="searchForm.procedureId" filterable clearable placeholder="请选择">
          <el-option
            v-for="(item, index) in procedures"
            :key="index"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="报工时间">
        <el-date-picker
          v-model="planDate"
          type="daterange"
          value-format="yyyy-MM-dd"
          range-separator="~"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="dateChange"
        ></el-date-picker>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar">
        <!-- v-permissions="['ext:workorderrecordext:exportExcel']" -->
        <li ><el-button type="primary" :loading="isWorking.export" @click="exportExcel">导出</el-button></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
      >
        <el-table-column type="index" :index="customIndex" label="序号" fixed="left" min-width="80px">
        </el-table-column>
        <el-table-column prop="userInfo.userName" label="生产人员" min-width="100px"></el-table-column>
        <el-table-column prop="userInfo.departName" label="部门" min-width="100px"> </el-table-column>
        <el-table-column prop="jijianSalary" label="计件工资" min-width="100px">
          <template slot-scope="{row}">
            {{ row.jijianSalary / 100 }}
          </template>
        </el-table-column>
        <el-table-column prop="jishiSalary" label="计时工资" min-width="100px">
          <template slot-scope="{row}">
            {{ row.jishiSalary / 100 }}
          </template>
        </el-table-column>
        <el-table-column prop="num" label="报工单总数" min-width="100px"></el-table-column>
        <el-table-column prop="totalSalary" label="小计工资(元)" min-width="100px">
          <template slot-scope="{row}">
            {{ row.totalSalary / 100 }}
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      ></pagination>
    </template>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { productesGroup } from '@/api/ext/proceduresExt'
import { companyUserExtAllUser } from '@/api/ext/companyUserExt'
export default {
  name: 'WorkorderRecordExt',
  extends: BaseTable,
  components: { TableLayout, Pagination },
  data () {
    return {
      // æœç´¢
      searchForm: {
        procedureId: '',
        userId: '',
        startDate: '',
        endDate: '',
        materialId: '',
      },
      procedures: [
      ],
      proUsers: [
      ],
      orderStatus:[
        // 0已创建、1已领料、2已完工检、3已检验、4已返工、5已入库、6已暂停、7已取消、8已关闭
        //  0已创建、1已备料、2已完工检、3已检验、4已报工、5已入库、6已取消
        { name: '已创建', id: 0 },
        { name: '已备料', id: 1 },
        { name: '已完工检', id: 2 },
        { name: '已检验', id: 3 },
        { name: '已报工', id: 4 },
        { name: '已取消', id: 6 }
      ],
      planDate: []
    }
  },
  created () {
    this.config({
      module: '报工记录',
      api: '/ext/salaryStatistic',
      'field.id': 'id',
      'field.main': 'name',
      sorts: [{ direction: 'DESC', property: 'CREATE_TIME' }]
    })
    this.search()
  },
  activated() {
    productesGroup({})
      .then(res => {
        this.procedures = res
      })
      .catch(err => {
        console.log(err)
      })
    companyUserExtAllUser({ departmentId: this.$store.state.userInfo.curComDepartment.id })
      .then(res => {
        this.proUsers = res
      })
      .catch(err => {
        console.log(err)
      })
  },
  methods: {
    dateChange (v) {
      // console.log('日期选择了')
      this.searchForm.startDate = v[0]
      this.searchForm.endDate = v[1]
    },
    reset () {
      // console.log('rest', this.searchDate)
      this.planDate = []
      this.searchForm.startDate = ''
      this.searchForm.endDate = ''
      this.$refs.searchForm.resetFields()
      this.search()
    },
    statusToStr (row) {
      for (const item of this.orderStatus) {
        if (item.id === row.omodel.status) {
          return item.name
        }
      }
      return '-'
    },
    customIndex(index) {
      console.log();
      return (this.tableData.pagination.pageIndex-1) * this.tableData.pagination.pageSize + index + 1
    }
  }
}
</script>
web_standard/src/views/ext/userSalary.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,219 @@
<template>
  <TableLayout v-permissions="['ext:workorderrecordext:query']">
    <!-- æœç´¢è¡¨å• -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" label-suffix=":" inline>
      <el-form-item label="生产人员" prop="userId">
        <el-select v-model="searchForm.userId" clearable filterable placeholder="请选择">
          <el-option
            v-for="item in proUsers"
            :key="item.id"
            :label="item.name"
            :value="item.userId">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="物料信息" prop="materialName">
        <el-input v-model="searchForm.materialName" placeholder="请输入物料名称/编码" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item label="工序" prop="procedureId">
        <el-select v-model="searchForm.procedureId" filterable clearable placeholder="请选择">
          <el-option
            v-for="(item, index) in procedures"
            :key="index"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="报工时间">
        <el-date-picker
          v-model="planDate"
          type="daterange"
          value-format="yyyy-MM-dd"
          range-separator="~"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          @change="dateChange"
        ></el-date-picker>
      </el-form-item>
      <section>
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </section>
    </el-form>
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <ul class="toolbar">
        <!-- v-permissions="['ext:workorderrecordext:exportExcel']" -->
        <li ><el-button type="primary" :loading="isWorking.export" @click="exportExcel">导出</el-button></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
      >
        <el-table-column type="index" :index="customIndex" label="序号" fixed="left" min-width="80px"></el-table-column>
        <el-table-column prop="userInfo.userName" label="生产人员" min-width="100px"></el-table-column>
        <el-table-column prop="userInfo.departName" label="部门" min-width="100px"> </el-table-column>
        <el-table-column prop="materialName" label="物料名称" min-width="100px"></el-table-column>
        <el-table-column prop="materialCode" label="物料编码" min-width="140px"></el-table-column>
        <el-table-column prop="procedureName" label="工序名称" min-width="100px"></el-table-column>
        <el-table-column prop="workorderCode" label="工单编码" min-width="150px"></el-table-column>
        <el-table-column prop="unitName" label="单位" min-width="100px"></el-table-column>
        <el-table-column prop="num" label="报工数" min-width="100px"></el-table-column>
        <el-table-column prop="qualifiedNum" label="良品数" min-width="100px">
          <template slot-scope="{row}">
            {{ row.qualifiedNum || 0 }}
          </template>
        </el-table-column>
        <el-table-column prop="unQualifiedNum" label="不良品数" min-width="100px">
          <template slot-scope="{row}">
            {{ row.unQualifiedNum || 0 }}
          </template>
        </el-table-column>
        <el-table-column prop="rate" label="合格率(%)" min-width="100px"></el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      ></pagination>
    </template>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import { getDeviceByCondition } from '@/api/ext/deviceExt'
import { productesGroup } from '@/api/ext/proceduresExt'
import { companyUserExtAllUser } from '@/api/ext/companyUserExt'
import { addPrecision } from '@/utils/util'
export default {
  name: 'WorkorderRecordExt',
  extends: BaseTable,
  components: { TableLayout, Pagination },
  data () {
    return {
      // æœç´¢
      searchForm: {
        procedureId: '',
        userId: '',
        startDate: '',
        endDate: '',
        materialName: '',
      },
      procedures: [
      ],
      proUsers: [
      ],
      orderStatus:[
        // 0已创建、1已领料、2已完工检、3已检验、4已返工、5已入库、6已暂停、7已取消、8已关闭
        //  0已创建、1已备料、2已完工检、3已检验、4已报工、5已入库、6已取消
        { name: '已创建', id: 0 },
        { name: '已备料', id: 1 },
        { name: '已完工检', id: 2 },
        { name: '已检验', id: 3 },
        { name: '已报工', id: 4 },
        { name: '已取消', id: 6 }
      ],
      planDate: []
    }
  },
  created () {
    this.config({
      module: '报工记录',
      api: '/ext/userSalary',
      'field.id': 'id',
      'field.main': 'name',
      sorts: [{ direction: 'DESC', property: 'CREATE_TIME' }]
    })
    let tempDate = new Date()
    let year = tempDate.getFullYear()
    let month = tempDate.getMonth() + 1
    let day = tempDate.getDate()
    this.searchForm.startDate = `${year}-${month}-01`
    this.searchForm.endDate = `${year}-${month}-${day}`
    this.planDate = [this.searchForm.startDate, this.searchForm.endDate]
    this.search()
  },
  activated() {
    productesGroup({})
      .then(res => {
        this.procedures = res
      })
      .catch(err => {
        console.log(err)
      })
    companyUserExtAllUser({ departmentId: this.$store.state.userInfo.curComDepartment.id })
      .then(res => {
        this.proUsers = res
      })
      .catch(err => {
        console.log(err)
      })
  },
  methods: {
    dateChange (v) {
      // console.log('日期选择了')
      this.searchForm.startDate = v[0]
      this.searchForm.endDate = v[1]
    },
    reset () {
      // console.log('rest', this.searchDate)
      this.planDate = []
      this.searchForm.startDate = ''
      this.searchForm.endDate = ''
      this.$refs.searchForm.resetFields()
      this.search()
    },
    statusToStr (row) {
      for (const item of this.orderStatus) {
        if (item.id === row.omodel.status) {
          return item.name
        }
      }
      return '-'
    },
    getSummaries (param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        } else if (index === 4 || index === 8 || index === 6 || index === 10) {
          // || index === 8 || index === 9 || index === 16 || index === 17
          sums[index] = '-';
          return;
        }
        const values = data.map(item => {
          if (index === 6) {
            return Number(item.omodel.planNum)
          } else {
            return Number(item[column.property])
          }
        });
        if (!values.every(value => isNaN(value))) {
          sums[index] = 0
          values.forEach(item => {
            sums[index] = addPrecision(item, sums[index])
          })
        } else {
          sums[index] = '-';
        }
      });
      return sums
    },
    customIndex(index) {
      console.log();
      return (this.tableData.pagination.pageIndex-1) * this.tableData.pagination.pageSize + index + 1
    }
  }
}
</script>
web_standard/src/views/ext/workingorderExt.vue
@@ -282,7 +282,7 @@
        status: '',
        mixParam: '',
        pgmodelId: '',
        statusList: [0,1,2,3]
        statusList: [0,1,2,3,7]
      },
      origins: [],
      types: [
@@ -307,7 +307,7 @@
        { name: '已检验', id: 3 },
        // { name: '已报工', id: 4 },
        // { name: '已入库', id: 5 },
        // { name: '已取消', id: 6 }
        { name: '生产中', id: 7 }
      ],
      productes: [
      ],
web_standard/src/views/ext/workorderPutRecordExt.vue
@@ -120,19 +120,18 @@
            <span class="long-title-style">{{ row.procedureName }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="doneType" label="质量属性" min-width="100px">
        <el-table-column prop="qualifiedNum" label="合格数量" min-width="100px">
          <template slot-scope="{row}">
            <span v-if="row.materialDonetype==0" class="valid-style">合格</span>
            <span v-else-if="row.materialDonetype==1" class="unvalid-style">不良</span>
            <!-- <span v-else-if="row.doneType==2" class="scrap-style">报废</span> -->
            <span v-else>-</span>
            <span class="valid-style">{{ row.qualifiedNum + row.umodel.name }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="num" label="数量" min-width="100px">
        <el-table-column prop="unqualifiedNum" label="不良数量" min-width="100px">
          <template slot-scope="{row}">
            <span :class="row.materialDonetype==0 ? 'valid-style' : 'unvalid-style'">{{ row.num + row.umodel.name }}</span>
            <span class="unvalid-style">{{ row.num + row.umodel.name}}</span>
            <!-- <span :class="row.materialDonetype==0 ? 'valid-style' : ''">{{ row.num + row.umodel.name }}</span> -->
          </template>
        </el-table-column>
        <el-table-column prop="num" label="报工数量" min-width="100px"></el-table-column>
        <!-- <el-table-column prop="amodel.code" label="工装器具" min-width="100px"></el-table-column> -->
        <el-table-column prop="deviceCode" label="设备" show-overflow-tooltip min-width="100px">
          <template slot-scope="{row}">
web_standard/src/views/ext/workorderRecordExt.vue
@@ -112,7 +112,7 @@
          </template>
        </el-table-column>
        <el-table-column prop="procedureName" label="生产员工" min-width="100px"></el-table-column>
        <el-table-column prop="doneType" label="报工类型" min-width="100px">
        <!-- <el-table-column prop="doneType" label="报工类型" min-width="100px">
          <template slot-scope="{row}">
            <span v-if="row.doneType==0" class="valid-style">合格</span>
            <span v-else-if="row.doneType==1" class="unvalid-style">不良</span>
@@ -124,6 +124,22 @@
          <template slot-scope="{row}">
            <span :class="row.doneType==0 ? 'valid-style' : (row.doneType==1 ? 'unvalid-style' : (row.doneType==2 ? 'scrap-style' : ''))">{{ row.num + row.umodel.name }}</span>
          </template>
        </el-table-column> -->
        <el-table-column prop="qualifiedNum" label="合格数量" min-width="100px">
          <template slot-scope="{row}">
            <span class="valid-style">{{ row.qualifiedNum + row.umodel.name }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="unqualifiedNum" label="不良数量" min-width="100px">
          <template slot-scope="{row}">
            <span class="unvalid-style">{{ row.unqualifiedNum + row.umodel.name}}</span>
            <!-- <span :class="row.materialDonetype==0 ? 'valid-style' : ''">{{ row.num + row.umodel.name }}</span> -->
          </template>
        </el-table-column>
        <el-table-column prop="num" label="报工数量" min-width="100px">
          <template slot-scope="{row}">
            <span>{{ row.num + row.umodel.name}}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="amodel.code" label="工装器具" min-width="100px"></el-table-column> -->
        <el-table-column prop="deviceCode" label="设备" show-overflow-tooltip min-width="100px">