|
|
@ -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(); |
|
|
@ -585,12 +622,32 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<AsBusrepairPageVo> pageBillList(PagerQuery<AsBusrepairPageQuery> pagerQuery) { |
|
|
|
|
|
|
|
return null; |
|
|
|
AsBusrepairPageQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<AsBusrepairBill> qw = new QueryWrapper<>(); |
|
|
|
//ToDo:添加查询条件
|
|
|
|
//维修工单编号
|
|
|
|
if (StringUtils.isNotBlank(query.getBillNo())) { |
|
|
|
qw.like("a.billNo", query.getBillNo()); |
|
|
|
} |
|
|
|
//单据日期开始时间-单据日期结束时间
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getCreateTimeStart()), "date_format (a.createTime,'%Y-%m-%d') >= date_format('" + query.getCreateTimeStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getCreateTimeEnd()), "date_format (a.createTime,'%Y-%m-%d') <= date_format('" + query.getCreateTimeEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//车牌号
|
|
|
|
if (StringUtils.isNotBlank(query.getVehMark())) { |
|
|
|
qw.like("b.vehMark", query.getVehMark()); |
|
|
|
} |
|
|
|
qw.eq("a.nodeCode", 3); |
|
|
|
IPage<AsBusrepairBill> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<AsBusrepairPageVo> pagging = baseMapper.pageBillList(page, qw); |
|
|
|
PagerVo<AsBusrepairPageVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<AsBusrepairPageVo> getOneByBillNo(String billNo) { |
|
|
|
return null; |
|
|
|
public ResultBean<AsBusrepairPageVo> getOneByBillNo(String sid) { |
|
|
|
ResultBean<AsBusrepairPageVo> rb = ResultBean.fireFail(); |
|
|
|
AsBusrepairPageVo asBusrepairPageVo = baseMapper.selectByBillNo(sid); |
|
|
|
return rb.success().setData(asBusrepairPageVo); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<String> sureMaterialFee(AsBusrepairBillDto dto) { |
|
|
|