|
|
|
@ -13,6 +13,7 @@ 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 com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
@ -57,6 +58,7 @@ import java.util.stream.Collectors; |
|
|
|
* @author qyl |
|
|
|
* @author qyl |
|
|
|
* @since 2026-02-12 |
|
|
|
* @since 2026-02-12 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, OemStatementEntity> implements IOemStatementService { |
|
|
|
public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, OemStatementEntity> implements IOemStatementService { |
|
|
|
|
|
|
|
|
|
|
|
@ -2081,4 +2083,57 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public R updateOrderDataError() { |
|
|
|
|
|
|
|
// 询所有【结算异常】状态且异常原因包含"订单数据错误"的数据
|
|
|
|
|
|
|
|
List<StatementVO> errorStatements = baseMapper.selectOrderDataErrorStatements(); |
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(errorStatements)) { |
|
|
|
|
|
|
|
return R.success("没有需要更新的订单数据错误记录"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 更新数据
|
|
|
|
|
|
|
|
List<OemStatementEntity> updateList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (StatementVO vo : errorStatements) { |
|
|
|
|
|
|
|
OemStatementEntity entity = new OemStatementEntity(); |
|
|
|
|
|
|
|
entity.setId(vo.getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据生产订单(MES_YIELD_ORDER)更新字段
|
|
|
|
|
|
|
|
// 镀种
|
|
|
|
|
|
|
|
entity.setPlate(vo.getPlate()); |
|
|
|
|
|
|
|
// 镀层厚度1
|
|
|
|
|
|
|
|
entity.setRosThickness(new BigDecimal(vo.getPlateThickness() != null ? vo.getPlateThickness() : "0")); |
|
|
|
|
|
|
|
// 单件面积
|
|
|
|
|
|
|
|
entity.setYpArea(vo.getYpArea() != null ? vo.getYpArea() : BigDecimal.ZERO); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 计算总面积 = 单件面积 * 结算数量
|
|
|
|
|
|
|
|
BigDecimal ypArea = vo.getYpArea() != null ? vo.getYpArea() : BigDecimal.ZERO; |
|
|
|
|
|
|
|
BigDecimal makeQty = vo.getMakeQty() != null ? vo.getMakeQty() : BigDecimal.ZERO; |
|
|
|
|
|
|
|
BigDecimal totalArea = ypArea.multiply(makeQty); |
|
|
|
|
|
|
|
// 总面积
|
|
|
|
|
|
|
|
entity.setTotalArea(totalArea); |
|
|
|
|
|
|
|
// 涂色标个数
|
|
|
|
|
|
|
|
entity.setTsbNum(vo.getTsbNum()); |
|
|
|
|
|
|
|
// 涂色带个数
|
|
|
|
|
|
|
|
entity.setTsdNum(vo.getTsdNum()); |
|
|
|
|
|
|
|
// 涂箭个数
|
|
|
|
|
|
|
|
entity.setTjtNum(vo.getTjtNum()); |
|
|
|
|
|
|
|
// 结算数量
|
|
|
|
|
|
|
|
entity.setMakeQty(makeQty); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据车间订单(MES_WORK_ORDER通过MES_WORK_PLAN关联)更新厂家
|
|
|
|
|
|
|
|
// 外协厂家ID
|
|
|
|
|
|
|
|
entity.setOcId(vo.getOcId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity.setUpdateTime(new Date()); |
|
|
|
|
|
|
|
updateList.add(entity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(updateList)) { |
|
|
|
|
|
|
|
this.updateBatchById(updateList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|