|
|
@ -7,6 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.as.api.asappendix.AsAppendix; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.*; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.app.GoodsReceiveListVo; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.app.GoodsReceiveQuery; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.app.GoodsReceiveSubmit; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbill.app.GoodsReceiveVo; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbillaitem.AsBusrepairBillAitem; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbillinsurance.AsBusrepairBillInsurance; |
|
|
|
import com.yxt.anrui.as.api.asbusrepairbillinsurancerecord.AsBusrepairBillInsuranceRecord; |
|
|
@ -26,6 +30,7 @@ import com.yxt.anrui.as.api.utils.AsRule; |
|
|
|
import com.yxt.anrui.as.api.utils.FileUrlQuery; |
|
|
|
import com.yxt.anrui.as.api.utils.domain.AsBillNo; |
|
|
|
import com.yxt.anrui.as.biz.asappendix.AsAppendixService; |
|
|
|
import com.yxt.anrui.as.biz.asarrearsoutapply.AsArrearsoutApplyService; |
|
|
|
import com.yxt.anrui.as.biz.asbusclaimbill.AsBusclaimBillService; |
|
|
|
import com.yxt.anrui.as.biz.asbusrepairbillaitem.AsBusrepairBillAitemService; |
|
|
|
import com.yxt.anrui.as.biz.asbusrepairbillinsurance.AsBusrepairBillInsuranceRest; |
|
|
@ -77,6 +82,7 @@ import javax.annotation.Resource; |
|
|
|
import java.io.File; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.ZoneId; |
|
|
@ -139,7 +145,10 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
@Autowired |
|
|
|
private AsServiceItemService asServiceItemService; |
|
|
|
@Autowired |
|
|
|
private AsArrearsoutApplyService asArrearsoutApplyService; |
|
|
|
@Autowired |
|
|
|
private DocPdfComponent docPdfComponent; |
|
|
|
|
|
|
|
/** |
|
|
|
* 维修领料获取派工单 |
|
|
|
* |
|
|
@ -469,6 +478,27 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (null != asBusrepairBill.getNodeTime()) { |
|
|
|
vo.setNodeTime(sdf.format(asBusrepairBill.getNodeTime())); |
|
|
|
} |
|
|
|
CrmCustomerTemp customerTemp = crmCustomerTempFeign.fetchEntity(asBusrepairBill.getCustomerSid()).getData(); |
|
|
|
if (null != customerTemp) { |
|
|
|
if (StringUtils.isNotBlank(customerTemp.getSource())) { |
|
|
|
vo.setCustomerSource(customerTemp.getSource()); |
|
|
|
vo.setCustomerSource2(customerTemp.getSource()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(asBusrepairBill.getIsGoOut())) { |
|
|
|
if (asBusrepairBill.getIsGoOut().equals("1")) { |
|
|
|
vo.setIsGoOut2("是"); |
|
|
|
} else if (asBusrepairBill.getIsGoOut().equals("2")) { |
|
|
|
vo.setIsGoOut2("否"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (null != asBusrepairBill.getIsSpecialSign()) { |
|
|
|
if (asBusrepairBill.getIsSpecialSign().intValue() == 1) { |
|
|
|
vo.setIsSpecialSign2("有"); |
|
|
|
} else if (asBusrepairBill.getIsSpecialSign().intValue() == 0) { |
|
|
|
vo.setIsSpecialSign2("无"); |
|
|
|
} |
|
|
|
} |
|
|
|
AsBusrepairBillVech vech = asBusrepairBillVechService.fetchByBillSid(sid); |
|
|
|
if (null != vech) { |
|
|
|
if (StringUtils.isNotBlank(vech.getVehMark())) { |
|
|
@ -513,12 +543,29 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (null != invoice.getTaxRate()) { |
|
|
|
taxRate = invoice.getTaxRate(); |
|
|
|
} |
|
|
|
invoiceVo.setTaxItems2(invoice.getTaxItems()); |
|
|
|
} else { |
|
|
|
invoiceVo.setTaxItems(new ArrayList<>()); |
|
|
|
} |
|
|
|
if (null != invoice.getIsInvoicing()) { |
|
|
|
if (invoice.getIsInvoicing().intValue() == 1) { |
|
|
|
invoiceVo.setIsInvoicing2("是"); |
|
|
|
} else if (invoice.getIsInvoicing().intValue() == 0) { |
|
|
|
invoiceVo.setIsInvoicing2("否"); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setInvoiceVo(invoiceVo); |
|
|
|
} |
|
|
|
AsBusrepairBillInsurance insurance = asBusrepairBillInsuranceService.fetchByBillSid(sid); |
|
|
|
if (null != insurance) { |
|
|
|
BeanUtil.copyProperties(insurance, insuranceVo); |
|
|
|
if (StringUtils.isNotBlank(insurance.getIsPersonInjuries())) { |
|
|
|
if (insurance.getIsPersonInjuries().equals("1")) { |
|
|
|
insuranceVo.setIsPersonInjuries2("是"); |
|
|
|
} else if (insurance.getIsPersonInjuries().equals("0")) { |
|
|
|
insuranceVo.setIsPersonInjuries2("否"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
List<AsBusrepairBillInsuranceRecord> insuranceRecord = asBusrepairBillInsuranceRecordService.fetchByBillSid(sid); |
|
|
|
if (!insuranceRecord.isEmpty()) { |
|
|
@ -540,6 +587,19 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
for (AsBusrepairBillSitem sitem : sitems) { |
|
|
|
SitemVo sitemVo = new SitemVo(); |
|
|
|
BeanUtil.copyProperties(sitem, sitemVo); |
|
|
|
String price = ""; |
|
|
|
String hours = ""; |
|
|
|
String ticheng = ""; |
|
|
|
if (null != sitem.getHourPrice()) { |
|
|
|
price = sitem.getHourPrice().toString(); |
|
|
|
} |
|
|
|
if (null != sitem.getHours()) { |
|
|
|
hours = String.valueOf(sitem.getHours().intValue()); |
|
|
|
} |
|
|
|
if (null != sitem.getExamineHourPrice()) { |
|
|
|
ticheng = sitem.getExamineHourPrice().toString(); |
|
|
|
} |
|
|
|
sitemVo.setManHourInfo("单价-" + price + ",工时数-" + hours + "小时,提成-" + ticheng); |
|
|
|
List<AsBusrepairBillSitemRepairer> repairers = asBusrepairBillSitemRepairerService.fetchByBillSid(sid, sitem.getServiceItemSid()); |
|
|
|
if (!repairers.isEmpty()) { |
|
|
|
List<String> staffList = new ArrayList<>(); //维修人员信息
|
|
|
@ -554,6 +614,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
} |
|
|
|
sitemVo.setStaffList(staffList); |
|
|
|
sitemVo.setStaffNameList(staffNameList); |
|
|
|
sitemVo.setStaffNames(String.join("、", staffNameList)); |
|
|
|
} |
|
|
|
sitemVos.add(sitemVo); |
|
|
|
} |
|
|
@ -580,12 +641,16 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
vo.setAitemVos(aitemVos); |
|
|
|
} |
|
|
|
List<AsBusrepairInventorybillDetail> goodsDetails = asBusrepairInventorybillDetailService.getGoodsDetailsByBillSid(sid); |
|
|
|
DecimalFormat df2 =new DecimalFormat("#.00"); |
|
|
|
if (!goodsDetails.isEmpty()) { |
|
|
|
for (AsBusrepairInventorybillDetail goodsDetail : goodsDetails) { |
|
|
|
GoodsDetailsVo goodsDetailsVo = new GoodsDetailsVo(); |
|
|
|
BeanUtil.copyProperties(goodsDetail, goodsDetailsVo); |
|
|
|
BigDecimal constPrice = BigDecimal.ZERO; //销售价常量
|
|
|
|
boolean isTaxRate = false; //进货价是否含税
|
|
|
|
if (null != goodsDetail.getReceivedTime()) { |
|
|
|
goodsDetailsVo.setReceivedTime(sdf.format(goodsDetail.getReceivedTime())); |
|
|
|
} |
|
|
|
SmsGoods smsGoods = smsGoodsFeign.fetchEntityByGoodsID(goodsDetail.getGoodsID()).getData(); |
|
|
|
if (null != smsGoods) { |
|
|
|
if (StringUtils.isNotBlank(smsGoods.getSupplierName())) { |
|
|
@ -600,12 +665,17 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
String[] strings = partsSellersSid.split(","); |
|
|
|
List<String> list = Arrays.asList(strings); |
|
|
|
goodsDetailsVo.setPartsSellersSids(list); |
|
|
|
} else { |
|
|
|
goodsDetailsVo.setPartsSellersSids(new ArrayList<>()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(goodsDetail.getPartsSellers())) { |
|
|
|
String partsSellers = goodsDetail.getPartsSellers(); |
|
|
|
String[] strings = partsSellers.split(","); |
|
|
|
List<String> list = Arrays.asList(strings); |
|
|
|
goodsDetailsVo.setPartsSellers(list); |
|
|
|
goodsDetailsVo.setPartsSellers2(goodsDetail.getPartsSellers()); |
|
|
|
} else { |
|
|
|
goodsDetailsVo.setPartsSellers(new ArrayList<>()); |
|
|
|
} |
|
|
|
if (goodsDetail.getIsTaxRate() != null) { |
|
|
|
if (goodsDetail.getIsTaxRate().intValue() == 1) { |
|
|
@ -616,7 +686,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
BigDecimal divide = taxRate.divide(new BigDecimal("100")); |
|
|
|
BigDecimal add = divide.add(new BigDecimal("1")); |
|
|
|
BigDecimal multiply = constPrice.multiply(add); |
|
|
|
goodsDetailsVo.setPrice(multiply.toString()); |
|
|
|
goodsDetailsVo.setPrice(df2.format(multiply)); |
|
|
|
} else { |
|
|
|
goodsDetailsVo.setPrice(constPrice.toString()); |
|
|
|
} |
|
|
@ -626,7 +696,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
BigDecimal divide = taxRate.divide(new BigDecimal("100")); |
|
|
|
BigDecimal add = divide.add(new BigDecimal("1")); |
|
|
|
BigDecimal multiply = constPrice.multiply(add); |
|
|
|
goodsDetailsVo.setPrice(multiply.toString()); |
|
|
|
goodsDetailsVo.setPrice(df2.format(multiply)); |
|
|
|
} else { |
|
|
|
goodsDetailsVo.setPrice(constPrice.toString()); |
|
|
|
} |
|
|
@ -647,6 +717,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
vo.setSettleVo(settleVo); |
|
|
|
} |
|
|
|
List<FileUrlQuery> file = new ArrayList<>(); |
|
|
|
List<String> file2 = new ArrayList<>(); |
|
|
|
List<AsAppendix> asAppendices = asAppendixService.fetchByLinkSid(sid); |
|
|
|
if (!asAppendices.isEmpty()) { |
|
|
|
for (AsAppendix asAppendix : asAppendices) { |
|
|
@ -657,9 +728,12 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
String fileType = asAppendix.getFileType(); |
|
|
|
fileUrlQuery.setName(fileName + "." + fileType); |
|
|
|
file.add(fileUrlQuery); |
|
|
|
file2.add(url); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setFileName(file); |
|
|
|
vo.setFiles(file2); |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
@ -791,6 +865,256 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<AsBusrepairBillVo> listPageCC(PagerQuery<AsBusrepairBillQuery> pagerQuery) { |
|
|
|
AsBusrepairBillQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<AsBusrepairBill> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("b.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<AsBusrepairBillVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<AsBusrepairBillVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
String deptSid = ""; |
|
|
|
String orgPath = query.getOrgPath(); |
|
|
|
if (StringUtils.isNotBlank(orgPath)) { |
|
|
|
List<String> split = Arrays.asList(orgPath.split("/")); |
|
|
|
if (split.size() > 1) { |
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|
|
|
deptSid = sysOrganization1.getSid(); |
|
|
|
} else { |
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|
|
|
deptSid = sysOrganization.getSid(); |
|
|
|
} |
|
|
|
} |
|
|
|
qw.eq("b.deptSid", deptSid); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getUseOrgName())) { |
|
|
|
qw.like("b.useOrgName", query.getUseOrgName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getDept())) { |
|
|
|
qw.like("b.deptName", query.getDept()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.like("b.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillNo())) { |
|
|
|
qw.like("b.billNo", query.getBillNo()); |
|
|
|
} |
|
|
|
String startDate = query.getStartTime(); |
|
|
|
String endDate = query.getEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(startDate), "date_format (b.createTime,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(endDate), "date_format (b.createTime,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
if (StringUtils.isNotBlank(query.getBillType())) { |
|
|
|
qw.eq("b.billType", query.getBillType()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getSubject())) { |
|
|
|
qw.like("b.`subject`", query.getSubject()); |
|
|
|
} |
|
|
|
String entryStartTime = query.getEntryStartTime(); |
|
|
|
String entryEndTime = query.getEntryEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(entryStartTime), "date_format (b.entryTime,'%Y-%m-%d') >= date_format('" + entryStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(entryEndTime), "date_format (b.entryTime,'%Y-%m-%d') <= date_format('" + entryEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
String finishStartTime = query.getFinishStartTime(); |
|
|
|
String finishEndTime = query.getFinishEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(finishStartTime), "date_format (b.estimatedFinishTime,'%Y-%m-%d') >= date_format('" + finishStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(finishEndTime), "date_format (b.estimatedFinishTime,'%Y-%m-%d') <= date_format('" + finishEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("b.customerName", query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getMobile())) { |
|
|
|
qw.like("b.mobile", query.getMobile()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerOrg())) { |
|
|
|
qw.like("b.customerOrg", query.getCustomerOrg()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVehMark())) { |
|
|
|
qw.like("v.vehMark", query.getVehMark()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
qw.like("v.vinNo", query.getVinNo()); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getWaitorName())) { |
|
|
|
qw.like("b.waitorName", query.getWaitorName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getGroupName())) { |
|
|
|
qw.like("b.groupName", query.getGroupName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getMainRepairers())) { |
|
|
|
qw.like("b.mainRepairers", query.getMainRepairers()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getIsInvoicing())) { |
|
|
|
qw.eq("i.isInvoicing", query.getIsInvoicing()); |
|
|
|
} |
|
|
|
qw.eq("b.outDoorState",2); |
|
|
|
qw.orderByDesc("b.createTime"); |
|
|
|
IPage<AsBusrepairBill> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<AsBusrepairBillVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
PagerVo<AsBusrepairBillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<AsBusrepairBillVo> listPageConfirm(PagerQuery<AsBusrepairBillQuery> pagerQuery) { |
|
|
|
AsBusrepairBillQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<AsBusrepairBill> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
|
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(query.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = query.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
int i1 = orgSidPath.indexOf("/"); |
|
|
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
|
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
|
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
|
|
String orgLevelKey = defaultIdReltBean.getData(); |
|
|
|
if ("1".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i1); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("s.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("b.createBySid", query.getUserSid()); |
|
|
|
} else { |
|
|
|
PagerVo<AsBusrepairBillVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
PagerVo<AsBusrepairBillVo> p = new PagerVo<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
String deptSid = ""; |
|
|
|
String orgPath = query.getOrgPath(); |
|
|
|
if (StringUtils.isNotBlank(orgPath)) { |
|
|
|
List<String> split = Arrays.asList(orgPath.split("/")); |
|
|
|
if (split.size() > 1) { |
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|
|
|
deptSid = sysOrganization1.getSid(); |
|
|
|
} else { |
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|
|
|
deptSid = sysOrganization.getSid(); |
|
|
|
} |
|
|
|
} |
|
|
|
qw.eq("b.deptSid", deptSid); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getUseOrgName())) { |
|
|
|
qw.like("b.useOrgName", query.getUseOrgName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getDept())) { |
|
|
|
qw.like("b.deptName", query.getDept()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.like("b.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillNo())) { |
|
|
|
qw.like("b.billNo", query.getBillNo()); |
|
|
|
} |
|
|
|
String startDate = query.getStartTime(); |
|
|
|
String endDate = query.getEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(startDate), "date_format (b.createTime,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(endDate), "date_format (b.createTime,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
if (StringUtils.isNotBlank(query.getBillType())) { |
|
|
|
qw.eq("b.billType", query.getBillType()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getSubject())) { |
|
|
|
qw.like("b.`subject`", query.getSubject()); |
|
|
|
} |
|
|
|
String entryStartTime = query.getEntryStartTime(); |
|
|
|
String entryEndTime = query.getEntryEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(entryStartTime), "date_format (b.entryTime,'%Y-%m-%d') >= date_format('" + entryStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(entryEndTime), "date_format (b.entryTime,'%Y-%m-%d') <= date_format('" + entryEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
String finishStartTime = query.getFinishStartTime(); |
|
|
|
String finishEndTime = query.getFinishEndTime(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(finishStartTime), "date_format (b.estimatedFinishTime,'%Y-%m-%d') >= date_format('" + finishStartTime + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(finishEndTime), "date_format (b.estimatedFinishTime,'%Y-%m-%d') <= date_format('" + finishEndTime + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("b.customerName", query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getMobile())) { |
|
|
|
qw.like("b.mobile", query.getMobile()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerOrg())) { |
|
|
|
qw.like("b.customerOrg", query.getCustomerOrg()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVehMark())) { |
|
|
|
qw.like("v.vehMark", query.getVehMark()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
qw.like("v.vinNo", query.getVinNo()); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getWaitorName())) { |
|
|
|
qw.like("b.waitorName", query.getWaitorName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getGroupName())) { |
|
|
|
qw.like("b.groupName", query.getGroupName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getMainRepairers())) { |
|
|
|
qw.like("b.mainRepairers", query.getMainRepairers()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getIsInvoicing())) { |
|
|
|
qw.eq("i.isInvoicing", query.getIsInvoicing()); |
|
|
|
} |
|
|
|
qw.eq("b.outDoorState",2); |
|
|
|
qw.orderByDesc("b.createTime"); |
|
|
|
IPage<AsBusrepairBill> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<AsBusrepairBillVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
PagerVo<AsBusrepairBillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<String> submitNextNode(AsBusrepairBillDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isNotBlank(dto.getSid())) { |
|
|
@ -1455,13 +1779,13 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
if (price0) { |
|
|
|
dataMap.put("caps1", ""); |
|
|
|
dataMap.put("sumMoney1", "0"); |
|
|
|
dataMap.put("caps2",""); |
|
|
|
dataMap.put("caps2", ""); |
|
|
|
dataMap.put("sumMoney2", "0"); |
|
|
|
dataMap.put("outAmount","0"); |
|
|
|
dataMap.put("subsidyAmount","0"); |
|
|
|
dataMap.put("rescueAmount","0"); |
|
|
|
dataMap.put("receivableAmount","0"); |
|
|
|
dataMap.put("actualAmount","0"); |
|
|
|
dataMap.put("outAmount", "0"); |
|
|
|
dataMap.put("subsidyAmount", "0"); |
|
|
|
dataMap.put("rescueAmount", "0"); |
|
|
|
dataMap.put("receivableAmount", "0"); |
|
|
|
dataMap.put("actualAmount", "0"); |
|
|
|
} else { |
|
|
|
dataMap.put("caps1", vo.getCaps1()); |
|
|
|
dataMap.put("sumMoney1", vo.getSumMoney1()); |
|
|
@ -1473,7 +1797,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
dataMap.put("receivableAmount", vo.getReceivableAmount()); |
|
|
|
dataMap.put("actualAmount", vo.getActualAmount()); |
|
|
|
} |
|
|
|
dataMap.put("userName", vo.getCompany()); |
|
|
|
dataMap.put("userName", vo.getUserName()); |
|
|
|
List<SettleItemPdfVo> items = vo.getItems(); |
|
|
|
if (!items.isEmpty()) { |
|
|
|
for (SettleItemPdfVo itemPdfVo : items) { |
|
|
@ -1485,7 +1809,7 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
map.put("hourPrice", itemPdfVo.getHourPrice()); |
|
|
|
map.put("hours", itemPdfVo.getHours()); |
|
|
|
if (price0) { |
|
|
|
map.put("price","0"); |
|
|
|
map.put("price", "0"); |
|
|
|
} else { |
|
|
|
map.put("price", itemPdfVo.getPrice()); |
|
|
|
} |
|
|
@ -1509,8 +1833,8 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
map.put("unit", good.getUnit()); |
|
|
|
map.put("count", good.getCount()); |
|
|
|
if (price0) { |
|
|
|
map.put("price","0"); |
|
|
|
map.put("amount","0"); |
|
|
|
map.put("price", "0"); |
|
|
|
map.put("amount", "0"); |
|
|
|
} else { |
|
|
|
map.put("price", good.getPrice()); |
|
|
|
map.put("amount", good.getAmount()); |
|
|
@ -1593,4 +1917,51 @@ public class AsBusrepairBillService extends MybatisBaseService<AsBusrepairBillMa |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void updateOutFactory(String sid) { |
|
|
|
baseMapper.updateOutFactory(sid); |
|
|
|
} |
|
|
|
public PagerVo<GoodsReceiveVo> notConfirmList(PagerQuery<GoodsReceiveQuery> pagerQuery) { |
|
|
|
GoodsReceiveQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<AsBusrepairBill> qw = new QueryWrapper<>(); |
|
|
|
if (query != null) { |
|
|
|
//工单编号
|
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { |
|
|
|
qw.eq("d.operUserSid", query.getUserSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.and(wrapper -> wrapper.like("b.billNo", query.getName()) |
|
|
|
.or().like("b.customerName", query.getName()) |
|
|
|
.or().like("v.vehMark", query.getName()) |
|
|
|
); |
|
|
|
} |
|
|
|
qw.eq("d.state", 1); |
|
|
|
} |
|
|
|
IPage<AsBusrepairBill> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<GoodsReceiveVo> pagging = baseMapper.notConfirmList(page, qw); |
|
|
|
List<GoodsReceiveVo> records = pagging.getRecords(); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (GoodsReceiveVo record : records) { |
|
|
|
List<GoodsReceiveListVo> list = baseMapper.selGoodsReceiveByBillSid(record.getSid()); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
record.setList(list); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<GoodsReceiveVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public void submitList(GoodsReceiveSubmit query) { |
|
|
|
List<String> list = query.getList(); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
for (String s : list) { |
|
|
|
AsBusrepairInventorybillDetail detail = asBusrepairInventorybillDetailService.fetchBySid(s); |
|
|
|
if (null != detail) { |
|
|
|
detail.setReceivedTime(new Date()); |
|
|
|
detail.setState(2); |
|
|
|
asBusrepairInventorybillDetailService.updateById(detail); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|