| | |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.utils.AesUtils; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.oprationcenter.model.HospitalInfo; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | private IProductOrderService productOrderService; |
| | | @Autowired |
| | | private SysUserService sysUserServiceFeign; |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | |
| | | } |
| | | return productOrderDetailService.all(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | |
| | | } |
| | | return productOrderDetailService.groupList(params); |
| | | } |
| | | |
| | | /** |
| | | * 查询到期列表 |
| | | */ |
| | |
| | | } |
| | | return productOrderDetailService.productEndList(params); |
| | | } |
| | | |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | |
| | | if (organizations.size() > 0) { |
| | | productOrderDetail.setCreateUserOrgCode(organizations.get(organizations.size() - 1).getOrgCode()); |
| | | } |
| | | // 对于读片量、产品有效的开始、结束日期进行加密 |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if ((productOrderDetail.getAilightCountEncryption() == null) || (productOrderDetail.getAilightCountEncryption().isEmpty())) { |
| | | try { |
| | | productOrderDetail.setAilightCountEncryption(AesUtils.encrypt(productOrderDetail.getAilightCount().toString())); |
| | | productOrderDetail.setProBegintimeEncryption(AesUtils.encrypt(dateFormat.format(productOrderDetail.getProBegintime()))); |
| | | productOrderDetail.setProEndtimeEncryption(AesUtils.encrypt(dateFormat.format(productOrderDetail.getProEndtime()))); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | boolean v = productOrderDetailService.saveOrUpdate(productOrderDetail); |
| | | if (v) { |
| | | return ResultBody.ok().data(productOrderDetail).msg("保存成功"); |
| | |
| | | } |
| | | } |
| | | } |
| | | // 对于读片量、产品有效的开始、结束日期进行加密 |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if ((list.get(i).getAilightCountEncryption() == null) || (list.get(i).getAilightCountEncryption().isEmpty())) { |
| | | try { |
| | | list.get(i).setAilightCountEncryption(AesUtils.encrypt(list.get(i).getAilightCount().toString())); |
| | | list.get(i).setProBegintimeEncryption(AesUtils.encrypt(dateFormat.format(list.get(i).getProBegintime()))); |
| | | list.get(i).setProEndtimeEncryption(AesUtils.encrypt(dateFormat.format(list.get(i).getProEndtime()))); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //写充值套餐给用户 |
| | | Boolean v = productOrderDetailService.saveBatch(list); |
| | | //写充值记录 |
| | |
| | | if (v && r && p) { |
| | | if (isenabled) { |
| | | return ResultBody.ok().data(list.size()).msg("充值成功,但是试用套餐需要管理审核才可使用!"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.ok().data(list.size()).msg("产品充值成功..."); |
| | | } |
| | | } else { |
| | |
| | | |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * |
| | | * @param datatype 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | |
| | | |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * |
| | | * @param params datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | |
| | | |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取软件服务周期 和 读片总量 |
| | | * |
| | | */ |
| | | @ApiOperation(value = "获取软件服务周期") |
| | | @GetMapping("/getContractBeginEndTimeAndNum") |
| | |
| | | } |
| | | return ResultBody.ok().data(map); |
| | | } |
| | | |
| | | /** |
| | | * 私有云套餐验证 |
| | | * @param params 参数 |
| | | * hospitalId 医院ID |
| | | * departmentId 科室ID |
| | | * @return com.kidgrow.common.model.ResultBody |
| | | */ |
| | | @ApiOperation(value = "私有云套餐验证") |
| | | @PostMapping("/verificateProductOrderDetail") |
| | | public ResultBody verificateProductOrderDetail(@RequestBody Map<String,Object> params ){ |
| | | Long hospitalId = Long.valueOf(params.get("hospitalId").toString()); |
| | | Long departmentId = Long.valueOf(params.get("departmentId").toString()); |
| | | return productOrderDetailService.verificateProductOrderDetail(hospitalId,departmentId); |
| | | } |
| | | |
| | | /** |
| | | * 根据Map的条件获取合同明细(套餐)列表 |
| | | * @param params |
| | | * @return com.kidgrow.common.model.ResultBody |
| | | */ |
| | | @ApiOperation(value = "根据Map的条件获取合同明细(套餐)列表") |
| | | @PostMapping("/findProductOrderDetailListByMap") |
| | | public ResultBody findProductOrderDetailListByMap(@RequestBody Map<String, Object> params) { |
| | | List<ProductOrderDetail> productOrderDetailList = productOrderDetailService.listByMap(params); |
| | | if ((productOrderDetailList!=null) && (productOrderDetailList.size() > 0)) { |
| | | return ResultBody.ok().data(productOrderDetailList); |
| | | } else { |
| | | return ResultBody.failed(); |
| | | } |
| | | } |
| | | } |