修改bug
This commit is contained in:
parent
4a14eb2390
commit
bd409ea196
|
|
@ -52,6 +52,8 @@ public class InvoicingApi {
|
|||
String result = invoicingApi.addShoppingCartList(infoList);
|
||||
if("1".equals( result)){
|
||||
return Result.error("请购信息已存在,不可重复请购!");
|
||||
}else if(result.indexOf("2@")>-1){
|
||||
return Result.error("您已有其他物料请购数据,请购总数量超出库存上限,请修改请购数量,剩余请购数量为:" + result.split("@")[1]);
|
||||
}
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,13 +205,29 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
for (QgdInfoEntity info : infoList) {
|
||||
if(info.getPurchaseQuantity()!=null && info.getPurchaseQuantity()>0){
|
||||
//查询是否有请购信息
|
||||
QgdInfo qgdInfo = qgdInfoMapper.selectOne(new QueryWrapper<QgdInfo>().eq("wl_id",info.getWlId()).eq("nu_id",info.getNuId()));
|
||||
QgdInfo qgdInfo = qgdInfoMapper.selectOne(new QueryWrapper<QgdInfo>().eq("wl_id",info.getWlId()).eq("nu_id",info.getNuId()).eq("suppliers_id",info.getSuppliersId()));
|
||||
|
||||
//获取物料基础信息
|
||||
ConfigMaterialInfo ConfigMaterialInfo = configMaterialInfoMapper.selectById(info.getWlId());
|
||||
if(qgdInfo!=null){
|
||||
result = "1";
|
||||
break;
|
||||
}else{
|
||||
List<QgdInfo> listqg = qgdInfoMapper.selectList(new QueryWrapper<QgdInfo>().eq("wl_id",info.getWlId()).eq("nu_id",info.getNuId()));
|
||||
int totalQgsl = 0;
|
||||
if(StringUtils.isNotBlank(info.getKcsl())){
|
||||
totalQgsl = Integer.parseInt(info.getKcsl());
|
||||
}
|
||||
for(QgdInfo qgdInfoParam : listqg){
|
||||
totalQgsl += qgdInfoParam.getPurchaseQuantity();
|
||||
}
|
||||
int dqsl = info.getPurchaseQuantity();
|
||||
String upperLimit = ConfigMaterialInfo.getUpperLimit();
|
||||
if(Integer.parseInt(upperLimit)<(totalQgsl + dqsl)){
|
||||
result = "2@"+ (Integer.parseInt(upperLimit) - totalQgsl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//获取物料基础信息
|
||||
ConfigMaterialInfo ConfigMaterialInfo = configMaterialInfoMapper.selectById(info.getWlId());
|
||||
info.setWlName(ConfigMaterialInfo.getMaterialName());
|
||||
info.setWlMaterialNo(ConfigMaterialInfo.getMaterialNo());
|
||||
info.setWlSpecificationModel(ConfigMaterialInfo.getSpecificationModel());
|
||||
|
|
@ -317,6 +333,9 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
cgdInfo.setTagType(wlInfo.getTagType());
|
||||
cgdInfo.setTagName(wlInfo.getTagName());
|
||||
cgdInfo.setMaterialImg(wlInfo.getMaterialImg());
|
||||
cgdInfo.setCategoryId(wlInfo.getCategoryId());
|
||||
cgdInfo.setTypeId(wlInfo.getTypeId());
|
||||
cgdInfo.setMedicationId(wlInfo.getMedicationId());
|
||||
BigDecimal sl = new BigDecimal(params.getPurchaseQuantity());
|
||||
BigDecimal dj = new BigDecimal(params.getReferenceUnitPrice());
|
||||
BigDecimal wlzj = sl.multiply(dj);
|
||||
|
|
@ -389,13 +408,22 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
@Override
|
||||
public IPage<CgdInfoEntity> queryCgdInfoList(Integer pageNo, Integer pageSize, CgdInfoEntity cgdInfoEntityDto, HttpServletRequest req) {
|
||||
NuInvoicingCgdInfo nuInvoicingCgdInfo = new NuInvoicingCgdInfo();
|
||||
// String categoryId = cgdInfoEntityDto.getCategoryId();
|
||||
// String typeId = cgdInfoEntityDto.getTypeId();
|
||||
// String medicationId = cgdInfoEntityDto.getMedicationId();
|
||||
BeanUtils.copyProperties(cgdInfoEntityDto,nuInvoicingCgdInfo);
|
||||
// nuInvoicingCgdInfo.setCategoryId(null);
|
||||
// nuInvoicingCgdInfo.setTypeId(null);
|
||||
// nuInvoicingCgdInfo.setMedicationId(null);
|
||||
QueryWrapper<NuInvoicingCgdInfo> queryWrapper = QueryGenerator.initQueryWrapper("a",nuInvoicingCgdInfo, req.getParameterMap());
|
||||
Page<NuInvoicingCgdInfo> page = new Page<>(pageNo, pageSize);
|
||||
queryWrapper.apply(StringUtils.isNotBlank(cgdInfoEntityDto.getWlParamInfo())," b.material_name like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%') or\n" +
|
||||
queryWrapper.apply(StringUtils.isNotBlank(cgdInfoEntityDto.getWlParamInfo()),"( b.material_name like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%') or\n" +
|
||||
" b.pinyin like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%') or\n" +
|
||||
" b.material_no like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%') or\n" +
|
||||
" b.specification_model like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%')");
|
||||
" b.specification_model like concat('%', '"+cgdInfoEntityDto.getWlParamInfo()+"' , '%') )");
|
||||
// queryWrapper.eq(StringUtils.isNotBlank(categoryId),"b.category_id",categoryId);
|
||||
// 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);
|
||||
IPage<CgdInfoEntity> entityPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal());
|
||||
entityPage.setRecords(BeanUtil.copyToList(list, CgdInfoEntity.class));
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ public class BlWarehouseMaterialInfoController extends JeecgController<BlWarehou
|
|||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BlWarehouseMaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(blWarehouseMaterialInfo, req.getParameterMap());
|
||||
queryWrapper.apply(StringUtils.isNotBlank(blWarehouseMaterialInfo.getWlParamInfo()),"material_name like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%') or\n" +
|
||||
queryWrapper.apply(StringUtils.isNotBlank(blWarehouseMaterialInfo.getWlParamInfo()),"(material_name like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%') or\n" +
|
||||
" pinyin like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%') or\n" +
|
||||
" material_no like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%') or\n" +
|
||||
" specification_model like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%')");
|
||||
" specification_model like concat('%', '"+blWarehouseMaterialInfo.getWlParamInfo()+"' , '%') )");
|
||||
Page<BlWarehouseMaterialInfo> page = new Page<BlWarehouseMaterialInfo>(pageNo, pageSize);
|
||||
IPage<BlWarehouseMaterialInfo> pageList = blWarehouseMaterialInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
|
|
|
|||
Loading…
Reference in New Issue