| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import liquibase.pro.packaged.I; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | import org.jeecg.modules.base.service.BaseCommonService; |
| | | import org.jeecg.modules.base.service.IUserFactoryService; |
| | | import org.jeecg.modules.base.service.IUserGroupService; |
| | | import org.jeecg.modules.mdc.model.ProductionIdModel; |
| | | import org.jeecg.modules.mdc.service.IMdcUserProductionService; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.model.DepartIdModel; |
| | | import org.jeecg.modules.base.model.FactoryIdModel; |
| | |
| | | |
| | | @Resource |
| | | private IUserFactoryService userFactoryService; |
| | | |
| | | @Resource |
| | | private IMdcUserProductionService userProductionService; |
| | | |
| | | @Resource |
| | | private IUserGroupService userGroupService; |
| | |
| | | Result<SysUser> result = new Result<SysUser>(); |
| | | String selectedRoles = jsonObject.getString("selectedroles"); |
| | | String selectedDeparts = jsonObject.getString("selecteddeparts"); |
| | | String selectedProductions = jsonObject.getString("selectedProduction"); |
| | | String selectedProductions = jsonObject.getString("selectedFactorys"); |
| | | try { |
| | | SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class); |
| | | user.setCreateTime(new Date());//设置创建时间 |
| | |
| | | user.setPassword(sysUser.getPassword()); |
| | | String roles = jsonObject.getString("selectedroles"); |
| | | String departs = jsonObject.getString("selecteddeparts"); |
| | | String productions = jsonObject.getString("selectedProduction"); |
| | | String productions = jsonObject.getString("selectedFactorys"); |
| | | if (oConvertUtils.isEmpty(departs)) { |
| | | //vue3.0前端只传递了departIds |
| | | departs = user.getDepartIds(); |
| | |
| | | |
| | | } |
| | | |
| | | @AutoLog(value = "用户表-查询指定用户和产线关联的数据") |
| | | @ApiOperation(value = "用户表-查询指定用户和产线关联的数据", notes = "用户表-查询指定用户和产线关联的数据") |
| | | @GetMapping(value = "/userProductionList") |
| | | public Result<List<FactoryIdModel>> getUserProductionsList(@RequestParam(name = "userId", required = true) String userId) { |
| | | @AutoLog(value = "用户表-查询指定用户和工厂建模关联的数据") |
| | | @ApiOperation(value = "用户表-查询指定用户和工厂建模关联的数据", notes = "用户表-查询指定用户和工厂建模关联的数据") |
| | | @GetMapping(value = "/userFactorysList") |
| | | public Result<List<FactoryIdModel>> getUserFactorysList(@RequestParam(name = "userId", required = true) String userId) { |
| | | Result<List<FactoryIdModel>> result = new Result<>(); |
| | | try { |
| | | List<FactoryIdModel> proIdModelList = this.userFactoryService.queryFactoryIdsOfUser(userId); |
| | | if (proIdModelList != null && !proIdModelList.isEmpty()) { |
| | | List<FactoryIdModel> facIdModelList = this.userFactoryService.queryFactoryIdsOfUser(userId); |
| | | if (facIdModelList != null && !facIdModelList.isEmpty()) { |
| | | result.setSuccess(true); |
| | | result.setMessage("查找成功"); |
| | | result.setResult(proIdModelList); |
| | | result.setResult(facIdModelList); |
| | | } else { |
| | | result.setSuccess(false); |
| | | result.setMessage("查找失败"); |