修改bug,添加校验
This commit is contained in:
parent
10c7641298
commit
5f25275afc
|
|
@ -211,7 +211,10 @@ public class InvoicingApi {
|
|||
@AutoLog(value = "作废采购单信息")
|
||||
@PostMapping(value = "/voidedCgdMain")
|
||||
public Result<String> voidedCgdMain(@RequestBody CgdMainEntity cgdMainEntity, HttpServletRequest req) {
|
||||
invoicingApi.voidedCgdMain(cgdMainEntity);
|
||||
String result = invoicingApi.voidedCgdMain(cgdMainEntity);
|
||||
if ("2".equals( result)){
|
||||
return Result.error("不是待入库状态,不可进行作废操作,请刷新页面!");
|
||||
}
|
||||
return Result.OK("操作成功");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,12 +110,10 @@ public class CgdInfoEntity implements Serializable {
|
|||
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String categoryName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String typeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String medicationName;
|
||||
private java.lang.String materialUnits;
|
||||
|
||||
|
||||
// 格式化getter方法
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public interface IInvoicingApi {
|
|||
|
||||
void emptiedQgInfo();
|
||||
|
||||
void voidedCgdMain(CgdMainEntity cgdMainEntity);
|
||||
String voidedCgdMain(CgdMainEntity cgdMainEntity);
|
||||
|
||||
void updateWarehouserEnabled(MaterialInfoEntity materialInfoEntity);
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ public class NuInvoicingCgdInfo implements Serializable {
|
|||
private java.lang.String typeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String medicationName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String materialUnits;
|
||||
|
||||
|
||||
// // 格式化getter方法
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.nu.modules.cgd.mapper.NuInvoicingCgdInfoMapper">
|
||||
|
||||
<select id="queryCgdInfoList" resultType="com.nu.modules.cgd.entity.NuInvoicingCgdInfo">
|
||||
select a.*,b.material_img,b.tag_type,c.item_text as tagName,d.kcsl from nu_invoicing_cgd_info a
|
||||
select a.*,b.material_img,b.tag_type,c.item_text as tagName,d.kcsl,b.material_units from nu_invoicing_cgd_info a
|
||||
left join nu_config_material_info b on a.wl_id = b.id
|
||||
left join sys_dict_item c on b.tag_type = c.item_value and c.dict_id = '1978662656563613698'
|
||||
LEFT JOIN nu_warehouse_material_info d on a.wl_id = d.wl_id
|
||||
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
|
||||
<select id="selectWlNumList" resultType="com.nu.modules.cgd.entity.NuInvoicingCgdInfo">
|
||||
select b.nu_id,b.wl_id,sum(purchase_quantity) as purchase_quantity from nu_invoicing_cgd_main a
|
||||
select b.nu_id,b.wl_id,sum(purchase_quantity) as purchase_quantity,b.dhbl from nu_invoicing_cgd_main a
|
||||
inner join nu_invoicing_cgd_info b on a.id = b.cgd_id
|
||||
where a.status in (0,1)
|
||||
where a.status in (0,1) and a.cgd_type in (0,1)
|
||||
and b.nu_id = #{params.nuId} and b.wl_id = #{params.wlId}
|
||||
GROUP BY b.nu_id,b.wl_id
|
||||
GROUP BY b.nu_id,b.wl_id,b.dhbl
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -193,7 +193,7 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
}
|
||||
int dqsl = info.getPurchaseQuantity();
|
||||
String upperLimit = ConfigMaterialInfo.getUpperLimit();
|
||||
if(Integer.parseInt(upperLimit)<(totalQgsl + dqsl)){
|
||||
if(Integer.parseInt(upperLimit)<(totalQgsl + dqsl )){
|
||||
result = "2@"+ (Integer.parseInt(upperLimit) - totalQgsl);
|
||||
break;
|
||||
}
|
||||
|
|
@ -204,11 +204,12 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
List<NuInvoicingCgdInfo> listcg = cgdInfoMapper.selectWlNumList(cgdInfoParam);
|
||||
int cgdNum = 0;
|
||||
for(NuInvoicingCgdInfo cgdInfo : listcg){
|
||||
cgdNum += cgdInfo.getPurchaseQuantity();
|
||||
//cgdNum = 采购数量*兑换比例
|
||||
cgdNum += cgdInfo.getPurchaseQuantity() * Integer.parseInt(cgdInfo.getDhbl());
|
||||
}
|
||||
|
||||
if(Integer.parseInt(upperLimit)<(totalQgsl + dqsl + cgdNum)){
|
||||
result = "5@"+ (totalQgsl + dqsl + cgdNum);
|
||||
if(Integer.parseInt(upperLimit)<(totalQgsl + dqsl*Integer.parseInt(info.getDhbl()) + cgdNum)){
|
||||
result = "5@"+ (totalQgsl + dqsl*Integer.parseInt(info.getDhbl()) + cgdNum - Integer.parseInt(upperLimit));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -533,13 +534,18 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
}
|
||||
|
||||
@Override
|
||||
public void voidedCgdMain(CgdMainEntity cgdMainEntity) {
|
||||
public String voidedCgdMain(CgdMainEntity cgdMainEntity) {
|
||||
NuInvoicingCgdMain cgdMainPar = baseMapper.selectById(cgdMainEntity.getId());
|
||||
if (!"0".equals(cgdMainPar.getStatus())){
|
||||
//不是待入库状态,不可进行作废操作,请刷新页面
|
||||
return "2";
|
||||
}
|
||||
NuInvoicingCgdMain cgdMain = new NuInvoicingCgdMain();
|
||||
BeanUtils.copyProperties(cgdMainEntity,cgdMain);
|
||||
// cgdMain.setStatus("3");
|
||||
cgdMain.setCgdType("9");
|
||||
baseMapper.updateById(cgdMain);
|
||||
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -894,7 +900,7 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
Integer rksl = cgdInfo.getRksl();//入库数量
|
||||
Integer wrksl = 0;//未入库数量
|
||||
Integer xzsl = cgdInfo.getXzsl();//销账数量
|
||||
Integer jhNum = cgdInfoEntityDto.getJhNum();//本次入库数量
|
||||
Integer jhNum = cgdInfoEntityDto.getJhNum();//本次入库数量 = 拣货数量 * 兑换比例
|
||||
String jhType = cgdInfoEntityDto.getJhType();//入库类型 0入库 1销账
|
||||
String jhPic = cgdInfoEntityDto.getJhPic();//拣货图片
|
||||
BigDecimal procurementPrice = cgdInfo.getProcurementPrice();//原来采购单价
|
||||
|
|
@ -913,7 +919,7 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
crkInfo.setCgdId(cgdInfo.getCgdId());
|
||||
crkInfo.setNuId(cgdInfo.getNuId());
|
||||
crkInfo.setWlId(cgdInfo.getWlId());
|
||||
crkInfo.setCrkNum(jhNum);//出入库数量
|
||||
crkInfo.setCrkNum(jhNum * Integer.parseInt(cgdInfo.getDhbl()));//出入库数量
|
||||
crkInfo.setCrkType("1");//请购单类型 此处是固定的
|
||||
crkInfo.setJhPic(jhPic);//拣货图片
|
||||
crkInfo.setOldPrice(procurementPrice);//原来的价格(最开始的采购价格)
|
||||
|
|
@ -932,7 +938,7 @@ public class NuInvoicingCgdMainServiceImpl extends ServiceImpl<NuInvoicingCgdMai
|
|||
|
||||
if(StringUtils.equals("0",jhType)){//入库操作
|
||||
crkInfo.setCrkStatus("1");
|
||||
dqkcl = (Integer.parseInt(kcsl) + jhNum) + "";
|
||||
dqkcl = (Integer.parseInt(kcsl) + jhNum * Integer.parseInt(cgdInfo.getDhbl())) + "";
|
||||
rksl = rksl + jhNum;
|
||||
}else if(StringUtils.equals("1",jhType)){//销账操作
|
||||
crkInfo.setCrkStatus("2");
|
||||
|
|
|
|||
Loading…
Reference in New Issue