|
|
@ -265,13 +265,18 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
BeanUtil.copyProperties(sitemVo, sitem, "id", "sid"); |
|
|
|
sitem.setBillSid(sid); |
|
|
|
asBusrepairBillSitemService.insert(sitem); |
|
|
|
AsBusrepairBillSitemRepairer repairer = new AsBusrepairBillSitemRepairer(); |
|
|
|
BeanUtil.copyProperties(sitemVo, repairer, "id", "sid"); |
|
|
|
repairer.setBillSid(sid); |
|
|
|
if (StringUtils.isNotBlank(sitemVo.getServiceItemSid())) { |
|
|
|
repairer.setRepairitemSid(sitemVo.getServiceItemSid()); |
|
|
|
List<ReparirerStaffVo> staffList = sitemVo.getStaffList(); |
|
|
|
if (!staffList.isEmpty()) { |
|
|
|
for (ReparirerStaffVo staffVo : staffList) { |
|
|
|
AsBusrepairBillSitemRepairer repairer = new AsBusrepairBillSitemRepairer(); |
|
|
|
BeanUtil.copyProperties(staffVo, repairer, "id", "sid"); |
|
|
|
repairer.setBillSid(sid); |
|
|
|
if (StringUtils.isNotBlank(sitemVo.getServiceItemSid())) { |
|
|
|
repairer.setRepairitemSid(sitemVo.getServiceItemSid()); |
|
|
|
} |
|
|
|
asBusrepairBillSitemRepairerService.insert(repairer); |
|
|
|
} |
|
|
|
} |
|
|
|
asBusrepairBillSitemRepairerService.insert(repairer); |
|
|
|
} |
|
|
|
} |
|
|
|
//附加项目
|
|
|
@ -288,10 +293,36 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (StringUtils.isNotBlank(aitemVo.getPrice())) { |
|
|
|
aitem.setPrice(new BigDecimal(aitemVo.getPrice())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(aitemVo.getRemarks())) { |
|
|
|
aitem.setRemarks(aitemVo.getRemarks()); |
|
|
|
} |
|
|
|
aitem.setBillSid(sid); |
|
|
|
asBusrepairBillAitemService.insert(aitem); |
|
|
|
} |
|
|
|
} |
|
|
|
//商品信息
|
|
|
|
if (!dto.getGoodsDetailsVos().isEmpty() && dto.getGoodsDetailsVos().size() > 0) { |
|
|
|
List<GoodsDetailsVo> goodsDetailsVos = dto.getGoodsDetailsVos(); |
|
|
|
for (GoodsDetailsVo goodsVo : goodsDetailsVos) { |
|
|
|
AsBusrepairInventorybillDetail goods = asBusrepairInventorybillDetailService.fetchBySid(goodsVo.getSid()); |
|
|
|
if (StringUtils.isNotBlank(goodsVo.getPrice())) { |
|
|
|
goods.setPrice(new BigDecimal(goodsVo.getPrice())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(goodsVo.getDiscount())) { |
|
|
|
goods.setDiscount(new Integer(goodsVo.getDiscount())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(goodsVo.getDiscountAmount())) { |
|
|
|
goods.setDiscountAmount(new BigDecimal(goodsVo.getDiscountAmount())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(goodsVo.getAmount())) { |
|
|
|
goods.setAmount(new BigDecimal(goodsVo.getAmount())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(goodsVo.getRemarks())) { |
|
|
|
goods.setRemarks(goodsVo.getRemarks()); |
|
|
|
} |
|
|
|
asBusrepairInventorybillDetailService.updateById(goods); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(sid); |
|
|
|
} |
|
|
@ -383,9 +414,15 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
for (AsBusrepairBillSitem sitem : sitems) { |
|
|
|
SitemVo sitemVo = new SitemVo(); |
|
|
|
BeanUtil.copyProperties(sitem, sitemVo); |
|
|
|
AsBusrepairBillSitemRepairer repairer = asBusrepairBillSitemRepairerService.fetchByBillSid(sid, sitem.getServiceItemSid()); |
|
|
|
if (null != repairer) { |
|
|
|
BeanUtil.copyProperties(repairer, sitemVo); |
|
|
|
List<AsBusrepairBillSitemRepairer> repairers = asBusrepairBillSitemRepairerService.fetchByBillSid(sid, sitem.getServiceItemSid()); |
|
|
|
if (!repairers.isEmpty()) { |
|
|
|
List<ReparirerStaffVo> staffList = new ArrayList<>(); //维修人员信息
|
|
|
|
for (AsBusrepairBillSitemRepairer repairer : repairers) { |
|
|
|
ReparirerStaffVo staffVo = new ReparirerStaffVo(); |
|
|
|
BeanUtil.copyProperties(repairer, staffVo); |
|
|
|
staffList.add(staffVo); |
|
|
|
} |
|
|
|
sitemVo.setStaffList(staffList); |
|
|
|
} |
|
|
|
sitemVos.add(sitemVo); |
|
|
|
} |
|
|
@ -408,7 +445,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
} |
|
|
|
vo.setAitemVos(aitemVos); |
|
|
|
} |
|
|
|
List<AsBusrepairInventorybillDetail> goodsDetails = asBusrepairInventorybillDetailService.getDetailsByBillSid(sid); |
|
|
|
List<AsBusrepairInventorybillDetail> goodsDetails = asBusrepairInventorybillDetailService.getDetailsByBillSid(sid, "0"); |
|
|
|
if (!goodsDetails.isEmpty()) { |
|
|
|
for (AsBusrepairInventorybillDetail goodsDetail : goodsDetails) { |
|
|
|
GoodsDetailsVo goodsDetailsVo = new GoodsDetailsVo(); |
|
|
|