| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.crypto.symmetric.DES; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | private HisMzJysqController hisMzJysqController; |
| | | @Autowired |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | @Autowired |
| | | private ISysDeptService sysDeptService; |
| | | |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(transitionService.remove(wq)); |
| | | } |
| | | |
| | | @GetMapping("/getTransitionInfo") |
| | | @ApiOperation(value = "根据体检号获取汇总和明细的数据") |
| | | public AjaxResult getTransitionInfo(@RequestParam("tjNumber")String tjNumber){ |
| | | QueryWrapper<TbTransition> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("parent_pro_id","parent_pro_name","sum(ord_price) as ord_price") |
| | | .eq("tj_num",tjNumber) |
| | | .groupBy("parent_pro_name"); |
| | | List<TbTransition> list = transitionService.list(wrapper); |
| | | List<Long> parentProIds = list.stream().map(item -> item.getParentProId()).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjProject> projectQueryWrapper = new LambdaQueryWrapper<>(); |
| | | projectQueryWrapper.in(TjProject::getProId,parentProIds); |
| | | List<TjProject> projects = projectService.list(projectQueryWrapper); |
| | | JSONArray huiZong = JSONUtil.createArray(); |
| | | int index = 1; |
| | | for (TjProject project : projects) { |
| | | LambdaQueryWrapper<SysDept> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(SysDept::getDeptId,project.getDeptId()); |
| | | SysDept dept = sysDeptService.getOne(queryWrapper); |
| | | for (TbTransition tbTransition : list) { |
| | | if (tbTransition.getParentProId().toString().equals(project.getProId().toString())){ |
| | | JSONObject obj = JSONUtil.createObj(); |
| | | obj.putOpt("index",index++); |
| | | obj.putOpt("parent_pro_name",tbTransition.getParentProName()); |
| | | obj.putOpt("price",tbTransition.getOrdPrice()); |
| | | obj.putOpt("ks",dept.getDeptName()); |
| | | huiZong.add(obj); |
| | | } |
| | | } |
| | | } |
| | | wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("tj_num",tjNumber); |
| | | list = transitionService.list(wrapper); |
| | | JSONArray info = JSONUtil.createArray(); |
| | | index = 0; |
| | | for (TbTransition tbTransition : list) { |
| | | JSONObject obj = JSONUtil.createObj(); |
| | | obj.putOpt("index",index++); |
| | | obj.putOpt("parent_pro_name",tbTransition.getParentProName()); |
| | | obj.putOpt("pro_name",tbTransition.getProName()); |
| | | BigDecimal ordPrice = tbTransition.getOrdPrice(); |
| | | obj.putOpt("zongjia",ordPrice); |
| | | QueryWrapper<TjProject> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("pro_id",tbTransition.getProId()); |
| | | TjProject tjProject = projectService.getOne(queryWrapper); |
| | | Integer num = tjProject.getSl(); |
| | | obj.putOpt("num",num); |
| | | BigDecimal price = ordPrice.divide(new BigDecimal(num)); |
| | | obj.putOpt("danjia",price); |
| | | obj.putOpt("time",tbTransition.getCreateTime()); |
| | | info.put(obj); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("huizong",huiZong); |
| | | map.put("info",info); |
| | | return AjaxResult.success().put("data",map); |
| | | } |
| | | |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |