|
@@ -8,6 +8,8 @@ import com.rongwei.bscommon.sys.dao.ApsProductDetailDao;
|
|
|
import com.rongwei.bscommon.sys.service.*;
|
|
|
import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.vo.ApsProcessOutputProductAndBlankStatusVo;
|
|
|
+import com.rongwei.bsentity.vo.GetOldTechnicalRequirementReq;
|
|
|
+import com.rongwei.bsentity.vo.GetOldTechnicalRequirementRes;
|
|
|
import com.rongwei.bsentity.vo.UpdateProductDetailsAndBlankOutputReq;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
@@ -605,4 +607,49 @@ public class ApsProductDetailServiceImpl extends ServiceImpl<ApsProductDetailDao
|
|
|
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R getOldTechnicalRequirement(GetOldTechnicalRequirementReq req) {
|
|
|
+ String technicalRequirementId = req.getTechnicalRequirementId();
|
|
|
+ if (ObjectUtil.isEmpty(technicalRequirementId)) {
|
|
|
+ return R.error("当前技术要求ID不能为空");
|
|
|
+ }
|
|
|
+ String orderProductTypeId = req.getOrderProductTypeId();
|
|
|
+ if (ObjectUtil.isEmpty(orderProductTypeId)) {
|
|
|
+ return R.error("当前技术要求的订单产品类型ID不能为空");
|
|
|
+ }
|
|
|
+ ApsProductDetailDo orderDetail = req.getOrderDetail();
|
|
|
+ if (ObjectUtil.isEmpty(orderDetail)) {
|
|
|
+ return R.error("产品明细不能为空");
|
|
|
+ }
|
|
|
+ String alloy = orderDetail.getAlloy();
|
|
|
+ String alloystatus = orderDetail.getAlloystatus();
|
|
|
+
|
|
|
+ List<GetOldTechnicalRequirementRes> apsProductDetailDoList = this.baseMapper.selectMyList(technicalRequirementId, orderDetail.getId(), alloy, alloystatus, orderProductTypeId);
|
|
|
+
|
|
|
+ List<GetOldTechnicalRequirementRes> list = new LinkedList<>();
|
|
|
+ for (GetOldTechnicalRequirementRes vo : apsProductDetailDoList) {
|
|
|
+ int score = 0;
|
|
|
+ if (vo.getAlloy().equals(alloy)) {
|
|
|
+ score += 10;
|
|
|
+ }
|
|
|
+ if (vo.getAlloystatus().equals(alloystatus)) {
|
|
|
+ score += 1;
|
|
|
+ }
|
|
|
+ if (vo.getOrderproducttypeid().equals(orderProductTypeId)) {
|
|
|
+ score += 100;
|
|
|
+ }
|
|
|
+ vo.setScore(score);
|
|
|
+ list.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ list.sort((a, b) -> (b.getScore() - a.getScore()));
|
|
|
+ GetOldTechnicalRequirementRes res = null;
|
|
|
+ if (ObjectUtil.isNotEmpty(list)) {
|
|
|
+ res = list.get(0);
|
|
|
+ }
|
|
|
+ return R.ok(res);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|