weicd
2023-02-13 8732d6ae765ca502171f57047edb1bc913b6002a
修改 和公司相关的存id
14 files modified
82 ■■■■■ changed files
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/domain/AssetManagement.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/dto/AssetManagementDto.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/dto/AssetManagementQueryCriteria.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/impl/AssetManagementServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysUserCompany.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserCompanyRepository.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysUserCompanyDto.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysUserCompanyServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java 4 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/assetManagement/list/index.vue 18 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/user/index.vue 12 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/userCompany/index.vue 13 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/domain/AssetManagement.java
@@ -71,10 +71,10 @@
    @ApiModelProperty(value = "购买金额")
    private BigDecimal buyMoney;
    @Column(name = "`affiliated_company`",nullable = false)
    @Column(name = "`affiliated_company_id`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "所属公司")
    private String affiliatedCompany;
    @ApiModelProperty(value = "所属公司id")
    private Long affiliatedCompanyId;
    @Column(name = "`state`")
    @ApiModelProperty(value = "使用状态")
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/dto/AssetManagementDto.java
@@ -52,7 +52,7 @@
    private BigDecimal buyMoney;
    /** 所属公司 */
    private String affiliatedCompany;
    private Long affiliatedCompanyId;
    /** 使用状态 */
    private String state;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/dto/AssetManagementQueryCriteria.java
@@ -34,7 +34,7 @@
    private String name;
    @Query
    private String affiliatedCompany;
    private Long affiliatedCompanyId;
    @Query
    private String state;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/assetManagement/service/impl/AssetManagementServiceImpl.java
@@ -19,6 +19,7 @@
import me.zhengjie.modules.assetManagement.domain.AssetUseManagement;
import me.zhengjie.modules.assetManagement.repository.AssetUseManagementRepository;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.system.domain.SysUserCompany;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.SysUserCompanyRepository;
import me.zhengjie.utils.ValidationUtil;
@@ -117,7 +118,7 @@
            map.put("资产类型", assetManagement.getAssetsType());
            map.put("购买日期", assetManagement.getBuyDate());
            map.put("购买金额", assetManagement.getBuyMoney());
            map.put("所属公司", sysUserCompanyRepository.findByValue(assetManagement.getAffiliatedCompany()).getLabel());
            map.put("所属公司", sysUserCompanyRepository.findById(assetManagement.getAffiliatedCompanyId()).orElseGet(SysUserCompany::new).getLabel());
            map.put("使用状态", results);
            map.put("备注", assetManagement.getRemarks());
            map.put("创建者", assetManagement.getCreateBy());
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysUserCompany.java
@@ -49,10 +49,6 @@
    @ApiModelProperty(value = "标签")
    private String label;
    @Column(name = "`value`")
    @ApiModelProperty(value = "值")
    private String value;
    public void copy(SysUserCompany source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
@@ -78,9 +78,9 @@
    private Timestamp birthday;
    // 魏传栋 - 始
    @Column(name = "company")
    @ApiModelProperty(value = "所属公司")
    private String company;
    @Column(name = "company_id")
    @ApiModelProperty(value = "所属公司Id")
    private Long companyId;
    // 魏传栋 - 终
    @Email
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserCompanyRepository.java
@@ -31,6 +31,6 @@
     * 根据value查询公司(导出用)
     * @return
     */
    @Query
    SysUserCompany findByValue(String value);
//    @Query
//    SysUserCompany findByValue(String value);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysUserCompanyDto.java
@@ -37,9 +37,6 @@
    /** 标签 */
    private String label;
    /** 值 */
    private String value;
    /** 用户id */
    private Long userId;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
@@ -79,6 +79,6 @@
    private Date pwdResetTime;
    // 魏传栋 - 始
    private String company;
    private Long companyId;
    // 魏传栋 - 终
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysUserCompanyServiceImpl.java
@@ -100,7 +100,6 @@
        for (SysUserCompanyDto systemSetting : all) {
            Map<String,Object> map = new LinkedHashMap<>();
            map.put("标签", systemSetting.getLabel());
            map.put("值", systemSetting.getValue());
            map.put("描述", systemSetting.getDescription());
            list.add(map);
        }
@@ -117,7 +116,7 @@
        // 查询用户表
        User user = userRepository.findById(Long.valueOf(resources.getUserId())).orElseGet(User::new);
        // 查询公司表
        SysUserCompany sysUserCompany = sysUserCompanyRepository.findByValue(user.getCompany());
        SysUserCompany sysUserCompany = sysUserCompanyRepository.findById(user.getId()).orElseGet(SysUserCompany::new);
        return sysUserCompany;
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -175,7 +175,7 @@
        user.setJobs(resources.getJobs());
        user.setPhone(resources.getPhone());
        user.setNickName(resources.getNickName());
        user.setCompany(resources.getCompany());
        user.setCompanyId(resources.getCompanyId());
        user.setGender(resources.getGender());
        user.setBirthday(resources.getBirthday());
        user.setAddress(resources.getAddress());
@@ -545,7 +545,7 @@
        for (UserDto userDTO : queryAll) {
            List<String> roles = userDTO.getRoles().stream().map(RoleSmallDto::getName).collect(Collectors.toList());
            String levelName = userDTO.getLevelId() != null ? sysLevelRepository.findById(userDTO.getLevelId()).orElseGet(SysLevel::new).getName() : "";
            SysUserCompany sysUserCompany = sysUserCompanyRepository.findByValue(userDTO.getCompany());
            SysUserCompany sysUserCompany = sysUserCompanyRepository.findById(userDTO.getCompanyId()).orElseGet(SysUserCompany::new);
            Map<String, Object> map = new LinkedHashMap<>();
            map.put("用户名", userDTO.getUsername());
            map.put("角色", roles);
eladmin-web-master/src/views/assetManagement/list/index.vue
@@ -21,12 +21,12 @@
          class="filter-item"
          @keyup.enter.native="crud.toQuery"
        />
        <el-select v-model="query.affiliatedCompany" filterable clearable placeholder="所属公司" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
        <el-select v-model="query.affiliatedCompanyId" filterable clearable placeholder="所属公司" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
          <el-option
            v-for="item in companyList"
            :key="item.id"
            :label="item.label"
            :value="item.value"
            :value="item.id"
          />
        </el-select>
        <el-select v-model="query.state" filterable clearable placeholder="使用状态" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
@@ -103,9 +103,9 @@
          <el-form-item label="购买金额" prop="buyMoney">
            <money-input :key="random" v-model="form.buyMoney" :width="370" />
          </el-form-item>
          <el-form-item label="所属公司" prop="affiliatedCompany">
            <el-select v-model="form.affiliatedCompany" style="width: 370px" clearable>
              <el-option v-for="item in companyList" :key="item.id" :label="item.label" :value="item.value" />
          <el-form-item label="所属公司" prop="affiliatedCompanyId">
            <el-select v-model="form.affiliatedCompanyId" style="width: 370px" clearable>
              <el-option v-for="item in companyList" :key="item.id" :label="item.label" :value="item.id" />
            </el-select>
          </el-form-item>
          <el-form-item label="使用状态" prop="state">
@@ -220,10 +220,10 @@
            {{ crud.toMoney(scope.row.buyMoney) }}
          </template>
        </el-table-column>
        <el-table-column prop="affiliatedCompany" label="所属公司" show-overflow-tooltip>
        <el-table-column prop="affiliatedCompanyId" label="所属公司" show-overflow-tooltip>
          <template slot-scope="scope">
            <template v-for="item in companyList">
              <span v-if="scope.row.affiliatedCompany == item.value" :key="item.id">{{ item.label }}</span>
              <span v-if="scope.row.affiliatedCompanyId == item.id" :key="item.id">{{ item.label }}</span>
            </template>
          </template>
        </el-table-column>
@@ -272,7 +272,7 @@
import constant from '@/utils/constant'
import moneyInput from '../../assembly/moneyInput/index.vue'
const defaultForm = { id: null, number: null, name: null, typeNumber: null, assetsType: null, buyDate: null, buyMoney: null, affiliatedCompany: null, state: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
const defaultForm = { id: null, number: null, name: null, typeNumber: null, assetsType: null, buyDate: null, buyMoney: null, affiliatedCompanyId: null, state: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'AssetManagement',
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
@@ -310,7 +310,7 @@
        assetsType: [
          { required: true, message: '资产类型不能为空', trigger: 'change' }
        ],
        affiliatedCompany: [
        affiliatedCompanyId: [
          { required: true, message: '所属公司不能为空', trigger: 'change' }
        ],
        state: [
eladmin-web-master/src/views/system/user/index.vue
@@ -199,9 +199,9 @@
                >{{ item.label }}</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="公司" prop="company">
              <el-select v-model="form.company" style="width: 437px" clearable>
                <el-option v-for="item in companyList" :key="item.id" :label="item.label" :value="item.value" />
            <el-form-item label="公司" prop="companyId">
              <el-select v-model="form.companyId" style="width: 437px" clearable>
                <el-option v-for="item in companyList" :key="item.id" :label="item.label" :value="item.id" />
              </el-select>
            </el-form-item>
            <el-form-item style="margin-bottom: 0;" label="角色" prop="roles">
@@ -243,10 +243,10 @@
            </template>
          </el-table-column>
          <!-- 魏传栋 - 始 -->
          <el-table-column :show-overflow-tooltip="true" prop="company" label="公司" width="150">
          <el-table-column :show-overflow-tooltip="true" prop="companyId" label="公司" width="150">
            <template slot-scope="scope">
              <template v-for="item in companyList">
                <span v-if="scope.row.company == item.value" :key="item.id">{{ item.label }}</span>
                <span v-if="scope.row.companyId == item.id" :key="item.id">{{ item.label }}</span>
              </template>
            </template>
          </el-table-column>
@@ -376,7 +376,7 @@
          { min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur' }
        ],
        // 魏传栋 - 始
        company: [
        companyId: [
          { required: true, message: '请选择公司', trigger: 'blur' }
        ]
        // 魏传栋 - 终
eladmin-web-master/src/views/system/userCompany/index.vue
@@ -15,9 +15,6 @@
          <el-form-item label="标签" prop="label">
            <el-input v-model="form.label" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="值" prop="value">
            <el-input v-model="form.value" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="描述">
            <el-input v-model="form.description" style="width: 370px;" />
          </el-form-item>
@@ -33,11 +30,6 @@
        <el-table-column prop="label" label="标签">
          <template slot-scope="scope">
            {{ scope.row.label }}
          </template>
        </el-table-column>
        <el-table-column prop="value" label="值">
          <template slot-scope="scope">
            {{ scope.row.value }}
          </template>
        </el-table-column>
        <el-table-column prop="description" label="描述" />
@@ -65,7 +57,7 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = { id: null, name: null, description: null, label: null, value: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
const defaultForm = { id: null, name: null, description: null, label: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
export default {
  name: 'SysUserCompany',
  components: { pagination, crudOperation, rrOperation, udOperation },
@@ -84,9 +76,6 @@
      rules: {
        label: [
          { required: true, message: '标签不能为空', trigger: 'blur' }
        ],
        value: [
          { required: true, message: '值不能为空', trigger: 'blur' }
        ]
      }}
  },