| | |
| | | import com.mes.device.mapper.DeviceGlassInfoMapper; |
| | | import com.mes.device.service.GlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cloud.context.config.annotation.RefreshScope; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | @Slf4j |
| | | @RefreshScope |
| | | @Service("deviceGlassInfoService") |
| | | public class GlassInfoServiceImpl extends ServiceImpl<DeviceGlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Value("${mes.engineering.import-url}") |
| | | private String mesEngineeringImportUrl; |
| | | |
| | | @Override |
| | | public String getMesEngineeringImportUrl() { |
| | | return mesEngineeringImportUrl; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> buildEngineerImportPayload(List<Map<String, Object>> excelRows) { |
| | | Map<String, Object> result = new HashMap<>(); |
| | |
| | | int qty = (int) parseDouble(row.getOrDefault("quantity", 1), 1); |
| | | if (qty <= 0) qty = 1; |
| | | String glassId = str(row.get("glassId")); |
| | | Integer orderNumber = Integer.parseInt(str(row.get("orderNumber"))); |
| | | String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal); |
| | | String flowCardId = str(row.get("flowCardId")); |
| | | String productName = str(row.get("productName")); |
| | |
| | | m.put("glassId", finalGlassId); |
| | | m.put("engineerId", engineerIdFinal); |
| | | m.put("flowCardId", finalFlowCardId); |
| | | m.put("orderNumber", orderNumber); |
| | | m.put("productSortNumber", idx + 1); |
| | | m.put("hollowCombineDirection", "0"); |
| | | m.put("width", width); |
| | |
| | | m.put("combine", 0); |
| | | m.put("markIcon", ""); |
| | | m.put("filmRemove", 0); |
| | | m.put("flowCardSequence", String.valueOf(idx + 1)); |
| | | m.put("flowCardSequence", flowCardId + "/" + (idx + 1)); |
| | | m.put("process", ""); |
| | | m.put("rawAngle", 0); |
| | | m.put("graphNo", 0); |
| | |
| | | double height = parseDouble(row.get("height"), 0d); |
| | | double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal); |
| | | String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal); |
| | | Integer orderNumber = Integer.parseInt(str(row.get("orderNumber"))); |
| | | |
| | | String productName = str(row.get("productName")); |
| | | String customerName = str(row.get("customerName")); |
| | | |
| | |
| | | m.put("totalLayer", 0); |
| | | m.put("layer", 0); |
| | | m.put("glassTotal", 1); |
| | | m.put("orderNumber", orderNumber); |
| | | m.put("productName", productName); |
| | | m.put("customerName", customerName); |
| | | flowCardMap.put(flowCardId, m); |