|
@@ -1,14 +1,11 @@
|
|
|
package com.szwl.controller;
|
|
|
|
|
|
|
|
|
-import cn.com.crbank.ommo.bean.ResultMessage;
|
|
|
-import cn.com.crbank.ommo.esUtil.BeanUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.szwl.constant.ResponseCodesEnum;
|
|
|
-import com.szwl.model.bean.TEquipmentDTO;
|
|
|
import com.szwl.model.bo.R;
|
|
|
import com.szwl.model.bo.ResponseModel;
|
|
|
import com.szwl.model.entity.*;
|
|
@@ -23,12 +20,8 @@ import org.springframework.amqp.core.AmqpAdmin;
|
|
|
import org.springframework.amqp.core.Binding;
|
|
|
import org.springframework.amqp.core.Queue;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -298,23 +291,24 @@ public class TEquipmentApplyController {
|
|
|
saveProduct(equipmentId);
|
|
|
}
|
|
|
} else if (StringUtils.isNotEmpty(machineType) && machineType.equals("1")){
|
|
|
- saveGoodsData(equipmentId, machineType, 6);
|
|
|
+ switch (equipmentType) {
|
|
|
+ case "P30":
|
|
|
+ saveGoodsData(equipmentId, machineType, 6, equipmentType);
|
|
|
+ break;
|
|
|
+ case "P20":
|
|
|
+ saveGoodsData(equipmentId, machineType, 12, equipmentType);
|
|
|
+ break;
|
|
|
+ case "P10 ":
|
|
|
+ saveGoodsData(equipmentId, machineType, 2, equipmentType);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
} else if (StringUtils.isNotEmpty(machineType) && machineType.equals("2")){
|
|
|
if (equipmentType.equals("SI320")) {
|
|
|
- saveGoodsData(equipmentId, machineType, 6);
|
|
|
+ saveGoodsData(equipmentId, machineType, 6, equipmentType);
|
|
|
}
|
|
|
}
|
|
|
-// if(StringUtils.isNotEmpty(equipmentType) && equipmentType.equals("MG280")){
|
|
|
-// saveProductMG280(equipmentId);
|
|
|
-// } else if(StringUtils.isNotEmpty(equipmentType) && equipmentType.equals("MG320-1")){
|
|
|
-// saveProductMG1(equipmentId);
|
|
|
-// } else if(StringUtils.isNotEmpty(equipmentType) && equipmentType.equals("P30")){
|
|
|
-// saveProductP30(equipmentId);
|
|
|
-// } else if(StringUtils.isNotEmpty(equipmentType) && equipmentType.equals("SI320")){
|
|
|
-// saveProductSI320(equipmentId);
|
|
|
-// } else {
|
|
|
-// saveProduct(equipmentId);
|
|
|
-// }
|
|
|
LambdaQueryWrapper<TEquipment> query1 = Wrappers.lambdaQuery();
|
|
|
query1.eq(TEquipment::getClientId,clientId);
|
|
|
TEquipment tEquipment = equipmentService.getOne(query1);
|
|
@@ -366,10 +360,13 @@ public class TEquipmentApplyController {
|
|
|
* @param machineType
|
|
|
* @param number
|
|
|
*/
|
|
|
- private void saveGoodsData(Long id, String machineType, Integer number) {
|
|
|
+ private void saveGoodsData(Long id, String machineType, Integer number, String equipmentType) {
|
|
|
LambdaQueryWrapper<TGoodsData> wrapper = Wrappers.lambdaQuery();
|
|
|
wrapper.eq(TGoodsData::getNumber, number);
|
|
|
wrapper.eq(TGoodsData::getMachineType, machineType);
|
|
|
+ if (!machineType.equals("0")) {
|
|
|
+ wrapper.eq(TGoodsData::getEquipmentType, equipmentType);
|
|
|
+ }
|
|
|
TGoodsData goodsData = goodsDataService.getOne(wrapper);
|
|
|
String goods = goodsData.getGoods();
|
|
|
String[] str = goods.split(",");
|