|
|
|
@ -28,17 +28,25 @@ import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
import org.springblade.desk.basic.constant.BaseCol; |
|
|
|
import org.springblade.desk.basic.constant.BaseCol; |
|
|
|
import org.springblade.desk.basic.excel.OemExcel; |
|
|
|
import org.springblade.desk.basic.excel.OemExcel; |
|
|
|
import org.springblade.desk.basic.pojo.entity.Oem; |
|
|
|
import org.springblade.desk.basic.pojo.entity.Oem; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.pojo.entity.WorkCenter; |
|
|
|
import org.springblade.desk.basic.pojo.request.OemSearch; |
|
|
|
import org.springblade.desk.basic.pojo.request.OemSearch; |
|
|
|
import org.springblade.desk.basic.pojo.vo.OemVO; |
|
|
|
import org.springblade.desk.basic.pojo.vo.OemVO; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.service.ICraftAbilityService; |
|
|
|
import org.springblade.desk.basic.service.IOemService; |
|
|
|
import org.springblade.desk.basic.service.IOemService; |
|
|
|
import org.springblade.desk.basic.util.ExcelExtUtil; |
|
|
|
import org.springblade.desk.basic.util.ExcelExtUtil; |
|
|
|
import org.springblade.desk.basic.wrapper.OemWrapper; |
|
|
|
import org.springblade.desk.basic.wrapper.OemWrapper; |
|
|
|
|
|
|
|
import org.springblade.scheduling.pojo.entity.CraftAbilityEntity; |
|
|
|
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -59,7 +67,10 @@ public class OemController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private IOemService service; |
|
|
|
private IOemService service; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private ICraftAbilityService craftAbilityService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private IUserClient iUserClient; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* [外协厂家] 详情 |
|
|
|
* [外协厂家] 详情 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -74,6 +85,77 @@ public class OemController extends BladeController { |
|
|
|
return R.data(detailVO); |
|
|
|
return R.data(detailVO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/updateCraftAbilityId") |
|
|
|
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
|
|
|
@Operation(summary = "设置工艺Id保存", description = "传入WorkCenter List") |
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
public R updateCraftAbilityId(@Valid @RequestBody Oem oem) { |
|
|
|
|
|
|
|
QueryWrapper<Oem> qw = Condition.getQueryWrapper(oem); |
|
|
|
|
|
|
|
Oem detail = service.getOne(qw); |
|
|
|
|
|
|
|
// List<Long> craftIds = workCenter.getCraftIds();
|
|
|
|
|
|
|
|
List<CraftAbilityEntity> crafs = oem.getCrafs(); |
|
|
|
|
|
|
|
String result = null; |
|
|
|
|
|
|
|
String craftAbility = null; |
|
|
|
|
|
|
|
if(null != crafs && crafs.size()>0){ |
|
|
|
|
|
|
|
for(CraftAbilityEntity craft:crafs){ |
|
|
|
|
|
|
|
craftAbilityService.updateById(craft); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// result= crafs.stream()
|
|
|
|
|
|
|
|
// .map(user -> String.valueOf(user.getId()))
|
|
|
|
|
|
|
|
// .collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result= crafs.stream() |
|
|
|
|
|
|
|
.map(craf -> craf.getId()) |
|
|
|
|
|
|
|
.filter(Objects::nonNull) // 过滤 null 的 role_id
|
|
|
|
|
|
|
|
.map(String::valueOf) // 转换为 String 类型(适配 joining)
|
|
|
|
|
|
|
|
.collect(Collectors.joining(",")); // 用逗号拼接
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
craftAbility= crafs.stream() |
|
|
|
|
|
|
|
.map(user -> String.valueOf(user.getCaName())) |
|
|
|
|
|
|
|
.collect(Collectors.joining(",")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detail.setCraftAbilityId(result); |
|
|
|
|
|
|
|
detail.setCraftAbility(craftAbility); |
|
|
|
|
|
|
|
service.updateById(detail); |
|
|
|
|
|
|
|
return R.status(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/getSelectCraftAbility") |
|
|
|
|
|
|
|
@ApiOperationSupport(order = 31) |
|
|
|
|
|
|
|
@Operation(summary = "获取已选择工艺", description = "传入WorkCenter List") |
|
|
|
|
|
|
|
public R<List<CraftAbilityEntity>> getSelectCraftAbility(@Valid @RequestBody Oem oem) { |
|
|
|
|
|
|
|
List<CraftAbilityEntity> teams = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<Oem> qw = Condition.getQueryWrapper(oem); |
|
|
|
|
|
|
|
Oem detail = service.getOne(qw); |
|
|
|
|
|
|
|
if(detail != null){ |
|
|
|
|
|
|
|
String teamId = detail.getCraftAbilityId(); |
|
|
|
|
|
|
|
if(null != teamId && !"".equals(teamId)){ |
|
|
|
|
|
|
|
List<Long> ids = Func.toLongList(teamId); |
|
|
|
|
|
|
|
QueryWrapper<CraftAbilityEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.in("id",ids); |
|
|
|
|
|
|
|
teams = craftAbilityService.list(queryWrapper); |
|
|
|
|
|
|
|
for(CraftAbilityEntity team:teams){ |
|
|
|
|
|
|
|
R<User> user= iUserClient.userInfoById(team.getDispatcher()); |
|
|
|
|
|
|
|
if(null != user && null != user.getData()){ |
|
|
|
|
|
|
|
team.setDispatcherName(user.getData().getRealName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
R<User> userplan= iUserClient.userInfoById(team.getPlanner()); |
|
|
|
|
|
|
|
if(null != userplan && null != userplan.getData()){ |
|
|
|
|
|
|
|
team.setPlannerName(userplan.getData().getRealName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.data(teams); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* [外协厂家] list分页 |
|
|
|
* [外协厂家] list分页 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|