| | |
| | | } |
| | | setUserProjectItem(ordersTotal, userProject, userProjectItem, date, vo,orderItemSon,1); |
| | | commonService.insert(UserProjectItemMapper.class,userProjectItem);//新增用户项目子项记录 |
| | | //结账更新治疗单项目关联用户项目 |
| | | updateTreatProjectAssocUserProjectItem(commonService, userProjectItem, ordersTotal.getId(), vo.getId(), orderItemSon == null ? null : orderItemSon.getId()); |
| | | }else{ |
| | | map.put("commonId",vo.getCommonId()); |
| | | UserProject userProject=commonService.selectOne(UserProjectMapper.class,sqlSentence); |
| | |
| | | } |
| | | setUserProjectItem(ordersTotal, userProject, userProjectItem, date, vo,orderItemSon,0); |
| | | commonService.insert(UserProjectItemMapper.class,userProjectItem);//新增用户项目子项记录 |
| | | //结账更新治疗单项目关联用户项目 |
| | | updateTreatProjectAssocUserProjectItem(commonService, userProjectItem, ordersTotal.getId(), vo.getId(), orderItemSon == null ? null : orderItemSon.getId()); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | return stringBuffer.toString(); |
| | | } |
| | | |
| | | /** 结账更新治疗单项目关联用户项目 */ |
| | | private static void updateTreatProjectAssocUserProjectItem(CommonService commonService, UserProjectItem userProjectItem, String orderId, String orderItemId, String orderItemSonId){ |
| | | if(userProjectItem == null || StringUtils.isEmpty(userProjectItem.getId())){ |
| | | return; |
| | | } |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> values = new HashMap<>(); |
| | | sqlSentence.setM(values); |
| | | values.put("userProjectItemId", userProjectItem.getId()); |
| | | values.put("orderId", orderId); |
| | | values.put("orderItemId", orderItemId); |
| | | if(StringUtils.isEmpty(orderItemSonId)){ |
| | | sqlSentence.setSqlSentence(" userProjectItemId = #{m.userProjectItemId} where orderId = #{m.orderId} and orderItemId = #{m.orderItemId} and userProjectItemId is null "); |
| | | }else{ |
| | | values.put("orderItemSonId", orderItemSonId); |
| | | sqlSentence.setSqlSentence(" userProjectItemId = #{m.userProjectItemId} where orderId = #{m.orderId} and orderItemId = #{m.orderItemId} and orderItemSonId = #{m.orderItemSonId} and userProjectItemId is null "); |
| | | } |
| | | commonService.updateWhere(TreatProjectMapper.class, sqlSentence); |
| | | } |
| | | } |