This commit is contained in:
parent
85ba05ec5a
commit
ffdc8ebec7
|
|
@ -239,23 +239,29 @@ public class ItemService extends BaseService {
|
||||||
|
|
||||||
for (ItemGroupList itemGroup : list){
|
for (ItemGroupList itemGroup : list){
|
||||||
if (Objects.equals(itemGroup.getName(), "")) {
|
if (Objects.equals(itemGroup.getName(), "")) {
|
||||||
throw new MessageException("list中name为空");
|
throw new MessageException("list中名称为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(itemGroup.getUnit(), "")) {
|
if (Objects.equals(itemGroup.getUnit(), "")) {
|
||||||
throw new MessageException("list中unit为空");
|
throw new MessageException(itemGroup.getName()+"单位为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects.equals(itemGroup.getSocialCode(), "")) {
|
if (Objects.equals(itemGroup.getSocialCode(), "")) {
|
||||||
throw new MessageException("list中SocialCode为空");
|
throw new MessageException(itemGroup.getName()+"医保编码为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemGroup.getUnitPrice()==null) {
|
if (itemGroup.getUnitPrice()==null || itemGroup.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
throw new MessageException("list中unitPrice为空");
|
throw new MessageException(itemGroup.getName()+"售价为空 或 小于等于0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemGroup.getPurchaseUnitPrice()==null) {
|
|
||||||
throw new MessageException("list中purchaseUnitPrice为空");
|
if (itemGroup.getPurchaseUnitPrice()==null || itemGroup.getPurchaseUnitPrice().compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
throw new MessageException(itemGroup.getName()+"进货价为空 或 小于等于0");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemGroup.getNumber() == null || itemGroup.getNumber() <= 0)
|
||||||
|
{
|
||||||
|
throw new MessageException(itemGroup.getName()+"数量为空 或 非大于等于1");
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<SocialItem> socialItemQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<SocialItem> socialItemQueryWrapper = new QueryWrapper<>();
|
||||||
|
|
@ -268,9 +274,16 @@ public class ItemService extends BaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
//组织item金额字段
|
//组织item金额字段
|
||||||
unitPrice = unitPrice.add(itemGroup.getUnitPrice());
|
// unitPrice = unitPrice.add(itemGroup.getUnitPrice());
|
||||||
purchaseUnitPrice = purchaseUnitPrice.add(itemGroup.getPurchaseUnitPrice());
|
// purchaseUnitPrice = purchaseUnitPrice.add(itemGroup.getPurchaseUnitPrice());
|
||||||
|
|
||||||
|
unitPrice = unitPrice.add(itemGroup.getUnitPrice().multiply(BigDecimal.valueOf(itemGroup.getNumber())));
|
||||||
|
|
||||||
|
purchaseUnitPrice = purchaseUnitPrice.add(
|
||||||
|
itemGroup.getPurchaseUnitPrice().multiply(BigDecimal.valueOf(itemGroup.getNumber()))
|
||||||
|
);
|
||||||
|
|
||||||
|
itemGroup.setNumber(itemGroup.getNumber());
|
||||||
itemGroup.setItemId(itemInfo.getId());
|
itemGroup.setItemId(itemInfo.getId());
|
||||||
itemGroup.setDelFlag(false);
|
itemGroup.setDelFlag(false);
|
||||||
itemGroupListMapper.insertOrUpdate(itemGroup);
|
itemGroupListMapper.insertOrUpdate(itemGroup);
|
||||||
|
|
@ -282,4 +295,16 @@ public class ItemService extends BaseService {
|
||||||
|
|
||||||
itemMapper.updateById(itemInfo);
|
itemMapper.updateById(itemInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getItemGroupList() {
|
||||||
|
QueryWrapper<Item> itemQueryWrapper = new QueryWrapper<>();
|
||||||
|
itemQueryWrapper.ne("del_flag", 1);
|
||||||
|
itemQueryWrapper.eq("is_group",true);
|
||||||
|
|
||||||
|
QueryWrapper<ItemGroupList> itemGroupListqueryWrapper = new QueryWrapper<>();
|
||||||
|
itemGroupListqueryWrapper.ne("del_flag",1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue