|
|
@ -18,6 +18,7 @@ import com.yxt.anrui.buscenter.biz.buscenterfile.BuscenterFileService; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdiscountpackagehandoverlist.BusDiscountpackageHandoverListService; |
|
|
|
import com.yxt.anrui.portal.api.sysrole.SysRoleFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysrole.SysRoleVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.common.base.config.component.DocPdfComponent; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
@ -34,6 +35,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import java.io.File; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
@ -58,6 +60,8 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
private DocPdfComponent docPdfComponent; |
|
|
|
@Autowired |
|
|
|
private CommonContractFeign commonContractFeign; |
|
|
|
@Autowired |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
|
|
|
|
/** |
|
|
|
* 筛选条件 |
|
|
@ -493,22 +497,23 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
|
|
|
|
private QueryWrapper<BusDiscountpackageHandover> appCreateQueryWrapper(AppBusDiscountpackageHandoverQuery query) { |
|
|
|
QueryWrapper<BusDiscountpackageHandover> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("useOrgSid", query.getOrgPath()); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
qw.eq("useOrgSid", useOrgSid); |
|
|
|
qw.eq("isDelete", 0); |
|
|
|
if (StringUtils.isNotBlank(query.getUserSid())) { |
|
|
|
qw.eq("recUserSid", query.getUserSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getType())) { |
|
|
|
if (query.getType().equals("3")) { |
|
|
|
qw.eq("state", query.getType()); |
|
|
|
} else { |
|
|
|
if (query.getType().equals("2")) { |
|
|
|
qw.eq("state", 3); |
|
|
|
} else if (query.getType().equals("1")) { |
|
|
|
qw.ne("state", 3); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getNames())) { |
|
|
|
qw.and(wrapper -> wrapper.like("contractNo", query.getNames()).or().like("customerName", query.getNames()) |
|
|
|
.or().like("recName",query.getNames())); |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.and(wrapper -> wrapper.like("contractNo", query.getName()).or().like("customerName", query.getName())); |
|
|
|
} |
|
|
|
qw.orderByDesc("createTime"); |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
@ -525,11 +530,10 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
IPage<BusDiscountpackageHandover> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<AppBusDiscountpackageHandoverVo> pagging = baseMapper.selectAppPageVo(page, qw); |
|
|
|
List<AppBusDiscountpackageHandoverVo> records = pagging.getRecords(); |
|
|
|
if (null != records) { |
|
|
|
if (null != records && records.size() > 0) { |
|
|
|
for (AppBusDiscountpackageHandoverVo record : records) { |
|
|
|
if (null != record) { |
|
|
|
if (StringUtils.isNotBlank(record.getContractId())) { |
|
|
|
|
|
|
|
CommonContract data = commonContractFeign.selectByNo(record.getContractId()).getData(); |
|
|
|
if (null != data) { |
|
|
|
if (StringUtils.isNotBlank(data.getBusSid())) { |
|
|
@ -537,13 +541,37 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (null != record.getType()) { |
|
|
|
if (record.getType() == 1 || record.getType() == 2) { |
|
|
|
record.setShowHandleBtn(true); |
|
|
|
} else if (record.getType() == 3) { |
|
|
|
record.setShowDownloadBtn(true); |
|
|
|
if (("待交接".equals(record.getNodeState()))) { |
|
|
|
record.setShowHandleBtn(true); |
|
|
|
} else { |
|
|
|
record.setShowHandleBtn(false); |
|
|
|
} |
|
|
|
if (("已交接".equals(record.getNodeState()))) { |
|
|
|
//查询有没有上传的图片
|
|
|
|
List<BuscenterFile> buscenterFiles = buscenterFileService.selectByLinkSid(record.getSid(), BuscenterFileEnum.DISCOUNTPACKAGE_HANDOVER.getAttachType()); |
|
|
|
if (buscenterFiles.size() > 0) { |
|
|
|
record.setShowUploadBtn(false); |
|
|
|
} else { |
|
|
|
record.setShowUploadBtn(true); |
|
|
|
} |
|
|
|
} |
|
|
|
record.setShowUploadBtn(false); |
|
|
|
} |
|
|
|
List<BusDiscountpackageHandoverList> listByMainSid = busDiscountpackageHandoverListService.findListByMainSid(record.getSid()); |
|
|
|
if (listByMainSid.size() > 0) { |
|
|
|
BigDecimal price = new BigDecimal(0); |
|
|
|
int discountNum = 0; |
|
|
|
for (BusDiscountpackageHandoverList handoverList : listByMainSid) { |
|
|
|
if (null != handoverList) { |
|
|
|
//优惠包数量
|
|
|
|
String number = handoverList.getNumber(); |
|
|
|
discountNum = discountNum + Integer.valueOf(number); |
|
|
|
BigDecimal totalPrice = handoverList.getTotalPrice(); |
|
|
|
price = price.add(totalPrice); |
|
|
|
} |
|
|
|
} |
|
|
|
record.setDiscountNum(String.valueOf(discountNum)); |
|
|
|
record.setPrice(String.valueOf(price)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|