Merge branch 'master-prod-new'
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <sql id="Update_Column_All"> |
| | | <trim prefixOverrides=","> |
| | | ,code = #{code},sealStatus = #{sealStatus},refundOperationType = #{refundOperationType},refundType = #{refundType},refundStatus = #{refundStatus},refundShopId = #{refundShopId},refundShopNo = #{refundShopNo},refundShopName = #{refundShopName},refundTotal = #{refundTotal},refundIntegral = #{refundIntegral},realRefundTotal = #{realRefundTotal},realRefundIntegral = #{realRefundIntegral},deductionTotal = #{deductionTotal},cashTotal = #{cashTotal},cashPurenessTotal = #{cashPurenessTotal},rechargeTotal = #{rechargeTotal},incrementTotal = #{incrementTotal},payee = #{payee},openBank = #{openBank},openBranch = #{openBranch},account = #{account},confirmStatus = #{confirmStatus},confirmId = #{confirmId},confirmNo = #{confirmNo},confirmName = #{confirmName},confirmRoleNo = #{confirmRoleNo},confirmRoleName = #{confirmRoleName},confirmCancel = #{confirmCancel},confirmCancelId = #{confirmCancelId},confirmCancelNo = #{confirmCancelNo},confirmCancelName = #{confirmCancelName},confirmCancelRoleNo = #{confirmCancelRoleNo},confirmCancelRoleName = #{confirmCancelRoleName},refundReason = #{refundReason},remarks = #{remarks},sourceType = #{sourceType},sourceAssistantType = #{sourceAssistantType},orderId = #{orderId},userId = #{userId},operatorType = #{operatorType},operatorId = #{operatorId},operatorNo = #{operatorNo},operatorName = #{operatorName},operatorAppId = #{operatorAppId},operatorAppCode = #{operatorAppCode},operatorAppName = #{operatorAppName},invalidTime = #{invalidTime},invalidType = #{invalidType},invalidId = #{invalidId},invalidNo = #{invalidNo},invalidName = #{invalidName},invalidRoleNo = #{invalidRoleNo},invalidRoleName = #{invalidRoleName},invalidAppId = #{invalidAppId},invalidAppCode = #{invalidAppCode},invalidAppName = #{invalidAppName},invalidRemarks = #{invalidRemarks},addTime = #{addTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | ,code = #{code},sealStatus = #{sealStatus},refundOperationType = #{refundOperationType},refundType = #{refundType},refundStatus = #{refundStatus},refundStatistics = #{refundStatistics},refundShopId = #{refundShopId},refundShopNo = #{refundShopNo},refundShopName = #{refundShopName},refundTotal = #{refundTotal},refundIntegral = #{refundIntegral},realRefundTotal = #{realRefundTotal},realRefundIntegral = #{realRefundIntegral},deductionTotal = #{deductionTotal},cashTotal = #{cashTotal},cashPurenessTotal = #{cashPurenessTotal},rechargeTotal = #{rechargeTotal},incrementTotal = #{incrementTotal},payee = #{payee},openBank = #{openBank},openBranch = #{openBranch},account = #{account},confirmStatus = #{confirmStatus},confirmId = #{confirmId},confirmNo = #{confirmNo},confirmName = #{confirmName},confirmRoleNo = #{confirmRoleNo},confirmRoleName = #{confirmRoleName},confirmCancel = #{confirmCancel},confirmCancelId = #{confirmCancelId},confirmCancelNo = #{confirmCancelNo},confirmCancelName = #{confirmCancelName},confirmCancelRoleNo = #{confirmCancelRoleNo},confirmCancelRoleName = #{confirmCancelRoleName},refundReason = #{refundReason},remarks = #{remarks},sourceType = #{sourceType},sourceAssistantType = #{sourceAssistantType},orderId = #{orderId},userId = #{userId},operatorType = #{operatorType},operatorId = #{operatorId},operatorNo = #{operatorNo},operatorName = #{operatorName},operatorAppId = #{operatorAppId},operatorAppCode = #{operatorAppCode},operatorAppName = #{operatorAppName},invalidTime = #{invalidTime},invalidType = #{invalidType},invalidId = #{invalidId},invalidNo = #{invalidNo},invalidName = #{invalidName},invalidRoleNo = #{invalidRoleNo},invalidRoleName = #{invalidRoleName},invalidAppId = #{invalidAppId},invalidAppCode = #{invalidAppCode},invalidAppName = #{invalidAppName},invalidRemarks = #{invalidRemarks},addTime = #{addTime},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime} |
| | | </trim> |
| | | </sql> |
| | | |
| | |
| | | <selectKey keyProperty="id" resultType="String" order="BEFORE"> |
| | | select replace(uuid(),'-','') from dual |
| | | </selectKey> |
| | | insert into refund_record (id,code,sealStatus,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime) values (#{id},#{code},#{sealStatus},#{refundOperationType},#{refundType},#{refundStatus},#{refundShopId},#{refundShopNo},#{refundShopName},#{refundTotal},#{refundIntegral},#{realRefundTotal},#{realRefundIntegral},#{deductionTotal},#{cashTotal},#{cashPurenessTotal},#{rechargeTotal},#{incrementTotal},#{payee},#{openBank},#{openBranch},#{account},#{confirmStatus},#{confirmId},#{confirmNo},#{confirmName},#{confirmRoleNo},#{confirmRoleName},#{confirmCancel},#{confirmCancelId},#{confirmCancelNo},#{confirmCancelName},#{confirmCancelRoleNo},#{confirmCancelRoleName},#{refundReason},#{remarks},#{sourceType},#{sourceAssistantType},#{orderId},#{userId},#{operatorType},#{operatorId},#{operatorNo},#{operatorName},#{operatorAppId},#{operatorAppCode},#{operatorAppName},#{invalidTime},#{invalidType},#{invalidId},#{invalidNo},#{invalidName},#{invalidRoleNo},#{invalidRoleName},#{invalidAppId},#{invalidAppCode},#{invalidAppName},#{invalidRemarks},#{addTime},#{isDel},#{createTime},#{editTime}) |
| | | insert into refund_record (id,code,sealStatus,refundOperationType,refundType,refundStatus,refundStatistics,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime) values (#{id},#{code},#{sealStatus},#{refundOperationType},#{refundType},#{refundStatus},#{refundStatistics},#{refundShopId},#{refundShopNo},#{refundShopName},#{refundTotal},#{refundIntegral},#{realRefundTotal},#{realRefundIntegral},#{deductionTotal},#{cashTotal},#{cashPurenessTotal},#{rechargeTotal},#{incrementTotal},#{payee},#{openBank},#{openBranch},#{account},#{confirmStatus},#{confirmId},#{confirmNo},#{confirmName},#{confirmRoleNo},#{confirmRoleName},#{confirmCancel},#{confirmCancelId},#{confirmCancelNo},#{confirmCancelName},#{confirmCancelRoleNo},#{confirmCancelRoleName},#{refundReason},#{remarks},#{sourceType},#{sourceAssistantType},#{orderId},#{userId},#{operatorType},#{operatorId},#{operatorNo},#{operatorName},#{operatorAppId},#{operatorAppCode},#{operatorAppName},#{invalidTime},#{invalidType},#{invalidId},#{invalidNo},#{invalidName},#{invalidRoleNo},#{invalidRoleName},#{invalidAppId},#{invalidAppCode},#{invalidAppName},#{invalidRemarks},#{addTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <insert id="insertById" parameterType="com.hx.phiappt.model.refund.RefundRecord"> |
| | | insert into refund_record (id,code,sealStatus,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime) values (#{id},#{code},#{sealStatus},#{refundOperationType},#{refundType},#{refundStatus},#{refundShopId},#{refundShopNo},#{refundShopName},#{refundTotal},#{refundIntegral},#{realRefundTotal},#{realRefundIntegral},#{deductionTotal},#{cashTotal},#{cashPurenessTotal},#{rechargeTotal},#{incrementTotal},#{payee},#{openBank},#{openBranch},#{account},#{confirmStatus},#{confirmId},#{confirmNo},#{confirmName},#{confirmRoleNo},#{confirmRoleName},#{confirmCancel},#{confirmCancelId},#{confirmCancelNo},#{confirmCancelName},#{confirmCancelRoleNo},#{confirmCancelRoleName},#{refundReason},#{remarks},#{sourceType},#{sourceAssistantType},#{orderId},#{userId},#{operatorType},#{operatorId},#{operatorNo},#{operatorName},#{operatorAppId},#{operatorAppCode},#{operatorAppName},#{invalidTime},#{invalidType},#{invalidId},#{invalidNo},#{invalidName},#{invalidRoleNo},#{invalidRoleName},#{invalidAppId},#{invalidAppCode},#{invalidAppName},#{invalidRemarks},#{addTime},#{isDel},#{createTime},#{editTime}) |
| | | insert into refund_record (id,code,sealStatus,refundOperationType,refundType,refundStatus,refundStatistics,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime) values (#{id},#{code},#{sealStatus},#{refundOperationType},#{refundType},#{refundStatus},#{refundStatistics},#{refundShopId},#{refundShopNo},#{refundShopName},#{refundTotal},#{refundIntegral},#{realRefundTotal},#{realRefundIntegral},#{deductionTotal},#{cashTotal},#{cashPurenessTotal},#{rechargeTotal},#{incrementTotal},#{payee},#{openBank},#{openBranch},#{account},#{confirmStatus},#{confirmId},#{confirmNo},#{confirmName},#{confirmRoleNo},#{confirmRoleName},#{confirmCancel},#{confirmCancelId},#{confirmCancelNo},#{confirmCancelName},#{confirmCancelRoleNo},#{confirmCancelRoleName},#{refundReason},#{remarks},#{sourceType},#{sourceAssistantType},#{orderId},#{userId},#{operatorType},#{operatorId},#{operatorNo},#{operatorName},#{operatorAppId},#{operatorAppCode},#{operatorAppName},#{invalidTime},#{invalidType},#{invalidId},#{invalidNo},#{invalidName},#{invalidRoleNo},#{invalidRoleName},#{invalidAppId},#{invalidAppCode},#{invalidAppName},#{invalidRemarks},#{addTime},#{isDel},#{createTime},#{editTime}) |
| | | </insert> |
| | | |
| | | <select id="selectList" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="com.hx.mybatisTool.SqlSentence" > |
| | |
| | | |
| | | <select id="selectOneByKey" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,code,sealStatus,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime |
| | | id,code,sealStatus,refundOperationType,refundType,refundStatus,refundStatistics,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime |
| | | from refund_record |
| | | WHERE id = #{value} |
| | | </select> |
| | | |
| | | <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.refund.RefundRecord" parameterType="java.lang.Object" > |
| | | select |
| | | id,code,sealStatus,refundOperationType,refundType,refundStatus,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime |
| | | id,code,sealStatus,refundOperationType,refundType,refundStatus,refundStatistics,refundShopId,refundShopNo,refundShopName,refundTotal,refundIntegral,realRefundTotal,realRefundIntegral,deductionTotal,cashTotal,cashPurenessTotal,rechargeTotal,incrementTotal,payee,openBank,openBranch,account,confirmStatus,confirmId,confirmNo,confirmName,confirmRoleNo,confirmRoleName,confirmCancel,confirmCancelId,confirmCancelNo,confirmCancelName,confirmCancelRoleNo,confirmCancelRoleName,refundReason,remarks,sourceType,sourceAssistantType,orderId,userId,operatorType,operatorId,operatorNo,operatorName,operatorAppId,operatorAppCode,operatorAppName,invalidTime,invalidType,invalidId,invalidNo,invalidName,invalidRoleNo,invalidRoleName,invalidAppId,invalidAppCode,invalidAppName,invalidRemarks,addTime,isDel,createTime,editTime |
| | | from refund_record |
| | | WHERE id = #{value} |
| | | </select> |
| | |
| | | //新增 |
| | | mircoRecordService.add(microRecord); |
| | | |
| | | return Result.success(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("id", microRecord.getId()); |
| | | return Result.success(data); |
| | | } |
| | | |
| | | /** 修改微整记录 */ |
| | |
| | | if(orderRefundDto.getIsRefund() == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否自动生成退款单不能为空"); |
| | | } |
| | | if(orderRefundDto.getRefundStatistics() == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款统计类型不能为空!"); |
| | | } |
| | | |
| | | OrdersTotal ordersTotal = ordersTotalService.selectOneByKey(orderRefundDto.getOrderId()); |
| | | if (ordersTotal == null) { |
| | |
| | | if(orderRefundDto.getIsRefund()==null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"是否自动生成退款单不能为空"); |
| | | } |
| | | if(orderRefundDto.getRefundStatistics() == null){ |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL,"退款统计类型不能为空!"); |
| | | } |
| | | |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String, Object> sqlMap = new HashMap<>(); |
| | | sqlSentence.setM(sqlMap); |
| | |
| | | import com.hx.phiappt.common.DeductionSingleConstants; |
| | | import com.hx.phiappt.common.RoleType; |
| | | import com.hx.phiappt.common.TreatSingleConstants; |
| | | import com.hx.phiappt.constants.tool.exception.ExceptionTool; |
| | | import com.hx.phiappt.dao.mapper.*; |
| | | import com.hx.phiappt.model.*; |
| | | import com.hx.phiappt.model.treat.TreatProject; |
| | |
| | | import com.hx.resultTool.Result; |
| | | import com.hx.util.DateUtil; |
| | | import com.hx.util.StringUtils; |
| | | import com.hx.util.thread.ExecutorServiceTool; |
| | | import com.platform.constants.PlatformPattern; |
| | | import com.platform.exception.PlatTipsException; |
| | | import com.platform.resultTool.PlatformCode; |
| | |
| | | treatSingle.setUserId(visitOrder.getUserId()); |
| | | |
| | | |
| | | |
| | | |
| | | treatV3Service.add(treatSingle, projectList, visitOrder, employeeRole, isMicNotice, signList); |
| | | |
| | | //开启多线程处理用户科室关系 |
| | | ExecutorServiceTool fixedThreadPool = new ExecutorServiceTool(1, 1); |
| | | try { |
| | | fixedThreadPool.getThreadPool().execute(() -> treatV3Service.doctorRoomHandler(treatSingle.getId())); |
| | | }catch (Exception e){ |
| | | logger.error("开启多线程处理用户科室关系失败"+ ExceptionTool.getExceptionInfo(e)); |
| | | }finally { |
| | | fixedThreadPool.shutdown(); |
| | | } |
| | | //返回id |
| | | JSONObject data = new JSONObject(); |
| | | data.put("treatSingleId", treatSingle.getId()); |
| | |
| | | }); |
| | | |
| | | } else { |
| | | //更新结束时间 和 发行数量 |
| | | //查询剩余数量 |
| | | int surplusNum = couponMapper.selectCouponSurplusNum(coupon.getId()); |
| | | //则更新结束时间 和发行数量 |
| | | Integer diffDay = DateUtil.differDay(coupon.getEndTime(), new Date()); |
| | | coupon.setIssueNum(999 + surplusNum); |
| | | if (diffDay > 0) { |
| | | coupon.setEndTime(DateUtil.addDay(coupon.getEndTime(), diffDay)); |
| | | coupon.setIssueEndTime(coupon.getEndTime()); |
| | | if (surplusNum < 999) { |
| | | //默认发行数量增加到剩余999 |
| | | coupon.setIssueNum(coupon.getIssueNum() + (999 - surplusNum)); |
| | | } |
| | | //默认将券的配置延期30天 |
| | | coupon.setEndTime(DateUtil.addDay(coupon.getEndTime(), 30)); |
| | | coupon.setIssueEndTime(coupon.getEndTime()); |
| | | commonService.updateAll(CouponMapper.class, coupon); |
| | | } |
| | | return coupon; |
| | |
| | | refundRecord.setOperatorNo(employee.getEmployeeNo()); |
| | | refundRecord.setOperatorName(employee.getCnName()); |
| | | refundRecord.setRefundIntegral(orderRefundDto.getRefundIntegral()); |
| | | refundRecord.setRefundStatistics(orderRefundDto.getRefundStatistics()); |
| | | |
| | | refundRecord.setRefundOperationType(orderRefundDto.getRefundOperationType()); |
| | | /////退款的备注 |
| | |
| | | |
| | | orderPartRefundDto.setOrdersTotalDto(ordersTotalDto);//填充主订单信息 |
| | | |
| | | |
| | | orderPartRefundDto.setRefundStatistics(refundRecord.getRefundStatistics()); |
| | | //填充操作人,用户的基本信息 |
| | | orderPartRefundDto.setOrdersTotalDto(ordersTotalDto); |
| | | orderPartRefundDto.setOperatorId(cancelOrder.getOperatorId()); |
| | |
| | | |
| | | /** 更新治疗单签名 */ |
| | | void updateSign(TreatSingle treatSingle, List<TreatSingleSign> signList, EmployeeRole employeeRole); |
| | | |
| | | /**处理用户科室关系*/ |
| | | void doctorRoomHandler(String treatSingleId); |
| | | } |
| | |
| | | package com.hx.phip.service.treat.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.hx.common.dao.CommonDao; |
| | | import com.hx.common.service.CommonService; |
| | | import com.hx.exception.TipsException; |
| | |
| | | private TreatProjectDoctorMapper treatProjectDoctorMapper; |
| | | @Resource |
| | | private TreatBodyPartMapper treatBodyPartMapper; |
| | | @Resource |
| | | private UserFamiliesRoomMapper userFamiliesRoomMapper; |
| | | @Resource |
| | | private FamiliesRoomMapper familiesRoomMapper; |
| | | @Resource |
| | | private UserBeChangeLogMapper userBeChangeLogMapper; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /**处理用户科室关系*/ |
| | | @Override |
| | | public void doctorRoomHandler(String treatSingleId) { |
| | | logger.info("-----新增治疗单,多线程处理用户科室关系----"); |
| | | TreatSingle treatSingle = treatSingleMapper.selectOneByKey(treatSingleId); |
| | | if (treatSingle == null){ |
| | | logger.info("新增治疗单处理科室关系,查询治疗单失败"+treatSingleId); |
| | | return; |
| | | } |
| | | if (StringUtils.isEmpty(treatSingle.getUserId())){ |
| | | logger.info("新增治疗单处理科室关系,用户id为空"); |
| | | return; |
| | | } |
| | | User user = userMapper.selectOneByKey(treatSingle.getUserId()); |
| | | if (user == null){ |
| | | logger.info("新增治疗单处理科室关系,查询用户失败"+treatSingle.getUserId()); |
| | | return; |
| | | } |
| | | SqlSentence sqlSentence = new SqlSentence(); |
| | | Map<String,Object> sqlMap = new HashMap<>(); |
| | | sqlMap.put("isDel",BaseEntity.NO); |
| | | sqlMap.put("userId",treatSingle.getUserId()); |
| | | sqlMap.put("treatSingleId",treatSingleId); |
| | | sqlMap.put("type","doctor"); |
| | | sqlSentence.sqlSentence("SELECT * FROM user_families_room WHERE isDel = #{m.isDel} " + |
| | | " AND userId = #{m.userId} AND familiesRoomName IN ('注射科','皮肤科') ",sqlMap); |
| | | List<UserFamiliesRoom> userFamiliesRoomList = userFamiliesRoomMapper.selectList(sqlSentence); |
| | | Map<String,UserFamiliesRoom> dataMap = new HashMap<>(); |
| | | if (userFamiliesRoomList != null && userFamiliesRoomList.size() > 0){ |
| | | for (UserFamiliesRoom userFamiliesRoom : userFamiliesRoomList) { |
| | | dataMap.put(userFamiliesRoom.getFamiliesRoomId(),userFamiliesRoom); |
| | | } |
| | | } |
| | | sqlSentence.sqlSentence("SELECT * FROM treat_project_doctor WHERE isDel = #{m.isDel} " + |
| | | " AND treatSingleId = #{m.treatSingleId} AND type = #{m.type} ",sqlMap); |
| | | List<TreatProjectDoctor> treatProjectDoctorList = treatProjectDoctorMapper.selectList(sqlSentence); |
| | | if (treatProjectDoctorList != null && treatProjectDoctorList.size() > 0){ |
| | | for (TreatProjectDoctor treatProjectDoctor : treatProjectDoctorList) { |
| | | if (StringUtils.isEmpty(treatProjectDoctor.getDepartmentId())){ |
| | | continue; |
| | | } |
| | | UserFamiliesRoom mapData = dataMap.get(treatProjectDoctor.getDepartmentId()); |
| | | if (mapData != null){ |
| | | logger.info("新增治疗单处理科室关系,已存在科室关系,跳过处理:"+mapData.getFamiliesRoomName()); |
| | | continue; |
| | | } |
| | | logger.info("新增治疗单处理科室关系,治疗单医生数据:"+JSON.toJSONString(treatProjectDoctor)); |
| | | FamiliesRoom familiesRoom = familiesRoomMapper.selectOneByKey(treatProjectDoctor.getDepartmentId()); |
| | | //找不到科室信息不处理 |
| | | if (familiesRoom == null){ |
| | | logger.info("新增治疗单处理科室关系,查询科室失败,跳过处理:"+treatProjectDoctor.getDepartmentId()); |
| | | continue; |
| | | } |
| | | //不是皮肤科和注射科不处理 |
| | | if (!"注射科".equals(familiesRoom.getFamiliesRoomName()) && !"皮肤科".equals(familiesRoom.getFamiliesRoomName())){ |
| | | logger.info("新增治疗单处理科室关系,非注射科和皮肤科,跳过处理:"+familiesRoom.getFamiliesRoomName()); |
| | | continue; |
| | | } |
| | | UserFamiliesRoom userFamiliesRoom = new UserFamiliesRoom(); |
| | | userFamiliesRoom.setUserId(treatSingle.getUserId()); |
| | | userFamiliesRoom.setFamiliesRoomId(treatProjectDoctor.getDepartmentId()); |
| | | userFamiliesRoom.setFamiliesRoomName(familiesRoom.getFamiliesRoomName()); |
| | | userFamiliesRoom.setDoctorId(treatProjectDoctor.getCommonId()); |
| | | Employee employee = employeeMapper.selectOneByKey(treatProjectDoctor.getCommonId()); |
| | | if (employee != null){ |
| | | userFamiliesRoom.setDoctorName(employee.getCnName()); |
| | | } |
| | | userFamiliesRoom.setIsDefault(0); |
| | | if (userFamiliesRoomMapper.insert(userFamiliesRoom) != 1){ |
| | | throw new TipsException("新增失败1!"+ JSON.toJSONString(userFamiliesRoom)); |
| | | } |
| | | //新增修改记录 |
| | | UserBeChangeLog userBeChangeLog = new UserBeChangeLog(); |
| | | userBeChangeLog.setUserId(user.getId()); |
| | | userBeChangeLog.setUserName(user.getName()); |
| | | userBeChangeLog.setUserLevel(user.getUserLevel()); |
| | | userBeChangeLog.setUserType(user.getUserType()); |
| | | userBeChangeLog.setUserStatus(user.getUserStatus()); |
| | | userBeChangeLog.setHisCorpUserId(user.getHisCorpUserId()); |
| | | userBeChangeLog.setBelongShopId(user.getShopId()); |
| | | userBeChangeLog.setMemberNO(user.getMemberNO()); |
| | | userBeChangeLog.setCIQ(user.getCIQ()); |
| | | userBeChangeLog.setChangeType(UserBeChangeLog.CHANGE_TYPE_ROOM_DOCTOR); |
| | | userBeChangeLog.setCommonId(treatProjectDoctor.getCommonId()); |
| | | if (employee != null){ |
| | | userBeChangeLog.setCommonValue(employee.getCnName()); |
| | | } |
| | | userBeChangeLog.setRoomId(treatProjectDoctor.getDepartmentId()); |
| | | userBeChangeLog.setRoomName(familiesRoom.getFamiliesRoomName()); |
| | | userBeChangeLog.setRemark("治疗单:"+treatSingle.getTreatSingleNo()); |
| | | if (userBeChangeLogMapper.insert(userBeChangeLog) != 1){ |
| | | throw new TipsException("新增失败2!"+ JSON.toJSONString(userBeChangeLog)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /////////////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | |
| | | // 用户资金数据校验 |
| | | UserMoney userMoney = userMoneyService.selectUserIdDecrypt(userMoneyUnclaimed.getUserId()); |
| | | logger.info("用户{},用户资产{},用户金额记录{}",userMoneyUnclaimed.getUserId(),JSON.toJSONString(userMoney),JSON.toJSONString(userMoneyUnclaimed)); |
| | | if (userMoney == null) { |
| | | throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "用户的资产数据不存在"); |
| | | } else { |