修改返回字段
This commit is contained in:
parent
517bf8b0a1
commit
24cc037ec3
|
|
@ -118,7 +118,6 @@ public class CgdInfoEntity implements Serializable {
|
|||
private java.lang.String medicationName;
|
||||
|
||||
|
||||
|
||||
// 格式化getter方法
|
||||
public String getProcurementPrice() {
|
||||
return procurementPrice != null ?
|
||||
|
|
@ -129,4 +128,9 @@ public class CgdInfoEntity implements Serializable {
|
|||
return arrivalPrice != null ?
|
||||
arrivalPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString() : null;
|
||||
}
|
||||
|
||||
public String getTotalPrice() {
|
||||
return totalPrice != null ?
|
||||
totalPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString() : null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nu.modules.cgd.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -25,6 +26,7 @@ import com.nu.modules.nubaseinfo.entity.NuBaseInfo;
|
|||
import com.nu.modules.nubaseinfo.mapper.NuBaseInfoMapper;
|
||||
import com.nu.modules.qgd.entity.QgdInfo;
|
||||
import com.nu.modules.qgd.mapper.QgdInfoMapper;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.modules.warehouseMaterialInfo.entity.BlWarehouseMaterialInfo;
|
||||
import com.nu.modules.warehouseMaterialInfo.mapper.BlWarehouseMaterialInfoMapper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
|
@ -88,6 +90,11 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
@Autowired
|
||||
private NuInvoicingCgdSxdMapper sxdMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
private String serverNetUrl;
|
||||
|
||||
@Override
|
||||
public void rukuInfo(NuInvoicingCgdMain nuInvoicingCgdMain) {
|
||||
}
|
||||
|
|
@ -388,11 +395,49 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
// queryWrapper.eq(StringUtils.isNotBlank(typeId),"b.type_id",typeId);
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(medicationId),"b.medication_id",medicationId);
|
||||
List<NuInvoicingCgdInfo> list = cgdInfoMapper.queryCgdInfoList(page,queryWrapper);
|
||||
getOpeMediaAddress();
|
||||
for (NuInvoicingCgdInfo cgdInfo : list){
|
||||
BigDecimal arrivalPrice = cgdInfo.getArrivalPrice();
|
||||
BigDecimal procurementPrice = cgdInfo.getProcurementPrice();
|
||||
BigDecimal totalPrice = new BigDecimal("0");
|
||||
if(arrivalPrice != null){
|
||||
totalPrice = arrivalPrice.multiply(new BigDecimal(cgdInfo.getPurchaseQuantity()));
|
||||
}else{
|
||||
totalPrice = procurementPrice.multiply(new BigDecimal(cgdInfo.getPurchaseQuantity()));
|
||||
}
|
||||
cgdInfo.setTotalPrice(totalPrice);
|
||||
|
||||
if (cgdInfo.getMaterialImg() != null){
|
||||
cgdInfo.setMaterialImg(getImageNetUrl(cgdInfo.getMaterialImg()));
|
||||
}
|
||||
}
|
||||
IPage<CgdInfoEntity> entityPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
|
||||
entityPage.setRecords(BeanUtil.copyToList(list, CgdInfoEntity.class));
|
||||
return entityPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取管理平台静态资源路径
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private void getOpeMediaAddress() {
|
||||
if (serverNetUrl == null || serverNetUrl.equals("")) {
|
||||
JSONObject json = sysConfigApi.getByKey("ope_media_address");
|
||||
if (json != null) {
|
||||
String configValue = json.getString("configValue");
|
||||
if (!configValue.endsWith("/")) {
|
||||
configValue += "/";
|
||||
}
|
||||
serverNetUrl = configValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getImageNetUrl(String imageUrl) {
|
||||
|
||||
return serverNetUrl + imageUrl;
|
||||
}
|
||||
@Override
|
||||
public void reviewPurchaseOrder(CgdMainEntity cgdMainEntity) {
|
||||
NuInvoicingCgdMain cgdMain = new NuInvoicingCgdMain();
|
||||
|
|
|
|||
Loading…
Reference in New Issue