fix: 修复导出技术参数的一个错误
This commit is contained in:
parent
c47abd2cfb
commit
50b2d81ec5
|
|
@ -48,7 +48,7 @@ import java.util.stream.Collectors;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/product/model")
|
@RequestMapping("/product/model")
|
||||||
public class ProductModelController extends ControllerBase{
|
public class ProductModelController extends ControllerBase {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IProductModelService productModelService;
|
private IProductModelService productModelService;
|
||||||
|
|
@ -83,7 +83,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @return 机型ID
|
* @return 机型ID
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ApiResult<Integer> add(@Valid @RequestBody ProductModelAddRequest request){
|
public ApiResult<Integer> add(@Valid @RequestBody ProductModelAddRequest request) {
|
||||||
return ApiResult.success(productModelService.add(request));
|
return ApiResult.success(productModelService.add(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ApiResult<Integer> update(@Valid @RequestBody ProductModelUpdateRequest request){
|
public ApiResult<Integer> update(@Valid @RequestBody ProductModelUpdateRequest request) {
|
||||||
return ApiResult.success(productModelService.update(request));
|
return ApiResult.success(productModelService.update(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,7 +101,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/enable")
|
@PostMapping("/enable")
|
||||||
public ApiResult<Void> enable(@Valid @RequestBody EnableRequest request){
|
public ApiResult<Void> enable(@Valid @RequestBody EnableRequest request) {
|
||||||
productModelService.enable(request);
|
productModelService.enable(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +111,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
public ApiResult<Void> delete(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> delete(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelService.delete(request);
|
productModelService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -121,7 +121,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/publish")
|
@PostMapping("/publish")
|
||||||
public ApiResult<Void> publish(@Valid @RequestBody ProductPublishRequest request){
|
public ApiResult<Void> publish(@Valid @RequestBody ProductPublishRequest request) {
|
||||||
productModelService.publish(request);
|
productModelService.publish(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getList")
|
@PostMapping("/getList")
|
||||||
public ApiResult<PageData<ProductModelSearchVO>> getList(@RequestBody ProductModelSearchRequest request){
|
public ApiResult<PageData<ProductModelSearchVO>> getList(@RequestBody ProductModelSearchRequest request) {
|
||||||
return ApiResult.success(productModelService.getList(request));
|
return ApiResult.success(productModelService.getList(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelId 机型ID
|
* @param modelId 机型ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getParams")
|
@GetMapping("/getParams")
|
||||||
public ApiResult<List<ProductModelMainParamsItemChildrenVO>> getParams(@Valid @RequestParam @NotNull Integer modelId){
|
public ApiResult<List<ProductModelMainParamsItemChildrenVO>> getParams(@Valid @RequestParam @NotNull Integer modelId) {
|
||||||
return ApiResult.success(productModelParamsService.getForShow(modelId));
|
return ApiResult.success(productModelParamsService.getForShow(modelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,7 +149,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param typeNumber 类型系列号
|
* @param typeNumber 类型系列号
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getListForSort")
|
@GetMapping("/getListForSort")
|
||||||
public ApiResult<List<ProductModelSearchVO>> getListForSort(@Valid @RequestParam @NotNull String typeNumber){
|
public ApiResult<List<ProductModelSearchVO>> getListForSort(@Valid @RequestParam @NotNull String typeNumber) {
|
||||||
return ApiResult.success(productModelService.getListForSort(typeNumber));
|
return ApiResult.success(productModelService.getListForSort(typeNumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveSort")
|
@PostMapping("/saveSort")
|
||||||
public ApiResult<Void> saveSort(@Valid @RequestBody SortSaveRequest request){
|
public ApiResult<Void> saveSort(@Valid @RequestBody SortSaveRequest request) {
|
||||||
productModelService.saveSort(request);
|
productModelService.saveSort(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @return 机型ID
|
* @return 机型ID
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addIntro")
|
@PostMapping("/addIntro")
|
||||||
public ApiResult<Void> addIntro(@Valid @RequestBody ProductModelIntroAddRequest request){
|
public ApiResult<Void> addIntro(@Valid @RequestBody ProductModelIntroAddRequest request) {
|
||||||
productModelIntroService.add(request);
|
productModelIntroService.add(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +179,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateIntro")
|
@PostMapping("/updateIntro")
|
||||||
public ApiResult<Integer> updateIntro(@Valid @RequestBody ProductModelIntroUpdateRequest request){
|
public ApiResult<Integer> updateIntro(@Valid @RequestBody ProductModelIntroUpdateRequest request) {
|
||||||
return ApiResult.success(productModelIntroService.update(request));
|
return ApiResult.success(productModelIntroService.update(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/deleteIntro")
|
@PostMapping("/deleteIntro")
|
||||||
public ApiResult<Void> deleteIntro(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> deleteIntro(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelIntroService.delete(request);
|
productModelIntroService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +198,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/publishIntro")
|
@PostMapping("/publishIntro")
|
||||||
public ApiResult<Void> publishIntro(@Valid @RequestBody ProductPublishRequest request){
|
public ApiResult<Void> publishIntro(@Valid @RequestBody ProductPublishRequest request) {
|
||||||
productModelIntroService.publish(request);
|
productModelIntroService.publish(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -208,7 +208,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getIntroList")
|
@PostMapping("/getIntroList")
|
||||||
public ApiResult<PageData<ProductModelIntro>> getIntroList(@RequestBody ProductModelIntroSearchRequest request){
|
public ApiResult<PageData<ProductModelIntro>> getIntroList(@RequestBody ProductModelIntroSearchRequest request) {
|
||||||
return ApiResult.success(productModelIntroService.getList(request));
|
return ApiResult.success(productModelIntroService.getList(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,7 +217,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param introId 机型介绍id
|
* @param introId 机型介绍id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getIntroInfo")
|
@GetMapping("/getIntroInfo")
|
||||||
public ApiResult<List<ProductModelIntroItem>> getIntroInfo(@Valid @RequestParam @NotNull Integer introId){
|
public ApiResult<List<ProductModelIntroItem>> getIntroInfo(@Valid @RequestParam @NotNull Integer introId) {
|
||||||
return ApiResult.success(productModelIntroService.getInfo(introId));
|
return ApiResult.success(productModelIntroService.getInfo(introId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,7 +226,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/deleteParams")
|
@PostMapping("/deleteParams")
|
||||||
public ApiResult<Void> deleteParams(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> deleteParams(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelParamsService.delete(request);
|
productModelParamsService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -236,7 +236,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/publishParams")
|
@PostMapping("/publishParams")
|
||||||
public ApiResult<Void> publishParams(@Valid @RequestBody ProductPublishRequest request){
|
public ApiResult<Void> publishParams(@Valid @RequestBody ProductPublishRequest request) {
|
||||||
productModelParamsService.publish(request);
|
productModelParamsService.publish(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -246,7 +246,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getParamsList")
|
@PostMapping("/getParamsList")
|
||||||
public ApiResult<PageData<ProductModelParams>> getParamsList(@Valid @RequestBody ProductModelIntroSearchRequest request){
|
public ApiResult<PageData<ProductModelParams>> getParamsList(@Valid @RequestBody ProductModelIntroSearchRequest request) {
|
||||||
return ApiResult.success(productModelParamsService.getList(request));
|
return ApiResult.success(productModelParamsService.getList(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -255,7 +255,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelParamsId 设备参数ID
|
* @param modelParamsId 设备参数ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getParamsItems")
|
@GetMapping("/getParamsItems")
|
||||||
public ApiResult<List<ProductModelParamsItemVO>> getParamsItems(@RequestParam Integer modelParamsId){
|
public ApiResult<List<ProductModelParamsItemVO>> getParamsItems(@RequestParam Integer modelParamsId) {
|
||||||
return ApiResult.success(productModelParamsItemService.getList(modelParamsId));
|
return ApiResult.success(productModelParamsItemService.getList(modelParamsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,7 +264,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelId 机型id
|
* @param modelId 机型id
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getCNParamsItems")
|
@GetMapping("/getCNParamsItems")
|
||||||
public ApiResult<List<ProductModelMainParamsItemChildrenVO>> getCNParamsItems(@RequestParam Integer modelId){
|
public ApiResult<List<ProductModelMainParamsItemChildrenVO>> getCNParamsItems(@RequestParam Integer modelId) {
|
||||||
return ApiResult.success(productModelParamsService.getCNList(modelId));
|
return ApiResult.success(productModelParamsService.getCNList(modelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -274,9 +274,9 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @return 机型参数id
|
* @return 机型参数id
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addParamsIndexName")
|
@PostMapping("/addParamsIndexName")
|
||||||
public ApiResult<Integer> addParamsIndexName(@Valid @RequestBody ProductModelParamsNameAddRequest request){
|
public ApiResult<Integer> addParamsIndexName(@Valid @RequestBody ProductModelParamsNameAddRequest request) {
|
||||||
if (Objects.isNull(request.getModelParamsId())){
|
if (Objects.isNull(request.getModelParamsId())) {
|
||||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),IdUtil.getSnowflakeNextIdStr()));
|
request.setModelParamsId(productModelParamsService.add(request.getModelId(), IdUtil.getSnowflakeNextIdStr()));
|
||||||
}
|
}
|
||||||
productModelParamsItemService.addIndexName(request);
|
productModelParamsItemService.addIndexName(request);
|
||||||
return ApiResult.success(request.getModelParamsId());
|
return ApiResult.success(request.getModelParamsId());
|
||||||
|
|
@ -293,9 +293,9 @@ public class ProductModelController extends ControllerBase{
|
||||||
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
Integer oldId=request.getModelParamsId();
|
Integer oldId = request.getModelParamsId();
|
||||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),info.getBatchNumber()));
|
request.setModelParamsId(productModelParamsService.add(request.getModelId(), info.getBatchNumber()));
|
||||||
productModelParamsService.copyItems(oldId,request.getModelParamsId());
|
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
||||||
}
|
}
|
||||||
productModelParamsItemService.updateIndexName(request);
|
productModelParamsItemService.updateIndexName(request);
|
||||||
return ApiResult.success(request.getModelParamsId());
|
return ApiResult.success(request.getModelParamsId());
|
||||||
|
|
@ -314,7 +314,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
.throwMessage("不能删除其他人创建的数据");
|
.throwMessage("不能删除其他人创建的数据");
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
Integer oldId = request.getModelParamsId();
|
Integer oldId = request.getModelParamsId();
|
||||||
request.setModelParamsId(productModelParamsService.add(info.getModelId(),info.getBatchNumber()));
|
request.setModelParamsId(productModelParamsService.add(info.getModelId(), info.getBatchNumber()));
|
||||||
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
||||||
}
|
}
|
||||||
productModelParamsItemService.deleteIndexName(request);
|
productModelParamsItemService.deleteIndexName(request);
|
||||||
|
|
@ -326,13 +326,13 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addParamsItem")
|
@PostMapping("/addParamsItem")
|
||||||
public ApiResult<Integer> addParamsItem(@Valid @RequestBody ProductModelParamsItemAddRequest1 request){
|
public ApiResult<Integer> addParamsItem(@Valid @RequestBody ProductModelParamsItemAddRequest1 request) {
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(request.getModelParamsId())).throwMessage("机型参数id不能为空");
|
VUtils.trueThrowBusinessError(Objects.isNull(request.getModelParamsId())).throwMessage("机型参数id不能为空");
|
||||||
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
Integer oldId = request.getModelParamsId();
|
Integer oldId = request.getModelParamsId();
|
||||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),info.getBatchNumber()));
|
request.setModelParamsId(productModelParamsService.add(request.getModelId(), info.getBatchNumber()));
|
||||||
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
||||||
}
|
}
|
||||||
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
||||||
|
|
@ -360,15 +360,15 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateParamsItem")
|
@PostMapping("/updateParamsItem")
|
||||||
public ApiResult<ParamsItemVO> updateParamsItem(@Valid @RequestBody ProductModelParamsItemUpdateRequest1 request){
|
public ApiResult<ParamsItemVO> updateParamsItem(@Valid @RequestBody ProductModelParamsItemUpdateRequest1 request) {
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(request.getModelParamsId())).throwMessage("机型参数id不能为空");
|
VUtils.trueThrowBusinessError(Objects.isNull(request.getModelParamsId())).throwMessage("机型参数id不能为空");
|
||||||
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
ProductModelParams info = productModelParamsService.getById(request.getModelParamsId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
Integer oldId = request.getModelParamsId();
|
Integer oldId = request.getModelParamsId();
|
||||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),info.getBatchNumber()));
|
request.setModelParamsId(productModelParamsService.add(request.getModelId(), info.getBatchNumber()));
|
||||||
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
||||||
ProductModelParamsItem oldItem=productModelParamsItemService.getById(request.getModelParamsItemId());
|
ProductModelParamsItem oldItem = productModelParamsItemService.getById(request.getModelParamsItemId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(oldItem)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(oldItem)).throwMessage("无效的数据");
|
||||||
ProductModelParamsItem item = productModelParamsItemService.lambdaQuery()
|
ProductModelParamsItem item = productModelParamsItemService.lambdaQuery()
|
||||||
.eq(ProductModelParamsItem::getModelParamsId, request.getModelParamsId())
|
.eq(ProductModelParamsItem::getModelParamsId, request.getModelParamsId())
|
||||||
|
|
@ -380,7 +380,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
request.setModelParamsItemId(item.getId());
|
request.setModelParamsItemId(item.getId());
|
||||||
}
|
}
|
||||||
productModelParamsItemService.updateItem(request);
|
productModelParamsItemService.updateItem(request);
|
||||||
ParamsItemVO vo=new ParamsItemVO();
|
ParamsItemVO vo = new ParamsItemVO();
|
||||||
vo.setModelParamsId(request.getModelParamsId());
|
vo.setModelParamsId(request.getModelParamsId());
|
||||||
vo.setModelParamsItemId(request.getModelParamsItemId());
|
vo.setModelParamsItemId(request.getModelParamsItemId());
|
||||||
return ApiResult.success(vo);
|
return ApiResult.success(vo);
|
||||||
|
|
@ -400,7 +400,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
.throwMessage("不能删除其他人创建的数据");
|
.throwMessage("不能删除其他人创建的数据");
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
Integer oldId = request.getModelParamsId();
|
Integer oldId = request.getModelParamsId();
|
||||||
request.setModelParamsId(productModelParamsService.add(request.getModelId(),info.getBatchNumber()));
|
request.setModelParamsId(productModelParamsService.add(request.getModelId(), info.getBatchNumber()));
|
||||||
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
productModelParamsService.copyItems(oldId, request.getModelParamsId());
|
||||||
ProductModelParamsItem oldItem = productModelParamsItemService.getById(request.getModelParamsItemId());
|
ProductModelParamsItem oldItem = productModelParamsItemService.getById(request.getModelParamsItemId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(oldItem)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(oldItem)).throwMessage("无效的数据");
|
||||||
|
|
@ -434,7 +434,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
*/
|
*/
|
||||||
@GetMapping("/exportModelParamsItem")
|
@GetMapping("/exportModelParamsItem")
|
||||||
public void exportModelParamsItem(HttpServletResponse response, @Valid @RequestParam @NotNull Integer modelParamsId) throws IOException {
|
public void exportModelParamsItem(HttpServletResponse response, @Valid @RequestParam @NotNull Integer modelParamsId) throws IOException {
|
||||||
ProductModelParams params=productModelParamsService.getById(modelParamsId);
|
ProductModelParams params = productModelParamsService.getById(modelParamsId);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(params)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(params)).throwMessage("无效的数据");
|
||||||
ProductModel model = productModelService.getById(params.getModelId());
|
ProductModel model = productModelService.getById(params.getModelId());
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("无效的数据");
|
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("无效的数据");
|
||||||
|
|
@ -468,15 +468,15 @@ public class ProductModelController extends ControllerBase{
|
||||||
Cell cell0_0 = headerRow0.createCell(0);
|
Cell cell0_0 = headerRow0.createCell(0);
|
||||||
cell0_0.setCellValue("机型技术参数");
|
cell0_0.setCellValue("机型技术参数");
|
||||||
cell0_0.setCellStyle(headerStyle);
|
cell0_0.setCellStyle(headerStyle);
|
||||||
createEmptyCell(headerRow0,headerStyle,1, colCount - 1);
|
createEmptyCell(headerRow0, headerStyle, 1, colCount - 1);
|
||||||
cellRangeAddresses.add(new CellRangeAddress(0, 0, 0, colCount - 1));
|
cellRangeAddresses.add(new CellRangeAddress(0, 0, 0, colCount - 1));
|
||||||
Row headerRow1 = sheet.createRow(1);
|
Row headerRow1 = sheet.createRow(1);
|
||||||
Cell cell1_0 = headerRow1.createCell(0);
|
Cell cell1_0 = headerRow1.createCell(0);
|
||||||
cell1_0.setCellValue(getRequiredText(workbook,"产品型号"));
|
cell1_0.setCellValue(getRequiredText(workbook, "产品型号"));
|
||||||
cell1_0.setCellStyle(headerStyle);
|
cell1_0.setCellStyle(headerStyle);
|
||||||
Cell cell1_1 = headerRow1.createCell(1);
|
Cell cell1_1 = headerRow1.createCell(1);
|
||||||
cell1_1.setCellValue(model.getNo());
|
cell1_1.setCellValue(model.getNo());
|
||||||
createEmptyCell(headerRow1,headerStyle,2, colCount - 1);
|
createEmptyCell(headerRow1, headerStyle, 2, colCount - 1);
|
||||||
cellRangeAddresses.add(new CellRangeAddress(1, 1, 1, colCount - 1));
|
cellRangeAddresses.add(new CellRangeAddress(1, 1, 1, colCount - 1));
|
||||||
Row headerRow2 = sheet.createRow(2);
|
Row headerRow2 = sheet.createRow(2);
|
||||||
Row headerRow3 = sheet.createRow(3);
|
Row headerRow3 = sheet.createRow(3);
|
||||||
|
|
@ -493,12 +493,12 @@ public class ProductModelController extends ControllerBase{
|
||||||
Cell cell_row2 = headerRow2.createCell(colStart.get());
|
Cell cell_row2 = headerRow2.createCell(colStart.get());
|
||||||
cell_row2.setCellValue(language.getName());
|
cell_row2.setCellValue(language.getName());
|
||||||
cell_row2.setCellStyle(headerStyle);
|
cell_row2.setCellStyle(headerStyle);
|
||||||
createEmptyCell(headerRow2,headerStyle,colStart.get()+1, colEnd.get());
|
createEmptyCell(headerRow2, headerStyle, colStart.get() + 1, colEnd.get());
|
||||||
cellRangeAddresses.add(new CellRangeAddress(2, 2, colStart.get(), colEnd.get()));
|
cellRangeAddresses.add(new CellRangeAddress(2, 2, colStart.get(), colEnd.get()));
|
||||||
if (i == 0){
|
if (i == 0) {
|
||||||
Cell cell3_0 = headerRow3.createCell(0);
|
Cell cell3_0 = headerRow3.createCell(0);
|
||||||
cell3_0.setCellStyle(headerStyle);
|
cell3_0.setCellStyle(headerStyle);
|
||||||
cell3_0.setCellValue(getRequiredText(workbook,"指标名称"));
|
cell3_0.setCellValue(getRequiredText(workbook, "指标名称"));
|
||||||
Cell cell3_1 = headerRow3.createCell(1);
|
Cell cell3_1 = headerRow3.createCell(1);
|
||||||
cell3_1.setCellStyle(headerStyle);
|
cell3_1.setCellStyle(headerStyle);
|
||||||
cell3_1.setCellValue(getRequiredText(workbook, "技术参数"));
|
cell3_1.setCellValue(getRequiredText(workbook, "技术参数"));
|
||||||
|
|
@ -523,23 +523,26 @@ public class ProductModelController extends ControllerBase{
|
||||||
cell3_2.setCellValue("参数指标");
|
cell3_2.setCellValue("参数指标");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(paramsItems)){
|
if (CollectionUtil.isNotEmpty(paramsItems)) {
|
||||||
AtomicInteger rowIndex= new AtomicInteger(4);
|
AtomicInteger rowIndex = new AtomicInteger(4);
|
||||||
List<ProductModelParamsItem> cnItems=paramsItems.stream().filter(item -> StrUtil.equals(item.getLanguageCode(), Constant.DEFAULT_LANGUAGE_CODE)).collect(Collectors.toList());
|
List<ProductModelParamsItem> cnItems = paramsItems.stream().filter(item -> StrUtil.equals(item.getLanguageCode(), Constant.DEFAULT_LANGUAGE_CODE)).collect(Collectors.toList());
|
||||||
Map<String, List<ProductModelParamsItem>> itemMap=cnItems.stream().collect(Collectors.groupingBy(ProductModelParamsItem::getIndexName));
|
Map<String, List<ProductModelParamsItem>> itemMap = cnItems.stream().collect(Collectors.groupingBy(ProductModelParamsItem::getIndexName));
|
||||||
AtomicInteger row= new AtomicInteger(rowIndex.get());
|
AtomicInteger row = new AtomicInteger(rowIndex.get());
|
||||||
itemMap.forEach((indexName, itemData) -> {
|
itemMap.forEach((indexName, itemData) -> {
|
||||||
itemData.forEach(mit->{
|
int itemSize = itemData.size();
|
||||||
|
itemData.forEach(mit -> {
|
||||||
Row dataRow = sheet.createRow(rowIndex.getAndIncrement());
|
Row dataRow = sheet.createRow(rowIndex.getAndIncrement());
|
||||||
List<ProductModelParamsItem> rowItem = paramsItems.stream()
|
List<ProductModelParamsItem> rowItem = paramsItems.stream()
|
||||||
.filter(item -> StrUtil.equals(item.getBatchNumber(), mit.getBatchNumber()))
|
.filter(item -> StrUtil.equals(item.getBatchNumber(), mit.getBatchNumber()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
for (int i = 0; i < languages.size(); i++) {
|
for (int i = 0; i < languages.size(); i++) {
|
||||||
Language language = languages.get(i);
|
Language language = languages.get(i);
|
||||||
ProductModelParamsItem litem=rowItem.stream().filter(item -> StrUtil.equals(item.getLanguageCode(),language.getCode())).findFirst().orElse(null);
|
ProductModelParamsItem litem = rowItem.stream().filter(item -> StrUtil.equals(item.getLanguageCode(), language.getCode())).findFirst().orElse(null);
|
||||||
if (Objects.nonNull(litem)) {
|
if (Objects.nonNull(litem)) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
cellRangeAddresses.add(new CellRangeAddress(row.get(), row.get() + itemData.size()-1, 0, 0));
|
if (row.get() != row.get() + itemSize - 1) {
|
||||||
|
cellRangeAddresses.add(new CellRangeAddress(row.get(), row.get() + itemSize - 1, 0, 0));
|
||||||
|
}
|
||||||
colStart.set(0);
|
colStart.set(0);
|
||||||
colEnd.set(3 + 2 - 1);
|
colEnd.set(3 + 2 - 1);
|
||||||
Cell dataCell0 = dataRow.createCell(0);
|
Cell dataCell0 = dataRow.createCell(0);
|
||||||
|
|
@ -560,7 +563,9 @@ public class ProductModelController extends ControllerBase{
|
||||||
} else {
|
} else {
|
||||||
colStart.set(colEnd.get() + 1);
|
colStart.set(colEnd.get() + 1);
|
||||||
colEnd.addAndGet(3);
|
colEnd.addAndGet(3);
|
||||||
cellRangeAddresses.add(new CellRangeAddress(row.get(), row.get() +itemData.size()-1, colStart.get(),colStart.get()));
|
if (row.get() != row.get() + itemSize - 1) {
|
||||||
|
cellRangeAddresses.add(new CellRangeAddress(row.get(), row.get() + itemSize - 1, colStart.get(), colStart.get()));
|
||||||
|
}
|
||||||
Cell dataCell0 = dataRow.createCell(colStart.get());
|
Cell dataCell0 = dataRow.createCell(colStart.get());
|
||||||
dataCell0.setCellValue(litem.getIndexName());
|
dataCell0.setCellValue(litem.getIndexName());
|
||||||
dataCell0.setCellStyle(dataStyle);
|
dataCell0.setCellStyle(dataStyle);
|
||||||
|
|
@ -574,7 +579,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
row.addAndGet(itemData.size());
|
row.addAndGet(itemSize);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -587,16 +592,16 @@ public class ProductModelController extends ControllerBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createEmptyCell(Row row,CellStyle style,int colStart,int colEnd){
|
private void createEmptyCell(Row row, CellStyle style, int colStart, int colEnd) {
|
||||||
for (int colIndex = colStart; colIndex <= colEnd; colIndex++){
|
for (int colIndex = colStart; colIndex <= colEnd; colIndex++) {
|
||||||
Cell cell=row.createCell(colIndex);
|
Cell cell = row.createCell(colIndex);
|
||||||
cell.setCellStyle(style);
|
cell.setCellStyle(style);
|
||||||
cell.setCellValue("");
|
cell.setCellValue("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private RichTextString getRequiredText(org.apache.poi.ss.usermodel.Workbook workbook,String text){
|
private RichTextString getRequiredText(org.apache.poi.ss.usermodel.Workbook workbook, String text) {
|
||||||
RichTextString richString = workbook.getCreationHelper().createRichTextString("*"+text);
|
RichTextString richString = workbook.getCreationHelper().createRichTextString("*" + text);
|
||||||
Font boldFont = workbook.createFont();
|
Font boldFont = workbook.createFont();
|
||||||
boldFont.setBold(true);
|
boldFont.setBold(true);
|
||||||
Font redFont = workbook.createFont();
|
Font redFont = workbook.createFont();
|
||||||
|
|
@ -616,14 +621,14 @@ public class ProductModelController extends ControllerBase{
|
||||||
@Transactional
|
@Transactional
|
||||||
@PostMapping("/importModelParamsItem")
|
@PostMapping("/importModelParamsItem")
|
||||||
public ApiResult<Integer> importModelParamsItem(@Valid @RequestParam @NotNull int modelId
|
public ApiResult<Integer> importModelParamsItem(@Valid @RequestParam @NotNull int modelId
|
||||||
,@RequestParam(required = false,defaultValue = "0") int modelParamsId
|
, @RequestParam(required = false, defaultValue = "0") int modelParamsId
|
||||||
, @Valid @RequestParam(value = "file") @NotNull MultipartFile file) {
|
, @Valid @RequestParam(value = "file") @NotNull MultipartFile file) {
|
||||||
ProductModel model=productModelService.getById(modelId);
|
ProductModel model = productModelService.getById(modelId);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("无效的"+modelId);
|
VUtils.trueThrowBusinessError(Objects.isNull(model)).throwMessage("无效的" + modelId);
|
||||||
try (InputStream inputStream = file.getInputStream();org.apache.poi.ss.usermodel.Workbook workbook = new XSSFWorkbook(inputStream)){
|
try (InputStream inputStream = file.getInputStream(); org.apache.poi.ss.usermodel.Workbook workbook = new XSSFWorkbook(inputStream)) {
|
||||||
Sheet sheet=workbook.getSheetAt(0);
|
Sheet sheet = workbook.getSheetAt(0);
|
||||||
String no=StrUtil.trim(sheet.getRow(1).getCell(1).getStringCellValue());
|
String no = StrUtil.trim(sheet.getRow(1).getCell(1).getStringCellValue());
|
||||||
VUtils.trueThrowBusinessError(!StrUtil.equals(model.getNo(),no)).throwMessage("产品型号不一致");
|
VUtils.trueThrowBusinessError(!StrUtil.equals(model.getNo(), no)).throwMessage("产品型号不一致");
|
||||||
List<ProductModelParamsExcelDTO> datas = new ArrayList<>();
|
List<ProductModelParamsExcelDTO> datas = new ArrayList<>();
|
||||||
String indexName = null;
|
String indexName = null;
|
||||||
DataFormatter dataFormatter = new DataFormatter();
|
DataFormatter dataFormatter = new DataFormatter();
|
||||||
|
|
@ -633,40 +638,40 @@ public class ProductModelController extends ControllerBase{
|
||||||
if (Objects.isNull(row)) {
|
if (Objects.isNull(row)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ProductModelParamsExcelDTO dto=new ProductModelParamsExcelDTO();
|
ProductModelParamsExcelDTO dto = new ProductModelParamsExcelDTO();
|
||||||
Cell cell0=row.getCell(0);
|
Cell cell0 = row.getCell(0);
|
||||||
dto.setIndexName(StrUtil.trim(cell0.getStringCellValue()));
|
dto.setIndexName(StrUtil.trim(cell0.getStringCellValue()));
|
||||||
if (StrUtil.isBlank(dto.getIndexName())){
|
if (StrUtil.isBlank(dto.getIndexName())) {
|
||||||
VUtils.trueThrowBusinessError(StrUtil.isBlank(indexName)).throwMessage("指标名称不能为空");
|
VUtils.trueThrowBusinessError(StrUtil.isBlank(indexName)).throwMessage("指标名称不能为空");
|
||||||
dto.setIndexName(indexName);
|
dto.setIndexName(indexName);
|
||||||
}else {
|
} else {
|
||||||
indexName=dto.getIndexName();
|
indexName = dto.getIndexName();
|
||||||
}
|
}
|
||||||
Cell cell1=row.getCell(1);
|
Cell cell1 = row.getCell(1);
|
||||||
if ((Objects.isNull(cell1) || StrUtil.isBlank(cell1.getStringCellValue()))){
|
if ((Objects.isNull(cell1) || StrUtil.isBlank(cell1.getStringCellValue()))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dto.setName(StrUtil.trim(cell1.getStringCellValue()));
|
dto.setName(StrUtil.trim(cell1.getStringCellValue()));
|
||||||
Cell cell2=row.getCell(2);
|
Cell cell2 = row.getCell(2);
|
||||||
dto.setValue(StrUtil.trim(dataFormatter.formatCellValue(cell2)));
|
dto.setValue(StrUtil.trim(dataFormatter.formatCellValue(cell2)));
|
||||||
Cell cell3=row.getCell(3);
|
Cell cell3 = row.getCell(3);
|
||||||
dto.setMain(StrUtil.equals(cell3.getStringCellValue(),"是"));
|
dto.setMain(StrUtil.equals(cell3.getStringCellValue(), "是"));
|
||||||
Cell cell4=row.getCell(4);
|
Cell cell4 = row.getCell(4);
|
||||||
dto.setCompare(StrUtil.equals(cell4.getStringCellValue(),"是"));
|
dto.setCompare(StrUtil.equals(cell4.getStringCellValue(), "是"));
|
||||||
datas.add(dto);
|
datas.add(dto);
|
||||||
}
|
}
|
||||||
// log.info("导入的数据是:{}", JSONUtil.toJsonStr(datas));
|
// log.info("导入的数据是:{}", JSONUtil.toJsonStr(datas));
|
||||||
VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(datas)).throwMessage("数据不能为空");
|
VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(datas)).throwMessage("数据不能为空");
|
||||||
List<Language> languages = languageService.getLanguages();
|
List<Language> languages = languageService.getLanguages();
|
||||||
languages.removeIf(l->StrUtil.equals(l.getCode(),Constant.DEFAULT_LANGUAGE_CODE));
|
languages.removeIf(l -> StrUtil.equals(l.getCode(), Constant.DEFAULT_LANGUAGE_CODE));
|
||||||
int resultId;
|
int resultId;
|
||||||
if (modelParamsId == 0) {
|
if (modelParamsId == 0) {
|
||||||
resultId = productModelParamsService.add(modelId, IdUtil.getSnowflakeNextIdStr());
|
resultId = productModelParamsService.add(modelId, IdUtil.getSnowflakeNextIdStr());
|
||||||
List<ProductModelParamsItem> items=new ArrayList<>();
|
List<ProductModelParamsItem> items = new ArrayList<>();
|
||||||
int finalResultId = resultId;
|
int finalResultId = resultId;
|
||||||
datas.forEach(dto -> {
|
datas.forEach(dto -> {
|
||||||
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
||||||
ProductModelParamsItem cn=new ProductModelParamsItem()
|
ProductModelParamsItem cn = new ProductModelParamsItem()
|
||||||
.setModelParamsId(finalResultId)
|
.setModelParamsId(finalResultId)
|
||||||
.setLanguageCode(Constant.DEFAULT_LANGUAGE_CODE)
|
.setLanguageCode(Constant.DEFAULT_LANGUAGE_CODE)
|
||||||
.setBatchNumber(batchNumber)
|
.setBatchNumber(batchNumber)
|
||||||
|
|
@ -701,9 +706,9 @@ public class ProductModelController extends ControllerBase{
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
productModelParamsItemService.saveBatch(items);
|
productModelParamsItemService.saveBatch(items);
|
||||||
}else {
|
} else {
|
||||||
ProductModelParams info = productModelParamsService.getById(modelParamsId);
|
ProductModelParams info = productModelParamsService.getById(modelParamsId);
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的"+modelParamsId);
|
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的" + modelParamsId);
|
||||||
resultId = modelParamsId;
|
resultId = modelParamsId;
|
||||||
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
if (Objects.equals(info.getState(), PublishState.Published.getState())) {
|
||||||
resultId = productModelParamsService.add(modelId, info.getBatchNumber());
|
resultId = productModelParamsService.add(modelId, info.getBatchNumber());
|
||||||
|
|
@ -711,13 +716,13 @@ public class ProductModelController extends ControllerBase{
|
||||||
}
|
}
|
||||||
List<ProductModelParamsItem> oldItems = productModelParamsItemService.lambdaQuery().eq(ProductModelParamsItem::getModelParamsId, resultId).list();
|
List<ProductModelParamsItem> oldItems = productModelParamsItemService.lambdaQuery().eq(ProductModelParamsItem::getModelParamsId, resultId).list();
|
||||||
int finalResultId1 = resultId;
|
int finalResultId1 = resultId;
|
||||||
List<ProductModelParamsItem> items=new ArrayList<>();
|
List<ProductModelParamsItem> items = new ArrayList<>();
|
||||||
datas.forEach(dto -> {
|
datas.forEach(dto -> {
|
||||||
if (oldItems.stream().noneMatch(it -> StrUtil.equals(it.getLanguageCode(), Constant.DEFAULT_LANGUAGE_CODE)
|
if (oldItems.stream().noneMatch(it -> StrUtil.equals(it.getLanguageCode(), Constant.DEFAULT_LANGUAGE_CODE)
|
||||||
&& StrUtil.equals(it.getIndexName(), dto.getIndexName())
|
&& StrUtil.equals(it.getIndexName(), dto.getIndexName())
|
||||||
&& StrUtil.equals(it.getName(), dto.getName()))) {
|
&& StrUtil.equals(it.getName(), dto.getName()))) {
|
||||||
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
String batchNumber = IdUtil.getSnowflakeNextIdStr();
|
||||||
ProductModelParamsItem cn=new ProductModelParamsItem()
|
ProductModelParamsItem cn = new ProductModelParamsItem()
|
||||||
.setModelParamsId(finalResultId1)
|
.setModelParamsId(finalResultId1)
|
||||||
.setLanguageCode(Constant.DEFAULT_LANGUAGE_CODE)
|
.setLanguageCode(Constant.DEFAULT_LANGUAGE_CODE)
|
||||||
.setBatchNumber(batchNumber)
|
.setBatchNumber(batchNumber)
|
||||||
|
|
@ -742,7 +747,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
.setCreateBy(AdminUserUtil.getUserName())
|
.setCreateBy(AdminUserUtil.getUserName())
|
||||||
.setCreateTime(LocalDateTime.now());
|
.setCreateTime(LocalDateTime.now());
|
||||||
if (StrUtil.equals(language.getCode(), "sa") || StrUtil.equals(language.getCode(), "de")) {
|
if (StrUtil.equals(language.getCode(), "sa") || StrUtil.equals(language.getCode(), "de")) {
|
||||||
ProductModelParamsItem en = items.stream().filter(it ->StrUtil.equals(it.getBatchNumber(), cn.getBatchNumber()) && StrUtil.equals(it.getLanguageCode(), "us")).findFirst().get();
|
ProductModelParamsItem en = items.stream().filter(it -> StrUtil.equals(it.getBatchNumber(), cn.getBatchNumber()) && StrUtil.equals(it.getLanguageCode(), "us")).findFirst().get();
|
||||||
item.setIndexName(translate.translateWord(en.getIndexName(), language.getTranslateCode()));
|
item.setIndexName(translate.translateWord(en.getIndexName(), language.getTranslateCode()));
|
||||||
item.setName(translate.translateWord(en.getName(), language.getTranslateCode()));
|
item.setName(translate.translateWord(en.getName(), language.getTranslateCode()));
|
||||||
item.setValue(translate.translateWord(en.getValue(), language.getTranslateCode()));
|
item.setValue(translate.translateWord(en.getValue(), language.getTranslateCode()));
|
||||||
|
|
@ -769,8 +774,8 @@ public class ProductModelController extends ControllerBase{
|
||||||
* 获取主要参数列表用于排序
|
* 获取主要参数列表用于排序
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getMainParamsListForSort")
|
@GetMapping("/getMainParamsListForSort")
|
||||||
public ApiResult<List<ParamsSortListVO>> getMainParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId){
|
public ApiResult<List<ParamsSortListVO>> getMainParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId) {
|
||||||
return ApiResult.success(productModelParamsService.getMainListForSort(modelParamsId,Constant.DEFAULT_LANGUAGE_CODE));
|
return ApiResult.success(productModelParamsService.getMainListForSort(modelParamsId, Constant.DEFAULT_LANGUAGE_CODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -778,7 +783,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveMainParamsSort")
|
@PostMapping("/saveMainParamsSort")
|
||||||
public ApiResult<Void> saveMainParamsSort(@Valid @RequestBody ParamsSortSaveRequest request){
|
public ApiResult<Void> saveMainParamsSort(@Valid @RequestBody ParamsSortSaveRequest request) {
|
||||||
productModelParamsService.saveMainSort(request);
|
productModelParamsService.saveMainSort(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -787,8 +792,8 @@ public class ProductModelController extends ControllerBase{
|
||||||
* 获取重要参数列表用于排序
|
* 获取重要参数列表用于排序
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getImportantParamsListForSort")
|
@GetMapping("/getImportantParamsListForSort")
|
||||||
public ApiResult<List<ParamsSortListVO>> getImportantParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId){
|
public ApiResult<List<ParamsSortListVO>> getImportantParamsListForSort(@Valid @RequestParam @NotNull Integer modelParamsId) {
|
||||||
return ApiResult.success(productModelParamsService.getImportantParamsListForSort(modelParamsId,Constant.DEFAULT_LANGUAGE_CODE));
|
return ApiResult.success(productModelParamsService.getImportantParamsListForSort(modelParamsId, Constant.DEFAULT_LANGUAGE_CODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -796,7 +801,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveImportantParamsSort")
|
@PostMapping("/saveImportantParamsSort")
|
||||||
public ApiResult<Void> saveImportantParamsSort(@Valid @RequestBody ParamsSortSaveRequest request){
|
public ApiResult<Void> saveImportantParamsSort(@Valid @RequestBody ParamsSortSaveRequest request) {
|
||||||
productModelParamsService.saveImportantSort(request);
|
productModelParamsService.saveImportantSort(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -806,7 +811,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addVideo")
|
@PostMapping("/addVideo")
|
||||||
public ApiResult<Void> addVideo(@Valid @RequestBody ProductModelVideoAddRequest request){
|
public ApiResult<Void> addVideo(@Valid @RequestBody ProductModelVideoAddRequest request) {
|
||||||
productModelVideoService.add(request);
|
productModelVideoService.add(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -816,7 +821,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateVideo")
|
@PostMapping("/updateVideo")
|
||||||
public ApiResult<Integer> updateVideo(@Valid @RequestBody ProductModelVideoUpdateRequest request){
|
public ApiResult<Integer> updateVideo(@Valid @RequestBody ProductModelVideoUpdateRequest request) {
|
||||||
return ApiResult.success(productModelVideoService.update(request));
|
return ApiResult.success(productModelVideoService.update(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -825,7 +830,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/enableVideo")
|
@PostMapping("/enableVideo")
|
||||||
public ApiResult<Void> enableVideo(@Valid @RequestBody EnableRequest request){
|
public ApiResult<Void> enableVideo(@Valid @RequestBody EnableRequest request) {
|
||||||
productModelVideoService.enable(request);
|
productModelVideoService.enable(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -835,7 +840,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/deleteVideo")
|
@PostMapping("/deleteVideo")
|
||||||
public ApiResult<Void> deleteVideo(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> deleteVideo(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelVideoService.delete(request);
|
productModelVideoService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -855,7 +860,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getVideoList")
|
@PostMapping("/getVideoList")
|
||||||
public ApiResult<PageData<ProductModelVideo>> getVideoList(@Valid @RequestBody ProductModelImageSearchRequest request){
|
public ApiResult<PageData<ProductModelVideo>> getVideoList(@Valid @RequestBody ProductModelImageSearchRequest request) {
|
||||||
return ApiResult.success(productModelVideoService.getList(request));
|
return ApiResult.success(productModelVideoService.getList(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -864,7 +869,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelVideoId 视频ID
|
* @param modelVideoId 视频ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getVideoInfo")
|
@GetMapping("/getVideoInfo")
|
||||||
public ApiResult<ProductModelVideoInfoVO> getVideoInfo(@RequestParam Integer modelVideoId){
|
public ApiResult<ProductModelVideoInfoVO> getVideoInfo(@RequestParam Integer modelVideoId) {
|
||||||
return ApiResult.success(productModelVideoService.getInfo(modelVideoId));
|
return ApiResult.success(productModelVideoService.getInfo(modelVideoId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -873,7 +878,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelId 机型ID
|
* @param modelId 机型ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getVideoListForSort")
|
@GetMapping("/getVideoListForSort")
|
||||||
public ApiResult<List<ProductModelVideo>> getVideoListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
public ApiResult<List<ProductModelVideo>> getVideoListForSort(@Valid @RequestParam @NotNull Integer modelId) {
|
||||||
return ApiResult.success(productModelVideoService.getListForSort(modelId));
|
return ApiResult.success(productModelVideoService.getListForSort(modelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -882,7 +887,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/saveVideoSort")
|
@PostMapping("/saveVideoSort")
|
||||||
public ApiResult<Void> saveVideoSort(@Valid @RequestBody SortSaveRequest request){
|
public ApiResult<Void> saveVideoSort(@Valid @RequestBody SortSaveRequest request) {
|
||||||
productModelVideoService.saveSort(request);
|
productModelVideoService.saveSort(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -892,7 +897,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addFile")
|
@PostMapping("/addFile")
|
||||||
public ApiResult<Void> addFile(@Valid @RequestBody ProductModelFileAddRequest request){
|
public ApiResult<Void> addFile(@Valid @RequestBody ProductModelFileAddRequest request) {
|
||||||
productModelFileService.add(request);
|
productModelFileService.add(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -902,7 +907,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/updateFile")
|
@PostMapping("/updateFile")
|
||||||
public ApiResult<Integer> updateFile(@Valid @RequestBody ProductModelFileUpdateRequest request){
|
public ApiResult<Integer> updateFile(@Valid @RequestBody ProductModelFileUpdateRequest request) {
|
||||||
return ApiResult.success(productModelFileService.update(request));
|
return ApiResult.success(productModelFileService.update(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -911,7 +916,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/enableFile")
|
@PostMapping("/enableFile")
|
||||||
public ApiResult<Void> enableFile(@Valid @RequestBody EnableRequest request){
|
public ApiResult<Void> enableFile(@Valid @RequestBody EnableRequest request) {
|
||||||
productModelFileService.enable(request);
|
productModelFileService.enable(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -921,7 +926,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/deleteFile")
|
@PostMapping("/deleteFile")
|
||||||
public ApiResult<Void> deleteFile(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> deleteFile(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelFileService.delete(request);
|
productModelFileService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -941,10 +946,10 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getFileList")
|
@PostMapping("/getFileList")
|
||||||
public ApiResult<PageData<ProductModelFileVO>> getFileList(@Valid @RequestBody ProductModelImageSearchRequest request){
|
public ApiResult<PageData<ProductModelFileVO>> getFileList(@Valid @RequestBody ProductModelImageSearchRequest request) {
|
||||||
return ApiResult.success(PageUtil.convert(productModelFileService.getList(request), d -> {
|
return ApiResult.success(PageUtil.convert(productModelFileService.getList(request), d -> {
|
||||||
ProductModelFileVO vo=Convert.convert(ProductModelFileVO.class, d);
|
ProductModelFileVO vo = Convert.convert(ProductModelFileVO.class, d);
|
||||||
vo.setLanguages(Convert.toList(ProductModelFileItemAddRequest.class,productModelFileService.getLanguages(vo.getId())));
|
vo.setLanguages(Convert.toList(ProductModelFileItemAddRequest.class, productModelFileService.getLanguages(vo.getId())));
|
||||||
return vo;
|
return vo;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
@ -964,7 +969,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @return 配置信息
|
* @return 配置信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getFileDefaultCondig")
|
@GetMapping("/getFileDefaultCondig")
|
||||||
public ApiResult<List<FileDefaultConfigVO>> getFileDefaultCondig(@Valid @RequestParam @NotNull Integer modelId){
|
public ApiResult<List<FileDefaultConfigVO>> getFileDefaultCondig(@Valid @RequestParam @NotNull Integer modelId) {
|
||||||
return ApiResult.success(productModelFileService.getDefaultConfig(modelId));
|
return ApiResult.success(productModelFileService.getDefaultConfig(modelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -973,7 +978,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 配置信息
|
* @param request 配置信息
|
||||||
*/
|
*/
|
||||||
@PostMapping("/setFileDefaultCondig")
|
@PostMapping("/setFileDefaultCondig")
|
||||||
public ApiResult<Void> setFileDefaultCondig(@Valid @RequestBody FileDefaultConfigRequest request){
|
public ApiResult<Void> setFileDefaultCondig(@Valid @RequestBody FileDefaultConfigRequest request) {
|
||||||
productModelFileService.setFileDefaultCondig(request);
|
productModelFileService.setFileDefaultCondig(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -983,7 +988,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param modelId 机型ID
|
* @param modelId 机型ID
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getFileListForSort")
|
@GetMapping("/getFileListForSort")
|
||||||
public ApiResult<List<ProductModelFile>> getFileListForSort(@Valid @RequestParam @NotNull Integer modelId){
|
public ApiResult<List<ProductModelFile>> getFileListForSort(@Valid @RequestParam @NotNull Integer modelId) {
|
||||||
return ApiResult.success(productModelFileService.getListForSort(modelId));
|
return ApiResult.success(productModelFileService.getListForSort(modelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1021,7 +1026,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/deleteHotImage")
|
@PostMapping("/deleteHotImage")
|
||||||
public ApiResult<Void> deleteHotImage(@Valid @RequestBody BatchDeleteRequest request){
|
public ApiResult<Void> deleteHotImage(@Valid @RequestBody BatchDeleteRequest request) {
|
||||||
productModelHotimageService.delete(request);
|
productModelHotimageService.delete(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -1031,7 +1036,7 @@ public class ProductModelController extends ControllerBase{
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
*/
|
*/
|
||||||
@PostMapping("/publishHotImage")
|
@PostMapping("/publishHotImage")
|
||||||
public ApiResult<Void> publishHotImage(@Valid @RequestBody ProductPublishRequest request){
|
public ApiResult<Void> publishHotImage(@Valid @RequestBody ProductPublishRequest request) {
|
||||||
productModelHotimageService.publish(request);
|
productModelHotimageService.publish(request);
|
||||||
return ApiResult.success();
|
return ApiResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue