|
|
|
@ -4,14 +4,12 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
import com.alibaba.nacos.shaded.com.google.common.collect.Lists; |
|
|
|
import com.alibaba.nacos.shaded.com.google.common.collect.Lists; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
@ -22,7 +20,6 @@ import org.springblade.desk.common.enums.MesApprovalRecordBizTypeEnum; |
|
|
|
import org.springblade.desk.common.factory.MesApprovalDetailFactory; |
|
|
|
import org.springblade.desk.common.factory.MesApprovalDetailFactory; |
|
|
|
import org.springblade.desk.common.feign.IMesApprovalRecordClient; |
|
|
|
import org.springblade.desk.common.feign.IMesApprovalRecordClient; |
|
|
|
import org.springblade.desk.common.feign.IMesNotifyMessageClient; |
|
|
|
import org.springblade.desk.common.feign.IMesNotifyMessageClient; |
|
|
|
import org.springblade.desk.common.pojo.dto.MesApprovalRecordFeignDTO; |
|
|
|
|
|
|
|
import org.springblade.desk.common.pojo.entity.MesNotifyMessageEntity; |
|
|
|
import org.springblade.desk.common.pojo.entity.MesNotifyMessageEntity; |
|
|
|
import org.springblade.desk.common.service.IMesApprovalRecordService; |
|
|
|
import org.springblade.desk.common.service.IMesApprovalRecordService; |
|
|
|
import org.springblade.desk.oem.mapper.OemStatementMapper; |
|
|
|
import org.springblade.desk.oem.mapper.OemStatementMapper; |
|
|
|
@ -57,6 +54,7 @@ import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 外协结算单 服务实现类 |
|
|
|
* 外协结算单 服务实现类 |
|
|
|
@ -1550,9 +1548,10 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
return statementVOS; |
|
|
|
return statementVOS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isTsb(String psName){ |
|
|
|
private boolean isTsb(String psName) { |
|
|
|
return "涂色标".equals(psName); |
|
|
|
return "涂色标".equals(psName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取报价单列表 |
|
|
|
* 获取报价单列表 |
|
|
|
* |
|
|
|
* |
|
|
|
@ -2605,6 +2604,13 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
if (CollectionUtils.isEmpty(statementVOS)) { |
|
|
|
if (CollectionUtils.isEmpty(statementVOS)) { |
|
|
|
return R.fail("没有需要结算的记录"); |
|
|
|
return R.fail("没有需要结算的记录"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for(StatementVO vo : statementVOS){ |
|
|
|
|
|
|
|
if(StringUtils.isEmpty(vo.getPlateThickness())){ |
|
|
|
|
|
|
|
String thickness = this.getThicknessByMjMes(vo.getPartCode(), vo.getPlateThickness(), vo.getPlateCode(), vo.getProductIdent()); |
|
|
|
|
|
|
|
vo.setRosThickness(thickness); |
|
|
|
|
|
|
|
vo.setPlateThickness(thickness); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 处理重复镀后入库
|
|
|
|
// 处理重复镀后入库
|
|
|
|
statementVOS = duplicatePutStore(statementVOS, saves); |
|
|
|
statementVOS = duplicatePutStore(statementVOS, saves); |
|
|
|
// 处理不结算数据
|
|
|
|
// 处理不结算数据
|
|
|
|
@ -2625,4 +2631,57 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
return R.status(this.saveOrUpdateBatch(saves)); |
|
|
|
return R.status(this.saveOrUpdateBatch(saves)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String getThicknessByMjMes(String partCode, String plateThickness, String plateCode, String prodIdent) { |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(plateThickness)) { |
|
|
|
|
|
|
|
return plateThickness; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
boolean special = false; |
|
|
|
|
|
|
|
// 2025-07-23 线上迁移修改
|
|
|
|
|
|
|
|
if ("4.1.2.1".equals(plateCode) || "4.1.2.2".equals(plateCode) || "4.1.2.5".equals(plateCode) || "4.1.2.13".equals(plateCode) |
|
|
|
|
|
|
|
|| "4.1.2.7".equals(plateCode) || "4.1.2.11".equals(plateCode) || "4.1.2.12".equals(plateCode) || "4.1.2.15".equals(plateCode) |
|
|
|
|
|
|
|
|| "4.1.2.16".equals(plateCode) || "4.1.2.17".equals(plateCode)) { |
|
|
|
|
|
|
|
//镀层质量等级标识
|
|
|
|
|
|
|
|
List<Map<String, Object>> bc = baseMapper.getBusConfigByMjMes("BC_TYPE_PROD_IDENT", "镀层质量等级标识"); |
|
|
|
|
|
|
|
String[] identList = new String[]{"JII", "JI", "JHT", "JIIR", "JIR", "JZ","JIX"}; |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(bc)) { |
|
|
|
|
|
|
|
if(bc.get(0).get("bc_value") != null){ |
|
|
|
|
|
|
|
String bcValue = (String) bc.get(0).get("bc_value"); |
|
|
|
|
|
|
|
identList = bcValue.split("/"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//镀层零件标识
|
|
|
|
|
|
|
|
bc = baseMapper.getBusConfigByMjMes("PLATE_PART", "镀层零件标识"); |
|
|
|
|
|
|
|
String[] partList = new String[]{"21E8-210"}; |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(bc)) { |
|
|
|
|
|
|
|
if(bc.get(0).get("bc_value") != null) { |
|
|
|
|
|
|
|
String bcValue = (String) bc.get(0).get("bc_value"); |
|
|
|
|
|
|
|
partList = bcValue.split("/"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
special = Stream.of(identList).anyMatch(item -> prodIdent.equals(item)); |
|
|
|
|
|
|
|
if (special) { |
|
|
|
|
|
|
|
special = Stream.of(partList).anyMatch(item -> partCode.contains(item)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if ("4.1.2.6".equals(plateCode)) { |
|
|
|
|
|
|
|
//镀层质量等级标识
|
|
|
|
|
|
|
|
String[] identList = new String[]{"JI", "JIR", "JHT", "JZ","J","JIX"}; |
|
|
|
|
|
|
|
//镀层零件标识
|
|
|
|
|
|
|
|
String[] partList = new String[]{"21E8-210"}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
special = Stream.of(identList).anyMatch(item -> prodIdent.equals(item)); |
|
|
|
|
|
|
|
if (special) { |
|
|
|
|
|
|
|
special = Stream.of(partList).anyMatch(item -> partCode.contains(item)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<Map<String, Object>> thicknessList = baseMapper.getThicknessByMjMes(plateCode, prodIdent, special); |
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(thicknessList)) { |
|
|
|
|
|
|
|
if(thicknessList.get(0).get("thickness") != null){ |
|
|
|
|
|
|
|
String thickness = (String) thicknessList.get(0).get("thickness"); |
|
|
|
|
|
|
|
return thickness; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|