Compare commits

..

No commits in common. "92711ff45302c5a1a8e9df3cc1b6d0fde899438c" and "82155ada91ef530501c3f5c8d4966574d67ac717" have entirely different histories.

2 changed files with 4 additions and 64 deletions

View File

@ -89,11 +89,5 @@ public class ItemController extends BaseController {
return success();
}
@RequestMapping("/getGroup")
public Result<?> getGroup() {
Integer itemId = parmsUtil.getInteger("id","item_id为空");
return success(itemService.getGroup(itemId));
}
}

View File

@ -28,7 +28,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ -201,32 +200,15 @@ public class ItemService extends BaseService {
@Transactional(rollbackFor = Exception.class)
public void saveGroup(List<ItemGroupList> list, ItemParam itemParam) {
if (itemParam.getName() != null&&itemParam.getName().isEmpty())
{
throw new MessageException("组套名称不能为空");
}
if (itemParam.getUnit() != null&&itemParam.getUnit().isEmpty())
{
throw new MessageException("组套单位不能为空");
}
ManagerUser managerUser = getManagerUser();
QueryWrapper<Item> itemQueryWrapper = new QueryWrapper<>();
itemQueryWrapper.ne("del_flag", 1);
QueryWrapper<ItemGroupList> itemGroupListqueryWrapper = new QueryWrapper<>();
itemGroupListqueryWrapper.ne("del_flag",1);
Integer item_id=itemParam.getId();
Item itemInfo =null;
if(item_id!=null&&item_id>0){
QueryWrapper<Item> itemQueryWrapper = new QueryWrapper<>();
itemQueryWrapper.ne("del_flag", 1);
itemQueryWrapper.eq("id", item_id);
itemInfo= itemMapper.selectOne(itemQueryWrapper);
}
Item itemInfo = itemMapper.selectOne(itemQueryWrapper);
if(itemInfo==null){
itemInfo=new Item();
@ -314,51 +296,15 @@ public class ItemService extends BaseService {
itemMapper.updateById(itemInfo);
}
public HashMap<String,Object> getGroup(int itemId) {
public void getItemGroupList() {
QueryWrapper<Item> itemQueryWrapper = new QueryWrapper<>();
itemQueryWrapper.ne("del_flag", 1);
itemQueryWrapper.eq("is_group",true);
itemQueryWrapper.eq("id",itemId);
Item itemInfo = itemMapper.selectOne(itemQueryWrapper);
if (itemInfo==null ) {
throw new MessageException("诊疗项目数据不存在");
}
QueryWrapper<ItemGroupList> itemGroupListqueryWrapper = new QueryWrapper<>();
itemGroupListqueryWrapper.ne("del_flag",1);
itemGroupListqueryWrapper.eq("item_id",itemId);
List<ItemGroupList> itemGroupList = itemGroupListMapper.selectList(itemGroupListqueryWrapper);
//设置返回结果
HashMap<String,Object> resultMap = new HashMap<>();
//设置结果json中info字段
HashMap<String,Object> infoMap = new HashMap<>();
infoMap.put("name",itemInfo.getItemName());
infoMap.put("unit",itemInfo.getUnit());
infoMap.put("id",itemInfo.getId());
resultMap.put("info",infoMap);
//设置结果json中list字段
List<HashMap<String,Object>> list = new ArrayList<>();
for (ItemGroupList itemGroup : itemGroupList) {
HashMap<String,Object> itemGroupMap = new HashMap<>();
itemGroupMap.put("name",itemGroup.getName());
itemGroupMap.put("unit",itemGroup.getUnit());
itemGroupMap.put("socialCode",itemGroup.getSocialCode());
itemGroupMap.put("unitPrice",itemGroup.getUnitPrice());
itemGroupMap.put("purchaseUnitPrice",itemGroup.getPurchaseUnitPrice());
itemGroupMap.put("number",itemGroup.getNumber());
itemGroupMap.put("id",itemGroup.getId());
list.add(itemGroupMap);
}
resultMap.put("list",list);
return resultMap;
}
}